Skip to content
Snippets Groups Projects
Commit 34f17430 authored by Montaño Sarria, Andres Felipe's avatar Montaño Sarria, Andres Felipe
Browse files

Removed unneccesary files

parent e071116b
Branches
No related tags found
No related merge requests found
Showing
with 0 additions and 1426 deletions
#include "ros/ros.h"
#include "std_msgs/String.h"
void talkerCallback(const std_msgs::String::ConstPtr& rosMsg)
{
ROS_INFO("I heard: [%s]", rosMsg->data.c_str());
}
int main(int argc, char** argv)
{
ros::init(argc, argv, "listener");
ros::NodeHandle hanlde;
ros::Subscriber talker_sub = hanlde.subscribe("/talker", 1000, talkerCallback);
ros::spin();
return 0;
}
\ No newline at end of file
#include "ros/ros.h"
#include "std_msgs/String.h"
void talkerCallback(const std_msgs::String::ConstPtr& rosMsg)
{
ROS_INFO("I heard: [%s]", rosMsg->data.c_str());
}
int main(int argc, char** argv)
{
ros::init(argc, argv, "listener2");
ros::NodeHandle hanlde;
ros::Subscriber talker_sub = hanlde.subscribe("/talker", 1000, talkerCallback);
ros::spin();
return 0;
}
\ No newline at end of file
#include "ros/ros.h"
#include "std_msgs/String.h"
#include <iostream>
int main(int argc, char **argv)
{
ros::init(argc, argv, "talker");
ros::NodeHandle hanlde;
ros::Publisher talker_pub = hanlde.advertise<std_msgs::String>("/talker", 1000);
ros::Rate loop_rate(10);
int count = 0;
while(ros::ok())
{
std_msgs::String rosMsg;
std::stringstream ss;
ss << "Hello Ros World [" << count << "]";
rosMsg.data = ss.str();
ROS_INFO("%s", rosMsg.data.c_str());
talker_pub.publish(rosMsg);
ros::spinOnce();
loop_rate.sleep();
++count;
}
return 0;
}
\ No newline at end of file
machine https://artifact.tecnalia.com/artifactory/tecnalia-robotics-debian
login andres.montano@tecnalia.com
password AKCp8jQcqPn8BQrgnqSShfsqvkS4vMbJL5WNYduVAcxaH7kbpVCyQsLnQgEhr4UeQNZoSgwwk
#!/usr/bin/env bash
# Autor: Thiago Silva
# Contact: thiagos.dasilva@gmail.com
# URL: https://github.com/thiggy01/change-gdm-background
# =================================================================== #
# Check if script is run by root.
if [ "$(id -u)" -ne 0 ] ; then
echo 'This script must be run as root or with the sudo command.'
exit 1
fi
# Check what linux distro is being used.
distro="$(lsb_release -c | cut -f 2)"
if ! [[ "$distro" =~ (focal|groovy|hirsute) ]]; then
echo 'Sorry, this script only works with focal, groovy or hirsute distros.'
exit 1
fi
# Check if glib 2.0 development libraries are installed.
if [ ! -x "$(command -v glib-compile-resources)" ]; then
echo 'Additional glib 2.0 libraries need to be installed.'
read -p 'Type y or Y to proceed. Any other key to exit: ' -n 1
if [[ "$REPLY" =~ ^[yY]$ ]]; then
apt install libglib2.0-dev-bin
else
echo "This tool can't run without required libraries"
echo "Exiting."
echo
exit 1
fi
fi
# Assign the default gdm theme file path.
if [ "$(lsb_release -i | awk '{print $3}')" == 'Ubuntu' ]; then
gdm3Resource=/usr/share/gnome-shell/theme/Yaru/gnome-shell-theme.gresource
elif [ "$(lsb_release -i | awk '{print $3}')" == 'Pop' ]; then
gdm3Resource=/usr/share/gnome-shell/theme/Pop/gnome-shell-theme.gresource
fi
# Create a backup file of the original theme if there isn't one.
[ ! -f "$gdm3Resource"~ ] && cp "$gdm3Resource" "$gdm3Resource~"
# Restore backup function.
restore () {
mv "$gdm3Resource~" "$gdm3Resource"
if [ "$?" -eq 0 ]; then
chmod 644 "$gdm3Resource"
echo 'GDM background sucessfully restored.'
read -p 'Do you want to restart gdm to apply change? (y/n):' -n 1
echo
if [[ "$REPLY" =~ ^[yY]$ ]]; then
service gdm restart
else
echo 'Restart GDM service to apply change.'
exit 0
fi
fi
}
# Restore the original gdm3 theme.
[ "$1" == "--restore" ] && restore
#Define main variables.
gdm3xml=$(basename "$gdm3Resource").xml
workDir="/tmp/gdm3-theme"
# Create directories from resource list.
CreateDirs() {
for resource in `gresource list "$gdm3Resource~"`; do
resource="${resource#\/org\/gnome\/shell\/}"
if [ ! -d "$workDir"/"${resource%/*}" ]; then
mkdir -p "$workDir"/"${resource%/*}"
fi
done
}
# Extract resources from binary file.
ExtractRes() {
for resource in `gresource list "$gdm3Resource~"`; do
gresource extract "$gdm3Resource~" "$resource" > \
"$workDir"/"${resource#\/org\/gnome\/shell\/}"
done
}
# Compile resources into a gresource binary file.
CompileRes() {
glib-compile-resources --sourcedir=$workDir/theme/ $workDir/theme/"$gdm3xml"
}
# Moves the newly created resource to its default place.
MoveRes() {
mv $workDir/theme/gnome-shell-theme.gresource $gdm3Resource
}
# Check if gresource was sucessfuly moved to its default folder.
Check() {
if [ "$?" -eq 0 ]; then
# Solve a permission change issue (thanks to @huepf from github).
chmod 644 "$gdm3Resource"
echo 'GDM background sucessfully changed.'
read -p 'Do you want to restart gdm to apply change? (y/n):' -n 1
echo
# If change was successful apply ask for gdm restart.
if [[ "$REPLY" =~ ^[yY]$ ]]; then
service gdm restart
else
echo "Change will be applied only after restarting gdm"
echo
fi
else
# If something went wrong, restore backup file.
echo 'something went wrong.'
restore
echo 'No changes were applied.'
fi
}
CleanUp() {
# Remove temporary directories and files.
rm -r "$workDir"
exit 0
}
# Test if argument is an image file.
if [[ $(file --mime-type -b "$1") == image/*g ]]; then
# Define image variables.
gdmBgImg=$(realpath "$1")
imgFile=$(basename "$gdmBgImg")
# Call procedures to create directories and extract resources to them.
CreateDirs
ExtractRes
# Copy selected image to the resources directory.
cp "$gdmBgImg" "$workDir"/theme
# Change gdm background to the image you submited.
oldBg="#lockDialogGroup \{.*?\}"
newBg="#lockDialogGroup {
background: url('resource:\/\/\/org\/gnome\/shell\/theme\/$imgFile');
background-size: cover; }"
perl -i -0777 -pe "s/$oldBg/$newBg/s" "$workDir"/theme/gdm3.css
# Generate gresource xml file.
echo '<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/gnome/shell/theme">' > "$workDir"/theme/"$gdm3xml"
for file in `gresource list "$gdm3Resource~"`; do
echo " <file>${file#\/org\/gnome/shell\/theme\/}</file>" \
>> "$workDir"/theme/"$gdm3xml"
done
echo " <file>$imgFile</file>" >> "$workDir"/theme/"$gdm3xml"
echo ' </gresource>
</gresources>' >> "$workDir"/theme/"$gdm3xml"
# Compile the new gresource.
CompileRes
# Move gresource to the default place.
MoveRes
# Check if everything was successful.
Check
# Remove temporary files and exit.
CleanUp
# Change background colors.
elif [[ "$1" =~ ^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$ ]]; then
# Store selected background color.
BgColor="$1"
CreateDirs
ExtractRes
# Change gdm background to the color you submited.
oldBg="#lockDialogGroup \{.*?\}"
newBg="#lockDialogGroup {
background: $BgColor;
background-size: cover; }"
perl -i -0777 -pe "s/$oldBg/$newBg/s" "$workDir"/theme/gdm3.css
# Generate the gresource xml file.
echo '<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/gnome/shell/theme">' > "$workDir"/theme/"$gdm3xml"
for file in `gresource list "$gdm3Resource~"`; do
echo " <file>${file#\/org\/gnome/shell\/theme\/}</file>" \
>> "$workDir"/theme/"$gdm3xml"
done
echo ' </gresource>
</gresources>' >> "$workDir"/theme/"$gdm3xml"
# Compile the new gresource.
CompileRes
# Move gresource to the default place.
MoveRes
# Remove temporary files and exit.
CleanUp
else
# If no file was submited or file submited isn't an image,
# show this message.
echo 'Image file not found or wrong color hex code.'
echo 'Please, submit a .jpg or .png image file or a valid hex code.'
echo 'Usage: sudo ./ubuntu-20.04-change-gdm-background /path/to/image.*g'
echo 'Usage: sudo ./ubuntu-20.04-change-gdm-background \#yourhexcode'
fi
# kawada_lab_application.ddeploy.yaml
project_name: kawada_lab_application
ros_distro: melodic
project_sources:
- /home/andres/workspace/kawada_ws/src
image_name: tecnalia/kawada_lab_application
addon_name: melodic-kawada_lab_application
oci_source: https://git.code.tecnalia.com/tecnalia_robotics/kawada/kawada_lab_application
oci_title: kawada_lab_application deployment image
base_image: osrf/ros:melodic-desktop-full
# robouton_core.ddeploy.yaml
project_name: robouton_core
ros_distro: melodic
project_sources:
- .
- ./rosinstall
addon_name: robouton_core
base_image: tecnalia-robotics-docker.artifact.tecnalia.com/flexbotics-base-devel:melodic
cmd: roslaunch flexbotics_robots_rbrobout_launch flexbotics_robots_rbrobout.launch manipulator_controller:=false
after_script: bash -c ". /opt/ros/robouton_core/setup.bash"
\ No newline at end of file
FROM nvidia/cuda:11.3.0-base-ubuntu16.04
WORKDIR /root/ws
ENV ROS_DISTRO melodic
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
# nvidia-container-runtime
ENV NVIDIA_VISIBLE_DEVICES \
${NVIDIA_VISIBLE_DEVICES:-all}
ENV NVIDIA_DRIVER_CAPABILITIES \
${NVIDIA_DRIVER_CAPABILITIES:+$NVIDIA_DRIVER_CAPABILITIES,}graphics
# install basic packages
RUN apt-get update && apt-get install -q -y --no-install-recommends \
dirmngr \
gnupg2 \
lsb-release \
sudo \
ocl-icd-libopencl1 \
clinfo \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir -p /etc/OpenCL/vendors && \
echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd
# Setup environment
RUN apt-get update && apt-get install -y \
locales \
&& sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
# Setup sources.list
RUN sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
RUN apt-get -y install --no-install-recommends \
curl
RUN curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
RUN apt-get update && apt-get install -y \
ros-kinetic-desktop-full
# Configure apt and install packages
RUN apt-get -y install --no-install-recommends \
apt-transport-https \
ca-certificates \
software-properties-common \
gnupg-agent \
apt-utils dialog 2>&1 \
git \
nano \
less \
iproute2 \
procps \
lsb-release \
curl \
cmake \
openssh-client \
python-catkin-tools \
python-osrf-pycommon \
python-rosdep \
python-rosinstall \
python-rosinstall-generator \
python-wstool \
build-essential \
ros-${ROS_DISTRO}-rosmon \
xterm \
wget \
clinfo \
&& rm -rf /var/lib/apt/lists/*
# Add private sources
ARG ARTIFACT_CI_USER
ARG ARTIFACT_CI_TOKEN
ARG ARTIFACT_DEBIAN_KEY_ID
RUN \
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys "${ARTIFACT_DEBIAN_KEY_ID}" && \
echo "deb https://${ARTIFACT_CI_USER}:${ARTIFACT_CI_TOKEN}@artifact.tecnalia.com/artifactory/tecnalia-robotics-debian $(lsb_release -sc) main" > /etc/apt/sources.list.d/tecnalia.list && \
# Add the private rosdep mapping yaml
rosdep init || true && \
echo "yaml https://git.code.tecnalia.com/tecnalia_robotics-public/gitlab_templates/raw/master/rosdistro/rosdep_tecnalia.yaml" >> /etc/ros/rosdep/sources.list.d/10-tecnalia.list
# Import the key in order to be able to use the packages from the repository
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 7E72C5B4111A50084C63C9489E7A9B1D990CF897
# Configure rosdep
RUN rosdep init || true
RUN sh -c "echo 'yaml https://git.code.tecnalia.com/tecnalia_robotics-public/gitlab_templates/raw/master/rosdistro/rosdep_tecnalia.yaml' \
>> /etc/ros/rosdep/sources.list.d/20-default.list"
RUN rosdep update --include-eol-distros --rosdistro ${ROS_DISTRO}
RUN mkdir -p /ws/src && \
cd /ws/src
COPY . /ws/src/iiwa_state_recorder/
CMD ["bash"]
# Switch back to dialog for any ad-hoc use of apt-get
ENV DEBIAN_FRONTEND=
\ No newline at end of file
# IIWA state recorder
* Download the [iiwa_state_recorder package](https://git.code.tecnalia.com/tecnalia_robotics/kuka_sunrise/iiwa_state_recorder.git):
```bash
mkdir -p ~/ros/melodic/iiwa_ws/src
cd ~/ros/melodic/iiwa_ws/src
git clone git@git.code.tecnalia.com:tecnalia_robotics/kuka_sunrise/iiwa_state_recorder.git
```
* Install the additional ros packages using .rosinstall:
```bash
cd ~/ros/melodic/iiwa_ws/src
wstool init
wstool merge iiwa_state_recorder/.rosinstall
wstool update
rosdep install -iy --from-paths .
catkin build
```
## Docker image
Command to build the docker image to work on a host with Ubuntu 20.04:
```bash
docker build -t iiwa_simulator --build-arg USER_API_KEY_ARTIFACTS_TECNALIA="$(cat ~/.ssh/user_api_key_artifacts_tecnalia)" -f ISR.Dockerfile .
```
<!-- Testing ddeploy
Using [ddeploy](https://git.code.tecnalia.com/tecnalia_robotics/flexbotics/flexbotics_utils/ddeploy)
ddeploy --name scan_and_plan_nvidia --distro kinetic -b tecnalia-robotics-docker.artifact.tecnalia.com/flexbotics-base-nvidia-devel:kinetic -s . --keep-source
Generates: clinfo error
ddeploy --name scan_and_plan_nvidia_cuda --distro kinetic -b nvidia/cuda:11.3.0-base-ubuntu16.04 -s . --keep-sources
Generate: Missing sources etc...
-->
Command to launch the docker image using [rocker](https://github.com/osrf/rocker)
```bash
rocker --privileged --devices /dev/bus/usb --nvidia --x11 --home --git --ssh <docker_image>
```
<!-- If --user flag is passed as argument when the container is launched with rocker then sudo privileged is required to access to the Zivid camera. -->
Commands to launch the demo:
```bash
source /opt/ros/melodic/setup.bash
source ~/ros/melodic/iiwa_ws/devel/setup.bash
roslaunch iiwa_state_recorder iiwa_simulator.launch
```
#!/bin/bash
set -e # To fail on errors
DIR_THIS="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
deploy_distro=${1:-melodic}
python_version=${2:-python}
docker_tag=${3:-untagged}
project_url=${4:-https://git.code.tecnalia.com}
image_version=${5:-local_build}
image_revision=${6:-local_build}
echo "$ARTIFACT_DEBIAN_KEY_ID" > /tmp/additional_apt_keys
echo "deb https://${ARTIFACT_CI_USER}:${ARTIFACT_CI_TOKEN}@artifact.tecnalia.com/artifactory/tecnalia-robotics-debian xenial main" > /tmp/additional_apt_sources
echo "yaml https://git.code.tecnalia.com/tecnalia_robotics-public/gitlab_templates/raw/master/rosdistro/rosdep_tecnalia.yaml" > /tmp/additional_rosdeps
echo "https://$ARTIFACT_CI_USER:$ARTIFACT_CI_TOKEN@artifact.tecnalia.com" > /tmp/git_credentials
echo "$SSH_PRIVATE_KEY" > /tmp/ssh_key
echo "$SSH_SERVER_HOSTKEYS" > /tmp/ssh_hostkeys
cd "${DIR_THIS}"/..
# shellcheck disable=SC2046
DOCKER_BUILDKIT=1 docker build \
--progress=plain \
--secret id=additional_apt_keys,src=/tmp/additional_apt_keys \
--secret id=additional_apt_sources,src=/tmp/additional_apt_sources \
--secret id=additional_rosdeps,src=/tmp/additional_rosdeps \
--build-arg BASE_IMAGE="nvidia/cuda:11.3.0-base-ubuntu16.04" \
--secret id=git_credentials,src=/tmp/git_credentials \
--build-arg PROJECT_NAME=iiwa_state_recorder \
--build-arg ROS_DISTRO="$deploy_distro" \
--secret id=ssh_key,src=/tmp/ssh_key \
--secret id=ssh_hostkeys,src=/tmp/ssh_hostkeys \
--build-arg PYTHON_VERSION="$python_version" \
--build-arg USERNAME=deployuser \
--build-arg UID=1000 \
--build-arg GID=1000 \
--build-arg ENTRY_COMMAND="roslaunch iiwa_state_recorder iiwa_simulator.launch" \
--label "org.opencontainers.image.created=$(date --rfc-3339=seconds)" \
--label "org.opencontainers.image.url=$project_url" \
--label "org.opencontainers.image.version=$image_version" \
--label "org.opencontainers.image.revision=$image_revision" \
--label "org.opencontainers.image.vendor=TECNALIA" \
--label "org.opencontainers.image.licenses=TECNALIA" \
$(printf "%s" "$deploy_distro") \
-t "iiwa_state_recorder:$docker_tag" .
ret=$?
rm /tmp/additional_apt_keys
rm /tmp/additional_apt_sources
rm /tmp/additional_rosdeps
rm /tmp/git_credentials
rm /tmp/ssh_key
rm /tmp/ssh_hostkeys
cd -
exit $ret
project_name: iiwa_state_recorder
ros_distro: melodic
project_sources:
- ./iiwa_state_recorder.rosinstall
vcs_workers: 1
cmd: roslaunch iiwa_state_recorder iiwa_simulator_deploy.launch
after_script: apt-get update && apt-get install -y curl
&& curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
&& apt-get install -y nodejs && npm -g install yarn
&& bash -c "source /ros_entrypoint.sh && find /opt/ros/ -name 'build_ui.bash' -exec bash {} \;"
- git:
local-name: algebra_libraries
uri: 'git@git.code.tecnalia.com:tecnalia_robotics/algebra_libraries.git'
version: melodic-devel
- git:
local-name: cartesian_trajectory_analyser
uri: 'git@git.code.tecnalia.com:tecnalia_robotics/kuka_sunrise/cartesian_trajectory_analyser.git'
version: melodic-devel
- git:
local-name: flexbotics_robots_iiwa
uri: 'git@git.code.tecnalia.com:tecnalia_robotics/flexbotics/flexbotics_robots/flexbotics_robots_iiwa.git'
version: master
- git:
local-name: gl_depth_sim
uri: https://github.com/Jmeyer1292/gl_depth_sim.git
version: master
- git:
local-name: iiwa_native_controller
uri: 'git@git.code.tecnalia.com:tecnalia_robotics/kuka_sunrise/iiwa_native_controller.git'
version: melodic-devel
- git:
local-name: iiwa_skill_manager
uri: 'git@git.code.tecnalia.com:tecnalia_robotics/kuka_sunrise/iiwa_skill_manager.git'
version: melodic-devel
- git:
local-name: iiwa_stack
uri: 'https://github.com/tecnalia-advancedmanufacturing-robotics/iiwa_stack.git'
version: master
- git:
local-name: iiwa_state_recorder
uri: 'git@git.code.tecnalia.com:tecnalia_robotics/kuka_sunrise/iiwa_state_recorder.git'
version: melodic-devel
- git:
local-name: manipulation
uri: 'git@git.code.tecnalia.com:tecnalia_robotics/manipulation.git'
version: kinetic-devel
- git:
local-name: manipulator_commander_compliant
uri: 'git@git.code.tecnalia.com:tecnalia_robotics/manipulator_commander_compliant.git'
version: melodic-devel
- git:
local-name: manipulator_commander_iiwa
uri: 'git@git.code.tecnalia.com:tecnalia_robotics/manipulator_commander_iiwa.git'
version: melodic-devel
- git:
local-name: vision_libraries
uri: git@git.code.tecnalia.com:tecnalia_robotics/flexbotics/vision/vision_libraries.git
version: melodic-devel
- git:
local-name: vision_libraries_additionals_tools
uri: git@git.code.tecnalia.com:tecnalia_robotics/flexbotics/vision/vision_libraries_additionals_tools.git
version: melodic-devel
- git:
local-name: vision_libraries_external_api
uri: git@git.code.tecnalia.com:tecnalia_robotics/flexbotics/vision/vision_libraries_external_api.git
version: melodic-devel
- git:
local-name: vision_object_detection_plugins
uri: git@git.code.tecnalia.com:tecnalia_robotics/flexbotics/vision/vision_object_detection_plugins.git
version: melodic-devel
# Packages for intergration with robouton demo
- git:
local-name: sherlock_ui
uri: git@git.code.tecnalia.com:tecnalia_robotics/sherlock/sherlock_ui.git
version: 8-add-dashboard-option
- git:
local-name: dummy_application
uri: git@git.code.tecnalia.com:tecnalia_robotics/flexbotics/flexbotics_test/dummy_application.git
version: main
- git:
local-name: move_base_navigation_skill
uri: git@git.code.tecnalia.com:tecnalia_robotics/flexbotics/flexbotics_skill_library/robot_mobility/move_base_navigation_skill.git
version: master
# Packages from dummy_application
- git:
local-name: flexbotics_action_base_classes
uri: git@git.code.tecnalia.com:tecnalia_robotics/flexbotics/flexbotics_skill_library/flexbotics_action_base_classes.git
version: kinetic-devel
- git:
local-name: flexbotics_configuration_manager
uri: git@git.code.tecnalia.com:tecnalia_robotics/flexbotics/flexbotics_configuration_manager.git
version: kinetic-devel
- git:
local-name: flexbotics_execution_manager
uri: git@git.code.tecnalia.com:tecnalia_robotics/flexbotics_execution_manager.git
version: noetic-devel
- git:
local-name: generic_simple_gui
uri: git@git.code.tecnalia.com:tecnalia_robotics/flexbotics/generic_simple_gui.git
version: noetic-devel
- git:
local-name: smach_tutorials
uri: https://github.com/rhaschke/executive_smach_tutorials
version: indigo-devel
#!/bin/bash
set -e
# setup ros environment
# shellcheck source=/dev/null
. "/opt/ros/${ROS_DISTRO}-extra/setup.bash"
exec "$@"
#-------------------------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
#-------------------------------------------------------------------------------------------------------------
FROM tecnalia-robotics-docker.artifact.tecnalia.com/flexbotics-fat-devel:melodic
# Avoid warnings by switching to noninteractive
ENV DEBIAN_FRONTEND=noninteractive
# This Dockerfile adds a non-root 'vscode' user with sudo access. However, for Linux,
# this user's GID/UID must match your local user UID/GID to avoid permission issues
# with bind mounts. Update USER_UID / USER_GID if yours is not 1000. See
# https://aka.ms/vscode-remote/containers/non-root-user for details.
ARG USERNAME=vscode
ARG USER_UID=1000
ARG USER_GID=$USER_UID
# Configure apt and install packages
RUN apt-get update \
&& apt-get -y install --no-install-recommends apt-utils dialog 2>&1 \
#
# Verify git, process tools, lsb-release (common in install instructions for CLIs) installed
&& apt-get -y install git iproute2 procps lsb-release curl \
&& apt install -y git openssh-client python-catkin-tools \
#
# Create a non-root user to use if preferred - see https://aka.ms/vscode-remote/containers/non-root-user.
&& groupadd --gid $USER_GID $USERNAME \
&& useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME \
# [Optional] Add sudo support for the non-root user
&& apt-get install -y sudo \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME\
&& chmod 0440 /etc/sudoers.d/$USERNAME \
#
&& rosdep init || true
USER $USERNAME
RUN rosdep update \
&& mkdir -p /home/${USERNAME}/robot_ws/src/
COPY .devcontainer/catkin_ws_init.sh /tmp/
# Clean up
# && apt-get autoremove -y \
# && apt-get clean -y \
# && rm -rf /var/lib/apt/lists/*
# Switch back to dialog for any ad-hoc use of apt-get
ENV DEBIAN_FRONTEND=
#!/bin/bash
if [[ -z "${ROS_PACKAGE_PATH}" ]]; then
. $(find /opt/ros/ -name "setup.bash")
fi
if [[ -z "${ROS_DISTRO}" ]]; then
export ROS_DISTRO=$(basename $(find /opt/ros/* -maxdepth 0 -type d | head -1))
fi
pkg_name=$(basename $(find /workspaces/ -maxdepth 1 -mindepth 1 -type d))
mkdir -p ~/robot_ws/src
cd ~/robot_ws/src
ln -s /workspaces/${pkg_name}
cd ..
wstool init src
if [ -f "src/${pkg_name}/.rosinstall" ]; then
wstool merge "src/${pkg_name}/.rosinstall" -t src
fi
mkdir -p ~/.ssh/
cat << EOF >> ~/.ssh/config
Host *
StrictHostKeyChecking no
EOF
wstool update -t src
find -L src -name ci_entry_script.bash -exec bash -c 'echo Running entry script from $(basename $(dirname $1)) ; $1 ' _ {} \;
rosdep update
rosdep install --from-paths src --ignore-src --rosdistro $ROS_DISTRO -r -y
catkin init
catkin config --cmake-args -DCMAKE_CXX_FLAGS=-w --
echo "source $(find /opt/ros/ -name 'setup.bash')" >> ~/.bashrc
// For format details, see https://aka.ms/vscode-remote/devcontainer.json
{
"name": "flexbotics base melodic",
"context": "..",
"dockerFile": "Dockerfile",
// Use 'settings' to set *default* container specific settings.json values on container create.
// You can edit these settings after create using File > Preferences > Settings > Remote.
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
},
// Uncomment the next line if you want to publish any ports.
// "appPort": [],
// Uncomment the next line to run commands after the container is created.
"postCreateCommand": "bash /tmp/catkin_ws_init.sh",
"workspaceFolder": "/home/vscode/robot_ws/src/",
// Uncomment the next line to use a non-root user. On Linux, this will prevent
// new files getting created as root, but you may need to update the USER_UID
// and USER_GID in .devcontainer/Dockerfile to match your user if not 1000.
"runArgs": [ "-u", "vscode",
"-v", "${env:SSH_AUTH_SOCK}:/ssh-agent",
"-e", "SSH_AUTH_SOCK=/ssh-agent",
"-e", "DISPLAY=${env:DISPLAY}",
"-v", "/tmp/.X11-unix:/tmp/.X11-unix"
],
// Add the IDs of extensions you want installed when the container is created in the array below.
"extensions": [
"ms-python.python",
"ms-iot.vscode-ros"
]
}
ARG FROM_IMAGE_BUILDER=tecnalia-robotics-docker.artifact.tecnalia.com/flexbotics-base-devel:melodic
ARG FROM_IMAGE_CATCHER=osrf/ros:melodic-desktop-full
ARG OVERLAY_WS=/opt/ros/remodel_app_ws
FROM $FROM_IMAGE_CATCHER AS cacher
#################################
# Add ssh private key
# Setup environment
RUN apt-get update && apt-get install -y \
ssh \
locales \
&& sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
ARG SSH_PRIVATE_KEY
RUN mkdir ~/.ssh/
RUN echo "${SSH_PRIVATE_KEY}" > /root/.ssh/id_rsa
RUN chmod 600 ~/.ssh/id_rsa
RUN ssh-keyscan git.code.tecnalia.com >> /root/.ssh/known_hosts && chmod 644 /root/.ssh/known_hosts
# Configure system to look for debian packages in the Artifactory repository
ARG USER_API_KEY_ARTIFACTS_TECNALIA
RUN sh -c "echo \
'deb https://${USER_API_KEY_ARTIFACTS_TECNALIA}@artifact.tecnalia.com/artifactory/tecnalia-robotics-debian xenial main' \
>> /etc/apt/sources.list.d/tecnalia.list"
# Import the key in order to be able to use the packages from the repository
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 7E72C5B4111A50084C63C9489E7A9B1D990CF897
# Configure rosdep
RUN sh -c "echo 'yaml https://git.code.tecnalia.com/tecnalia_robotics-public/gitlab_templates/raw/master/rosdistro/rosdep_tecnalia.yaml' \
>> /etc/ros/rosdep/sources.list.d/20-default.list"
# clone overlay source
ARG OVERLAY_WS
WORKDIR $OVERLAY_WS/src
RUN git clone git@git.code.tecnalia.com:tecnalia_robotics/remodel/remodel_app.git
RUN cd remodel_app && git checkout real-testing
RUN cp remodel_app/.rosinstall .
RUN wstool update
# copy manifests for caching
WORKDIR /opt
RUN mkdir -p /tmp/opt && \
find ./ -name "package.xml" | \
xargs cp --parents -t /tmp/opt && \
find ./ -name "CATKIN_IGNORE" | \
xargs cp --parents -t /tmp/opt || true
# multi-stage for building
FROM $FROM_IMAGE_BUILDER AS builder
ENV ROS_DISTRO melodic
ENV RUNNING_IN_DOCKER true
# Avoid warnings by switching to noninteractive
ENV DEBIAN_FRONTEND=noninteractive
# install overlay dependencies
# finish rosdep command with true because some dependencies are not found
ARG OVERLAY_WS
WORKDIR $OVERLAY_WS
COPY --from=cacher /tmp/$OVERLAY_WS/src ./src
RUN rosdep update
RUN . /opt/ros/$ROS_DISTRO/setup.sh && \
apt-get update && rosdep install -y \
--from-paths \
src \
--ignore-src \
|| true \
&& rm -rf /var/lib/apt/lists/*
# build overlay source
COPY --from=cacher $OVERLAY_WS/src ./src
RUN . /opt/ros/$ROS_DISTRO/setup.sh \
&& catkin config \
--extend /opt/ros/"$ROS_DISTRO" \
--install \
--cmake-args -DCMAKE_BUILD_TYPE=Release \
&& catkin build \
--summarize
# install python3 dependencies
RUN apt-get update && apt-get install -y \
python3-pip
RUN pip3 install sqlite_utils
# Set entrypoint
COPY ./ros_entrypoint.sh /
RUN chmod a+x /ros_entrypoint.sh
ENTRYPOINT ["/ros_entrypoint.sh"]
CMD ["zsh"]
ENV SHELL /usr/bin/zsh
# Switch back to dialog for any ad-hoc use of apt-get
ENV DEBIAN_FRONTEND=
FROM osrf/ros:noetic-desktop-full
ENV ROS_DISTRO noetic
# Avoid warnings by switching to noninteractive
ENV DEBIAN_FRONTEND=noninteractive
# Setup environment
RUN apt-get update && apt-get install -y \
locales \
&& sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
# Configure apt and install packages
RUN apt-get -y install --no-install-recommends \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common \
apt-utils dialog 2>&1 \
#
# Verify if git, process tools, lsb-release (common in install instructions for CLIs) are installed
# Install the https transport support package for The Artifactory debian repository
git \
git-lfs \
nano \
iproute2 \
procps \
lsb-release \
curl \
cmake \
openssh-client \
ros-noetic-catkin \
python3-catkin-tools \
python3-osrf-pycommon \
xterm \
terminator \
zsh \
# && rosdep init || true \
&& rm -rf /var/lib/apt/lists/*
# Install docker-ce
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
RUN add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
RUN apt-get update && apt-get -y install --no-install-recommends \
docker-ce-cli \
&& rm -rf /var/lib/apt/lists/*
# Configure system to look for debian packages in the Artifactory repository
ARG USER_API_KEY_ARTIFACTS_TECNALIA
RUN sh -c "echo \
'deb https://${USER_API_KEY_ARTIFACTS_TECNALIA}@artifact.tecnalia.com/artifactory/tecnalia-robotics-debian xenial main' \
>> /etc/apt/sources.list.d/tecnalia.list"
# Import the key in order to be able to use the packages from the repository
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 7E72C5B4111A50084C63C9489E7A9B1D990CF897
RUN curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | apt-key add -
# Configure rosdep
RUN sh -c "echo 'yaml https://git.code.tecnalia.com/tecnalia_robotics-public/gitlab_templates/raw/master/rosdistro/rosdep_tecnalia.yaml' \
>> /etc/ros/rosdep/sources.list.d/20-default.list"
RUN apt-get update && apt-get install -y \
wget \
udev
RUN wget https://www.zivid.com/hubfs/softwarefiles/releases/1.8.3+96f35dc6-1/u18/zivid-telicam-driver_3.0.1.1-1_amd64.deb \
https://www.zivid.com/hubfs/softwarefiles/releases/1.8.3+96f35dc6-1/u18/zivid_1.8.3+96f35dc6-1_amd64.deb \
https://www.zivid.com/hubfs/softwarefiles/releases/1.8.3+96f35dc6-1/u18/zivid-studio_1.8.3+96f35dc6-1_amd64.deb \
https://www.zivid.com/hubfs/softwarefiles/releases/1.8.3+96f35dc6-1/u18/zivid-tools_1.8.3+96f35dc6-1_amd64.deb
RUN dpkg -i zivid*.deb
# Update final image
RUN apt-get update \
&& apt-get -y upgrade \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y \
direnv
# Scan and Plan dependencies
RUN apt-get update && apt-get install -y \
ros-noetic-industrial-robot-simulator \
ros-noetic-moveit-fake-controller-manager \
ros-noetic-moveit-planners-ompl \
ros-noetic-moveit-ros-move-group \
ros-noetic-moveit-ros-visualization \
ros-noetic-moveit-ros-warehouse \
ros-noetic-moveit-simple-controller-manager \
ros-noetic-warehouse-ros \
ros-noetic-industrial-robot-client \
python-numpy \
ros-noetic-simple-message \
liblapack-dev \
ros-noetic-moveit-core \
ros-noetic-trac-ik-kinematics-plugin \
ros-noetic-urdfdom-py \
ros-noetic-srdfdom \
ros-noetic-pcl-ros \
ros-noetic-moveit-kinematics \
ros-noetic-pcl-msgs \
ros-noetic-moveit-ros-planning-interface \
ros-noetic-swri-profiler \
libqd-dev \
libpcl-dev \
libpcl-apps1.10 \
libpcl-common1.10 \
libpcl-features1.10 \
libpcl-filters1.10 \
libpcl-io1.10 \
libpcl-kdtree1.10 \
libpcl-keypoints1.10 \
libpcl-ml1.10 \
libpcl-octree1.10 \
libpcl-outofcore1.10 \
libpcl-people1.10 \
libpcl-recognition1.10 \
libpcl-registration1.10 \
libpcl-sample-consensus1.10 \
libpcl-search1.10 \
libpcl-segmentation1.10 \
libpcl-stereo1.10 \
libpcl-surface1.10 \
libpcl-tracking1.10 \
libpcl-visualization1.10 \
ros-noetic-catkin-virtualenv \
python3-zmq \
ros-noetic-moveit-ros-planning \
ros-noetic-moveit-setup-assistant \
ros-noetic-ompl \
ros-noetic-moveit-ros-manipulation
RUN sh -c "echo \
'deb http://debrob.upc.edu/debian bullseye main contrib non-free' \
>> /etc/apt/sources.list.d/debian.list"
RUN wget -v0 - http://debrob.upc.edu/debian/dists/Debian11.2/Release.gpg \
&& apt-key add - < Release.gpg
RUN apt-get update && apt-get install -y \
libusb-1.0-0-dev \
default-jdk \
libdouble-conversion-dev \
libutfcpp-dev \
build-essential
# Set entrypoint
COPY ./ros_entrypoint.sh /
RUN chmod a+x /ros_entrypoint.sh
ENTRYPOINT ["/ros_entrypoint.sh"]
CMD ["zsh"]
# Switch back to dialog for any ad-hoc use of apt-get
ENV DEBIAN_FRONTEND=
# libvtk9-dev
# libvtk9-qt-dev
# libusb-1.0-0-dev
# http://debrob.upc.edu/debian/pool/main/p/pcl/libpcl-apps1.12_1.12.1+dfsg-3+b2_amd64.deb
# http://debrob.upc.edu/debian/pool/main/p/pcl/libpcl-common1.12_1.12.1+dfsg-3+b2_amd64.deb
# http://debrob.upc.edu/debian/pool/main/p/pcl/libpcl-features1.12_1.12.1+dfsg-3+b2_amd64.deb
# http://debrob.upc.edu/debian/pool/main/p/pcl/libpcl-filters1.12_1.12.1+dfsg-3+b2_amd64.deb
# http://debrob.upc.edu/debian/pool/main/p/pcl/libpcl-io1.12_1.12.1+dfsg-3+b2_amd64.deb
# http://debrob.upc.edu/debian/pool/main/p/pcl/libpcl-kdtree1.12_1.12.1+dfsg-3+b2_amd64.deb
# http://debrob.upc.edu/debian/pool/main/p/pcl/libpcl-keypoints1.12_1.12.1+dfsg-3+b2_amd64.deb
# http://debrob.upc.edu/debian/pool/main/p/pcl/libpcl-ml1.12_1.12.1+dfsg-3+b2_amd64.deb
# http://debrob.upc.edu/debian/pool/main/p/pcl/libpcl-octree1.12_1.12.1+dfsg-3+b2_amd64.deb
# http://debrob.upc.edu/debian/pool/main/p/pcl/libpcl-outofcore1.12_1.12.1+dfsg-3+b2_amd64.deb
# http://debrob.upc.edu/debian/pool/main/p/pcl/libpcl-people1.12_1.12.1+dfsg-3+b2_amd64.deb
# http://debrob.upc.edu/debian/pool/main/p/pcl/libpcl-recognition1.12_1.12.1+dfsg-3+b2_amd64.deb
# http://debrob.upc.edu/debian/pool/main/p/pcl/libpcl-registration1.12_1.12.1+dfsg-3+b2_amd64.deb
# http://debrob.upc.edu/debian/pool/main/p/pcl/libpcl-sample-consensus1.12_1.12.1+dfsg-3+b2_amd64.deb
# http://debrob.upc.edu/debian/pool/main/p/pcl/libpcl-search1.12_1.12.1+dfsg-3+b2_amd64.deb
# http://debrob.upc.edu/debian/pool/main/p/pcl/libpcl-segmentation1.12_1.12.1+dfsg-3+b2_amd64.deb
# http://debrob.upc.edu/debian/pool/main/p/pcl/libpcl-stereo1.12_1.12.1+dfsg-3+b2_amd64.deb
# http://debrob.upc.edu/debian/pool/main/p/pcl/libpcl-surface1.12_1.12.1+dfsg-3+b2_amd64.deb
# http://debrob.upc.edu/debian/pool/main/p/pcl/libpcl-tracking1.12_1.12.1+dfsg-3+b2_amd64.deb
# http://debrob.upc.edu/debian/pool/main/p/pcl/libpcl-visualization1.12_1.12.1+dfsg-3+b2_amd64.deb
# http://debrob.upc.edu/debian/pool/main/p/pcl/pcl-tools_1.12.1+dfsg-3+b2_amd64.deb
# http://debrob.upc.edu/debian/pool/main/v/vtk9/libvtk9-dev_9.1.0%2Breally9.1.0%2Bdfsg2-3%2Bb1_amd64.deb
# http://debrob.upc.edu/debian/pool/main/v/vtk9/libvtk9-qt-dev_9.1.0%2Breally9.1.0%2Bdfsg2-3%2Bb1_amd64.deb
# http://debrob.upc.edu/debian/pool/main/p/pcl/libpcl-apps1.12_1.12.1%2Bdfsg-3%2Bb2_amd64.deb
#libglew2.2 \
#libhdf5-103-1 \
#libjpeg62-turbo \
#libjsoncpp25 \
#libnetcdf19 \
# libopenmpi3 \
# #libproj22 \
# libstdc++6
# RUN wget http://debrob.upc.edu/debian/pool/main/p/proj/libproj22_8.2.1-1_amd64.deb \
# http://debrob.upc.edu/debian/pool/main/p/proj/proj-data_8.2.1-1_all.deb \
# http://debrob.upc.edu/debian/pool/main/g/glibc/libc6-amd64_2.33-6_i386.deb
# RUN dpkg -i libc6-amd64_2.33-6_i386.deb \
# libproj22_8.2.1-1_amd64.deb \
# proj-data_8.2.1-1_all.deb
# RUN wget http://debrob.upc.edu/debian/pool/main/v/vtk9/libvtk9.1_9.1.0%2Breally9.1.0%2Bdfsg2-3%2Bb1_amd64.deb \
# http://debrob.upc.edu/debian/pool/main/v/vtk9/vtk9_9.1.0%2Breally9.1.0%2Bdfsg2-3%2Bb1_amd64.deb \
# http://debrob.upc.edu/debian/pool/main/v/vtk9/python3-vtk9_9.1.0%2Breally9.1.0%2Bdfsg2-3%2Bb1_amd64.deb \
# http://debrob.upc.edu/debian/pool/main/v/vtk9/libvtk9-dev_9.1.0%2Breally9.1.0%2Bdfsg2-3%2Bb1_amd64.deb
# # http://debrob.upc.edu/debian/pool/main/p/pcl/libpcl-dev_1.12.1+dfsg-3+b2_amd64.deb \
# # http://debrob.upc.edu/debian/pool/main/v/vtk9/libvtk9-qt-dev_9.1.0%2Breally9.1.0%2Bdfsg2-3%2Bb1_amd64.deb \
# # http://debrob.upc.edu/debian/pool/main/v/vtk9/vtk9_9.1.0%2Breally9.1.0%2Bdfsg2-3%2Bb1_amd64.deb \
# # http://debrob.upc.edu/debian/pool/main/v/vtk9/libvtk9-java_9.1.0%2Breally9.1.0%2Bdfsg2-3%2Bb1_amd64.deb \
# # http://debrob.upc.edu/debian/pool/main/v/vtk9/libvtk9.1-qt_9.1.0%2Breally9.1.0%2Bdfsg2-3%2Bb1_amd64.deb \
# RUN dpkg -i libvtk9.1_9.1.0+really9.1.0+dfsg2-3+b1_amd64.deb
# RUN dpkg -i vtk9_9.1.0+really9.1.0+dfsg2-3+b1_amd64.deb
# RUN dpkg -i python3-vtk9_9.1.0+really9.1.0+dfsg2-3+b1_amd64.deb
# RUN dpkg -i libvtk9-dev_9.1.0+really9.1.0+dfsg2-3+b1_amd64.deb
\ No newline at end of file
FROM ubuntu:18.04
SHELL ["/bin/bash", "-c"]
# Update system
RUN apt-get update && apt-get install -y apt-transport-https
RUN apt-get install -y apt-utils
RUN apt-get -y upgrade
RUN apt-get update
RUN apt-get -y --purge autoremove
# Installing necessary packages
# RUN apt-get install -y gnupg2
RUN apt-get install -y curl
RUN apt-get install -y lsb-release
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get install -y nano
RUN apt-get install -y wget
RUN apt-get install -y python-pip
# RUN apt-get install -y libpng16-16
# RUN apt-get install -y libjpeg-turbo8
# RUN apt-get install -y libtiff5
RUN apt-get install -y byobu
# Installing ROS-melodic
RUN sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
RUN curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | apt-key add -
RUN apt-get update
RUN apt-get install -y ros-melodic-desktop-full
# ----- Parche para subsanar los errores que devuelve el codigo de Robotnik con estos paquetes
RUN apt-get install -y ros-melodic-navigation
RUN apt-get install -y ros-melodic-ar-track-alvar
# -----
RUN apt-get install -y python-rosdep
RUN rosdep init
RUN rosdep update
RUN echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
RUN apt-get install -y python-rosinstall python-rosinstall-generator python-wstool build-essential
# Installing pyton-catkin
RUN sh -c 'echo "deb http://packages.ros.org/ros/ubuntu `lsb_release -sc` main" > /etc/apt/sources.list.d/ros-latest.list'
RUN wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
RUN apt-get update
RUN apt-get install -y python-catkin-tools
RUN apt-get install -y software-properties-common
RUN echo "source /opt/ros/melodic/setup.bash" >> ~/.bash_profile
# Create a ROS Workspace
RUN source /opt/ros/melodic/setup.bash
RUN mkdir -p /root/ros/catkin_ws/src
ENV DIRPATH=/root/ros/catkin_ws
WORKDIR $DIRPATH
RUN catkin init
RUN catkin config --extend /opt/ros/melodic
RUN catkin build
# Install software
RUN apt-get install -y git
# Make ssh dir
RUN mkdir /root/.ssh/
# Copy over private key, and set permissions
# Warning! Anyone who gets their hands on this image will be able
# to retrieve this private key file from the corresponding image layer
ADD id_rsa_TecnaliaUB20 /root/.ssh/id_rsa
# Create known_hosts
RUN touch /root/.ssh/known_hosts
# Add github key
RUN ssh-keyscan github.com >> /root/.ssh/known_hosts
# Clone the conf files into the docker container
# PROVISIONAL HASTA QUE ROBOTNIK ACEPTE EL CAMBIO DEL FICHERO .gitmodules
# ------------------------ BORRAR -------------------------------------
WORKDIR $DIRPATH/src
RUN git clone git@github.com:Robotnik-Tecnalia/rbrobout.git
WORKDIR $DIRPATH/src/rbrobout
# Parches para cambiar el fichero .gitmodules y poder trabajar con la clave ssh
RUN sed -i 's#https://github.com/#git@github.com:#g' .gitmodules
RUN sed -i 's#https://www.github.com/#git@github.com:#g' .gitmodules
RUN sed -i 's#http://github.com/#git@github.com:#g' .gitmodules
RUN sed -i 's#http://www.github.com/#git@github.com:#g' .gitmodules
# Parche para intentar que descargue gazebo_ros_pkgs en su version de melodic con libgazebo9
RUN sed -i 's#gazebo_ros_pkgs.git#gazebo_ros_pkgs.git\n\tbranch = melodic-devel#g' .gitmodules
RUN git submodule init
RUN git submodule update
# ----------------------------------------------------------------------
# Cloning Robouton repository
# WORKDIR src/
# RUN git clone --recurse-submodules git@github.com:Robotnik-Tecnalia/rbrobout.git
WORKDIR $DIRPATH
WORKDIR $DIRPATH/src/rbrobout/libraries
RUN chmod +x install.sh
RUN ./install.sh
WORKDIR $DIRPATH
# RUN apt update
# RUN rosdep install --from-paths src --ignore-src -r -y --rosdistro melodic
RUN apt-get install -y ros-melodic-libpcan
RUN apt-get install -y ros-melodic-ueye-cam
# RUN git clone git@github.com:RobotnikAutomation/summit_xl_sim.git
# RUN git clone git@github.com:RobotnikAutomation/summit_xl_common.git
# RUN git clone git@github.com:RobotnikAutomation/robotnik_msgs.git
# RUN git clone git@github.com:RobotnikAutomation/robotnik_sensors.git
# WORKDIR $DIRPATH
RUN rosdep install --from-paths src --ignore-src -r -y --rosdistro melodic || true
# # WORKDIR src/
# RUN catkin build
# Install PeakCan linux driver from sources
WORKDIR $DIRPATH/src/rbrobout/libraries/external
RUN tar xzvf peak-linux-driver-8.10.0.tar.gz
WORKDIR $DIRPATH/src/rbrobout/libraries/external/peak-linux-driver-8.10.0
RUN apt-get install -y linux-headers-5.4.0-77-generic
RUN apt-get install -y libpopt-dev
# Compile and install Pcan
RUN make KERNEL_LOCATION=/usr/src/linux-headers-5.4.0-77-generic clean \
&& make KERNEL_LOCATION=/usr/src/linux-headers-5.4.0-77-generic \
&& make KERNEL_LOCATION=/usr/src/linux-headers-5.4.0-77-generic install || true \
&& sed -i '41d' Makefile \
&& make KERNEL_LOCATION=/usr/src/linux-headers-5.4.0-77-generic install
# RUN make
# RUN make install
# Delete line 41 to not install the Pcan driver driver
# Only the hearders are needed
# RUN sed -i '41d' Makefile
# RUN make install
RUN echo "source /root/ros/catkin_ws/devel/setup.bash" >> ~/.bashrc
WORKDIR $DIRPATH
RUN source devel/setup.bash
# ENTRYPOINT ["source", "devel/setup.bash"]
RUN catkin build
CMD ["tail", "-f", "/dev/null"]
### FIRST LAYER TO DOWNLOAD GIT REPOS
FROM osrf/ros:kinetic-desktop as intermediate
RUN apt-get update
#################################
# Add ssh private key
RUN apt-get install -y ssh
ARG SSH_PRIVATE_KEY
RUN mkdir ~/.ssh/
RUN echo "${SSH_PRIVATE_KEY}" > /root/.ssh/id_rsa
RUN chmod 600 ~/.ssh/id_rsa
RUN ssh-keyscan git.code.tecnalia.com >> /root/.ssh/known_hosts && chmod 644 /root/.ssh/known_hosts
#Print SSH_PRIVATE_KEY (for test)
RUN echo "${SSH_PRIVATE_KEY}"
RUN apt-get install -y git
# Create workspace
RUN mkdir -p /root/dev_ws/src
WORKDIR /root/dev_ws/src
# Install python-wstools
RUN apt-get install -y wget
RUN wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
RUN apt-get update
RUN apt-get install -y python-catkin-tools
# Clone main package
WORKDIR /root/dev_ws/src
RUN git clone -b Jon-O-laser-integration git@git.code.tecnalia.com:tecnalia_robotics/rosin/godel_fanuc_config.git
# Populate dependencies with rosinstall
RUN mkdir /root/dev_ws/src/dependencies
WORKDIR /root/dev_ws/src/dependencies
RUN wstool init && wstool merge ../godel_fanuc_config/.rosinstall && wstool update
# Preparing docker
FROM nvidia/cuda:11.3.0-base-ubuntu16.04
WORKDIR /root/ws
ENV ROS_DISTRO kinetic
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
# nvidia-container-runtime
ENV NVIDIA_VISIBLE_DEVICES \
${NVIDIA_VISIBLE_DEVICES:-all}
ENV NVIDIA_DRIVER_CAPABILITIES \
${NVIDIA_DRIVER_CAPABILITIES:+$NVIDIA_DRIVER_CAPABILITIES,}graphics
# install basic packages
RUN apt-get update && apt-get install -q -y --no-install-recommends \
dirmngr \
gnupg2 \
lsb-release \
sudo \
ocl-icd-libopencl1 \
clinfo \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir -p /etc/OpenCL/vendors && \
echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd
# Setup environment
RUN apt-get update && apt-get install -y \
locales \
&& sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
# Setup sources.list
RUN sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
RUN apt-get -y install --no-install-recommends \
curl
RUN curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
RUN apt-get update && apt-get install -y \
ros-kinetic-desktop-full
# Configure apt and install packages
RUN apt-get -y install --no-install-recommends \
apt-transport-https \
ca-certificates \
software-properties-common \
gnupg-agent \
apt-utils dialog 2>&1 \
git \
#git-lfs \
nano \
less \
iproute2 \
procps \
lsb-release \
curl \
cmake \
openssh-client \
python-catkin-tools \
python-osrf-pycommon \
python-rosdep \
python-rosinstall \
python-rosinstall-generator \
python-wstool \
build-essential \
ros-${ROS_DISTRO}-rosmon \
xterm \
wget \
clinfo \
&& rm -rf /var/lib/apt/lists/*
# Install docker-ce
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
RUN add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
RUN apt-get update && apt-get -y install --no-install-recommends \
docker-ce-cli \
&& rm -rf /var/lib/apt/lists/*
# Configure system to look for debian packages in the Artifactory repository
ARG USER_API_KEY_ARTIFACTS_TECNALIA
RUN sh -c "echo \
'deb https://${USER_API_KEY_ARTIFACTS_TECNALIA}@artifact.tecnalia.com/artifactory/tecnalia-robotics-debian xenial main' \
>> /etc/apt/sources.list.d/tecnalia.list"
# Import the key in order to be able to use the packages from the repository
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 7E72C5B4111A50084C63C9489E7A9B1D990CF897
# Configure rosdep
RUN rosdep init
RUN sh -c "echo 'yaml https://git.code.tecnalia.com/tecnalia_robotics-public/gitlab_templates/raw/master/rosdistro/rosdep_tecnalia.yaml' \
>> /etc/ros/rosdep/sources.list.d/20-default.list"
RUN rosdep update
# Packages installed as dependecies of kawada_lab_aplication
RUN apt-get update && apt-get install -y \
cmake \
ros-kinetic-moveit-planners-ompl \
ros-kinetic-moveit-ros-planning \
ros-kinetic-ompl \
ros-kinetic-moveit-kinematics \
ros-kinetic-moveit-ros-planning-interface \
ros-kinetic-moveit-ros-visualization \
ros-kinetic-catkin-virtualenv \
ros-kinetic-abb-driver \
ros-kinetic-industrial-robot-simulator \
ros-kinetic-moveit-ros-move-group \
ros-kinetic-moveit-core \
ros-kinetic-srdfdom \
ros-kinetic-urdfdom-py \
ros-kinetic-moveit-ros-manipulation \
ros-kinetic-moveit-simple-controller-manager \
ros-kinetic-moveit-fake-controller-manager \
ros-kinetic-moveit-setup-assistant \
ros-kinetic-trac-ik-kinematics-plugin \
ros-kinetic-swri-profiler \
ros-kinetic-fanuc-cr7ia-support \
ros-kinetic-fanuc-driver \
ros-kinetic-fanuc-resources \
ros-kinetic-zivid-camera \
libqd-dev \
python-zmq \
python3-catkin-pkg-modules \
&& rm -rf /var/lib/apt/lists/*
# Update final image
RUN apt-get update && apt-get -y upgrade
RUN apt-get update -y && apt-get install -y \
udev
# RUN wget https://www.zivid.com/hubfs/softwarefiles/releases/1.8.3+96f35dc6-1/u16/zivid-telicam-driver_3.0.1.1-1_amd64.deb
# RUN wget https://www.zivid.com/hubfs/softwarefiles/releases/1.8.3+96f35dc6-1/u16/zivid_1.8.3+96f35dc6-1_amd64.deb
# #RUN wget https://www.zivid.com/hubfs/softwarefiles/releases/1.8.1+6967bc1b-1/u16/zivid-studio_1.8.1+6967bc1b-1_amd64.deb
# RUN wget https://www.zivid.com/hubfs/softwarefiles/releases/1.8.3+96f35dc6-1/u16/zivid-studio_1.8.3+96f35dc6-1_amd64.deb
# #RUN wget https://www.zivid.com/hubfs/softwarefiles/releases/1.8.1+6967bc1b-1/u16/zivid-tools_1.8.1+6967bc1b-1_amd64.deb
# RUN wget https://www.zivid.com/hubfs/softwarefiles/releases/1.8.3+96f35dc6-1/u16/zivid-tools_1.8.3+96f35dc6-1_amd64.deb
# RUN dpkg -i zivid-telicam-driver_3.0.1.1-1_amd64.deb
# RUN dpkg -i zivid_1.8.3+96f35dc6-1_amd64.deb
# RUN dpkg -i zivid-studio_1.8.3+96f35dc6-1_amd64.deb
# Set entrypoint
COPY ./ros_entrypoint.sh /
RUN chmod a+x /ros_entrypoint.sh
# Copy workspace with dependencies created in the previous layer
COPY --from=intermediate /root/dev_ws /root/dev_ws
# WORKDIR /root/dev_ws/src
# RUN git clone --branch v1.1.0 https://github.com/zivid/zivid-ros.git
WORKDIR /root/dev_ws
RUN catkin init && catkin config --extend /opt/ros/kinetic && catkin build
# Add source ros to .bashrc
RUN echo "#ROS\nsource /opt/ros/kinetic/setup.bash\nsource /root/dev_ws/devel/setup.bash" >> /root/.bashrc
ENTRYPOINT ["/ros_entrypoint.sh"]
CMD ["bash"]
# Switch back to dialog for any ad-hoc use of apt-get
ENV DEBIAN_FRONTEND=
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment