diff --git a/dockerfiles/devenv.Dockerfile b/dockerfiles/devenv.Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..bab530bd199a6e6f9fd4921e8600c83dda3b5a40 --- /dev/null +++ b/dockerfiles/devenv.Dockerfile @@ -0,0 +1,203 @@ +ARG ROS_DISTRO + +FROM osrf/ros:${ROS_DISTRO}-desktop-full +RUN echo "Building devenv for ROS" $ROS_DISTRO + +# 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 update && 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 + clang-format \ + direnv \ + git \ + git-lfs \ + less \ + nano \ + openssh-client \ + terminator \ + xterm \ + zsh \ + # + ros-${ROS_DISTRO}-catkin \ + ros-${ROS_DISTRO}-plotjuggler \ + ros-${ROS_DISTRO}-plotjuggler-ros \ + ros-${ROS_DISTRO}-rosmon \ + ros-${ROS_DISTRO}-rqt-controller-manager \ + ros-${ROS_DISTRO}-rqt-joint-trajectory-controller + +RUN if [ "${ROS_DISTRO}" = "noetic" ]; \ + then \ + apt-get -y install \ + ipython3 \ + python-is-python3 \ + python3-catkin-tools \ + python3-click \ + python3-numpy \ + python3-osrf-pycommon; \ + elif [ "${ROS_DISTRO}" = "melodic" ]; \ + then \ + apt-get -y install \ + ipython \ + python-catkin-tools \ + python-pip \ + python-osrf-pycommon; \ + else \ + echo "Not supported version"; \ + fi + +# Configure system to look for debian packages in the Artifactory repository +COPY auth.conf /etc/apt/auth.conf.d/tecnalia.conf + +# 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" + +# 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 \ +# docker-ce \ +# docker-ce-cli \ +# containerd.io \ +# docker-compose-plugin + +# Install pip3 and packages +RUN apt-get install -y \ + python3-pip \ + && pip3 install sqlite_utils + +# Install node for UIs +RUN curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash \ + && apt-get install -y nodejs && npm -g install yarn + +# ROS WS dependencies +RUN apt-get update && apt-get install -y \ + libceres-dev \ + libcomedi-dev \ + libglfw3-dev \ + libmodbus-dev \ + python-numpy \ + socat \ + # ROS Distro packages + ros-${ROS_DISTRO}-ackermann-msgs \ + ros-${ROS_DISTRO}-amcl \ + ros-${ROS_DISTRO}-cartesian-trajectory-controller \ + ros-${ROS_DISTRO}-chomp-motion-planner \ + ros-${ROS_DISTRO}-collada-urdf \ + ros-${ROS_DISTRO}-effort-controllers \ + ros-${ROS_DISTRO}-force-torque-sensor-controller \ + ros-${ROS_DISTRO}-gmapping \ + ros-${ROS_DISTRO}-hector-gazebo-plugins \ + ros-${ROS_DISTRO}-hector-mapping \ + ros-${ROS_DISTRO}-imu-complementary-filter \ + ros-${ROS_DISTRO}-imu-tools \ + ros-${ROS_DISTRO}-industrial-core \ + ros-${ROS_DISTRO}-industrial-robot-simulator \ + ros-${ROS_DISTRO}-industrial-robot-status-controller \ + ros-${ROS_DISTRO}-industrial-robot-status-interface \ + ros-${ROS_DISTRO}-interactive-marker-twist-server \ + ros-${ROS_DISTRO}-joint-trajectory-controller \ + ros-${ROS_DISTRO}-joy \ + ros-${ROS_DISTRO}-lms1xx \ + ros-${ROS_DISTRO}-map-server \ + ros-${ROS_DISTRO}-mavros-msgs \ + ros-${ROS_DISTRO}-move-base \ + ros-${ROS_DISTRO}-moveit-commander \ + ros-${ROS_DISTRO}-moveit-fake-controller-manager \ + ros-${ROS_DISTRO}-moveit-planners-chomp \ + ros-${ROS_DISTRO}-moveit-planners-ompl \ + ros-${ROS_DISTRO}-moveit-resources \ + ros-${ROS_DISTRO}-moveit-ros-benchmarks \ + ros-${ROS_DISTRO}-moveit-ros-move-group \ + ros-${ROS_DISTRO}-moveit-ros-planning-interface \ + ros-${ROS_DISTRO}-moveit-ros-visualization \ + ros-${ROS_DISTRO}-moveit-ros-warehouse \ + ros-${ROS_DISTRO}-moveit-setup-assistant\ + ros-${ROS_DISTRO}-moveit-simple-controller-manager \ + ros-${ROS_DISTRO}-moveit-visual-tools \ + ros-${ROS_DISTRO}-navigation \ + ros-${ROS_DISTRO}-pass-through-controllers \ + ros-${ROS_DISTRO}-pilz-industrial-motion \ + ros-${ROS_DISTRO}-realsense2-camera \ + ros-${ROS_DISTRO}-robot-localization \ + ros-${ROS_DISTRO}-ros-control \ + ros-${ROS_DISTRO}-ros-control-boilerplate \ + ros-${ROS_DISTRO}-ros-controllers \ + ros-${ROS_DISTRO}-rosbridge-server \ + ros-${ROS_DISTRO}-scaled-joint-trajectory-controller \ + ros-${ROS_DISTRO}-serial \ + ros-${ROS_DISTRO}-spacenav-node \ + ros-${ROS_DISTRO}-speed-scaling-interface \ + ros-${ROS_DISTRO}-speed-scaling-state-controller \ + ros-${ROS_DISTRO}-teb-local-planner \ + ros-${ROS_DISTRO}-trac-ik-kinematics-plugin \ + ros-${ROS_DISTRO}-twist-controller \ + ros-${ROS_DISTRO}-twist-mux \ + ros-${ROS_DISTRO}-ur-client-library \ + ros-${ROS_DISTRO}-ur-msgs \ + ros-${ROS_DISTRO}-velocity-controllers \ + ros-${ROS_DISTRO}-warehouse-ros-mongo + +RUN if [ "${ROS_DISTRO}" = "noetic" ]; \ + then \ + apt-get -y install \ + ipython3 \ + python-is-python3 \ + python3-catkin-tools \ + python3-click \ + python3-numpy \ + python3-osrf-pycommon; \ + elif [ "${ROS_DISTRO}" = "melodic" ]; \ + then \ + apt-get -y install \ + ros-${ROS_DISTRO}-ar-track-alvar \ + python-mock \ + python-funcsigs \ + python-sqlalchemy \ + python3-rospkg-modules \ + python3-yaml; \ + else \ + echo "Not supported version"; \ + fi + +# Update this date to re-run the image final update +LABEL image.date=01-12-2022 + +# Update final image +RUN apt-get update \ + && apt-get -y upgrade + +# Set entrypoint +COPY ./ros_entrypoint.sh / +RUN chmod a+x /ros_entrypoint.sh + +ENTRYPOINT ["/ros_entrypoint.sh"] +CMD ["zsh"] +ENV ROS_DISTRO "${ROS_DISTRO}" +ENV SHELL /usr/bin/zsh +ENV RUNNING_IN_DOCKER true + +# Switch back to dialog for any ad-hoc use of apt-get +ENV DEBIAN_FRONTEND= \ No newline at end of file diff --git a/dockerfiles/melodic.Dockerfile b/dockerfiles/other/melodic.Dockerfile similarity index 92% rename from dockerfiles/melodic.Dockerfile rename to dockerfiles/other/melodic.Dockerfile index 4cd3f35df01150d23381f04c3afc53b248c099e2..de218a9d2651e4e78190cef925df5afeda05df97 100644 --- a/dockerfiles/melodic.Dockerfile +++ b/dockerfiles/other/melodic.Dockerfile @@ -25,26 +25,33 @@ RUN apt-get update && apt-get -y install --no-install-recommends \ git \ git-lfs \ nano \ + less \ clang-format \ direnv \ xterm \ terminator \ zsh \ # - ros-${ROS_DISTRO}-catkin \ - ros-${ROS_DISTRO}-rosmon \ - ros-${ROS_DISTRO}-plotjuggler-ros \ + ipython \ python-catkin-tools \ python-numpy \ python-osrf-pycommon \ - ipython + ros-${ROS_DISTRO}-catkin \ + ros-${ROS_DISTRO}-plotjuggler \ + ros-${ROS_DISTRO}-plotjuggler-ros \ + ros-${ROS_DISTRO}-rosmon \ + ros-${ROS_DISTRO}-rqt-controller-manager \ + ros-${ROS_DISTRO}-rqt-joint-trajectory-controller # 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 +# 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 \ +# docker-ce-cli \ +# containerd.io \ +# docker-compose-plugin # && rm -rf /var/lib/apt/lists/* # Configure system to look for debian packages in the Artifactory repository diff --git a/dockerfiles/noetic.Dockerfile b/dockerfiles/other/noetic.Dockerfile similarity index 88% rename from dockerfiles/noetic.Dockerfile rename to dockerfiles/other/noetic.Dockerfile index c710749362323250375e9ab06380fc5afa8d4513..fd2f5499d75ba7f23279cb28ab9b204a060b359c 100644 --- a/dockerfiles/noetic.Dockerfile +++ b/dockerfiles/other/noetic.Dockerfile @@ -32,26 +32,28 @@ RUN apt-get update && apt-get -y install --no-install-recommends \ terminator \ zsh \ # + ipython3 \ + python-is-python3 \ + python3-catkin-tools \ + python3-click \ + python3-numpy \ + python3-osrf-pycommon \ ros-${ROS_DISTRO}-catkin \ ros-${ROS_DISTRO}-plotjuggler \ ros-${ROS_DISTRO}-plotjuggler-ros \ ros-${ROS_DISTRO}-rosmon \ - python3-catkin-tools \ - python3-osrf-pycommon \ - python3-numpy \ - python3-click \ - python-is-python3 \ - ipython3 + ros-${ROS_DISTRO}-rqt-controller-manager \ + ros-${ROS_DISTRO}-rqt-joint-trajectory-controller # 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 \ - docker-ce \ - docker-ce-cli \ - containerd.io \ - docker-compose-plugin +# 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 \ +# docker-ce \ +# docker-ce-cli \ +# containerd.io \ +# docker-compose-plugin # Configure system to look for debian packages in the Artifactory repository # ARG USER_API_KEY_ARTIFACTS_TECNALIA @@ -74,6 +76,7 @@ RUN apt-get update && apt-get install -y \ libcomedi-dev \ libglfw3-dev \ libmodbus-dev \ + python-numpy \ ros-${ROS_DISTRO}-ackermann-msgs \ ros-${ROS_DISTRO}-amcl \ ros-${ROS_DISTRO}-cartesian-trajectory-controller \ @@ -85,11 +88,15 @@ RUN apt-get update && apt-get install -y \ ros-${ROS_DISTRO}-hector-gazebo-plugins \ ros-${ROS_DISTRO}-hector-mapping \ ros-${ROS_DISTRO}-imu-complementary-filter \ + ros-${ROS_DISTRO}-imu-tools \ + ros-${ROS_DISTRO}-industrial-core \ ros-${ROS_DISTRO}-industrial-robot-simulator \ ros-${ROS_DISTRO}-industrial-robot-status-controller \ ros-${ROS_DISTRO}-industrial-robot-status-interface \ + ros-${ROS_DISTRO}-interactive-marker-twist-server \ ros-${ROS_DISTRO}-joint-trajectory-controller \ ros-${ROS_DISTRO}-joy \ + ros-${ROS_DISTRO}-lms1xx \ ros-${ROS_DISTRO}-map-server \ ros-${ROS_DISTRO}-mavros-msgs \ ros-${ROS_DISTRO}-move-base \ @@ -116,6 +123,7 @@ RUN apt-get update && apt-get install -y \ ros-${ROS_DISTRO}-ros-controllers \ ros-${ROS_DISTRO}-rosbridge-server \ ros-${ROS_DISTRO}-scaled-joint-trajectory-controller \ + ros-${ROS_DISTRO}-serial \ ros-${ROS_DISTRO}-spacenav-node \ ros-${ROS_DISTRO}-speed-scaling-interface \ ros-${ROS_DISTRO}-speed-scaling-state-controller \ @@ -140,9 +148,7 @@ RUN curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash \ # Update final image RUN apt-get update \ - && apt-get -y upgrade \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* + && apt-get -y upgrade # Set entrypoint COPY ./ros_entrypoint.sh / diff --git a/dotfiles/.gitconfig b/dotfiles/.gitconfig index c1ed3323b8ed69bb56e86e189cf1dcf03934b8dc..57e6674d70413475392a9dc92c5e20e3f0182395 100644 --- a/dotfiles/.gitconfig +++ b/dotfiles/.gitconfig @@ -7,4 +7,4 @@ name = Andres Montano email = andres.montano@tecnalia.com [credential] - helper = cache --timeout=3600 + helper = "!f() { /home/andres/.vscode-server/bin/6261075646f055b99068d3688932416f2346dd3b/node /tmp/vscode-remote-containers-3d8c92443114dbc6ada6ba17c8fe7a517dcf20fc.js $*; }; f" diff --git a/dotfiles/docker.bash b/dotfiles/docker.bash index 0a88239b1bb1b1ea50b4d3307a88daf3da190340..0504420dd520f77891edc5e1c078b8a77d0663c9 100644 --- a/dotfiles/docker.bash +++ b/dotfiles/docker.bash @@ -9,9 +9,10 @@ alias dimp="docker image prune" # Run container with rocker # usage: rundock {noetic, melodic} [{remodel_ws, odin_ws}] [cmd] +# To share docker --volume /var/run/docker.sock:/var/run/docker.sock:ro function rundock() { cd ~/ros/$1/$2; - rocker --home --user --ssh --git --privileged --nvidia --x11 --volume /var/run/docker.sock:/var/run/docker.sock:ro --network host --name $1 devenv:$1 $3 + rocker --home --ssh --git --user --nvidia --x11 --network host --name $1 devenv:$1 $3 } # Execute container, move to workspace, and source SHELL @@ -40,7 +41,7 @@ function drmui(){ # usage: dockbuild {noetic, melodic} function dockbuild(){ cd ~/srcs/development_environment/dockerfiles; - docker build -t devenv:$1 --build-arg USER_API_KEY_ARTIFACTS_TECNALIA="$(cat ~/.ssh/user_api_key_artifacts_tecnalia)" -f $1.Dockerfile . + docker build -t devenv:$1 --build-arg ROS_DISTRO=$1 -f devenv.Dockerfile . } # function runpythonsyntax(){ diff --git a/dotfiles/ros.bash b/dotfiles/ros.bash index e4add5ec0f9e278803e53794fa36aa851fd8afea..3ecdead331e5a28aab3883eb07b7fc1b71447039 100644 --- a/dotfiles/ros.bash +++ b/dotfiles/ros.bash @@ -40,7 +40,7 @@ function sourceros(){ # Source the current workspace function sourcethis(){ pwd_st=${PWD} - roshome && source ./devel/setup.${ext} && smon + roshome && sourcews cd ${pwd_st} } @@ -58,16 +58,16 @@ function cbclean(){ roshome && rm -rf build devel install && catkin build --summarize --cmake-args -DCMAKE_BUILD_TYPE=Release } +# Initialize catkin workspace, configure and build it +function cib(){ + catkin init && catkin config --extend /opt/ros/${ROS_DISTRO} && catkin build --summarize --cmake-args -DCMAKE_BUILD_TYPE=Release +} + # Run ci locally function runci(){ rosrun industrial_ci run_ci ROS_DISTRO="$@" DOCKER_IMAGE=tecnalia-robotics-docker.artifact.tecnalia.com/flexbotics-base-devel:"$@" } -# Initialize catkin workspace, configure and build it -function cib(){ - catkin init && catkin config --extend /opt/ros/${ROS_DISTRO} && catkin build --summarize -} - # If terminal starts in a ws, auto source it (useful for vscode) if [ -z ${ROS_DISTRO+x} ]; then ; else diff --git a/notes/IK Plugin MoveIt.md b/notes/IK Plugin MoveIt.md new file mode 100644 index 0000000000000000000000000000000000000000..c9c3cef1e6b3111f4af29275e95f138471d0a726 --- /dev/null +++ b/notes/IK Plugin MoveIt.md @@ -0,0 +1,23 @@ +# IK Plugin MoveIt + +kinematics::KinematicsBase + +## KinematicsBase + +kinematics::KinematicsBase + +The KinematicsBase interface enables you, to: + +- write your own forward and inverse kinematic solvers +- wrap external kinematic solver libraries + +### Interface Description + +The well documented interface is located here <https://github.com/ros-planning/moveit/blob/3464e3d27bd8655aa6187ca5d3a031a4f72663e2/moveit_core/kinematics_base/include/moveit/kinematics_base/kinematics_base.h>. + +### Concrete Implementations + +Examples for implementations of the KinematicsBase are + +- the KDL plugin: header <https://github.com/ros-planning/moveit/blob/master/moveit_kinematics/kdl_kinematics_plugin/include/moveit/kdl_kinematics_plugin/kdl_kinematics_plugin.h>, cpp <https://github.com/ros-planning/moveit/blob/master/moveit_kinematics/kdl_kinematics_plugin/src/kdl_kinematics_plugin.cpp> +- the SrvKinematicsPlugin: header <https://github.com/ros-planning/moveit/blob/master/moveit_kinematics/srv_kinematics_plugin/include/moveit/srv_kinematics_plugin/srv_kinematics_plugin.h>, cpp <https://github.com/ros-planning/moveit/blob/master/moveit_kinematics/srv_kinematics_plugin/src/srv_kinematics_plugin.cpp> diff --git a/notes/ik_solvers.md b/notes/ik_solvers.md index c4175d9b43e04accf44eb56057596bde2b33847e..38390b9e56be3b35563c643806955902af110378 100644 --- a/notes/ik_solvers.md +++ b/notes/ik_solvers.md @@ -12,3 +12,28 @@ ur_kinematics/UR16eKinematicsPlugin ERROR descartes (cpability) is not compatible with bio_ik + +Se generĂ³ un ikfast plugin con la escena de smart3d + smart3d_manipulator_kinematics/IKFastKinematicsPlugin_manipulator + +Para limitar los joints del ur, modificar el archivo: + /home/andres/ros/noetic/asai_ws/src/universal_robot/ur_description/config/ur16e/joint_limits.yaml + => Esto no produce mejores resultados + +## Closed form IK with calibration + +This is an open issue in official UR repository <https://github.com/ros-industrial/universal_robot/issues/564> + +As @miguel.prada suggest one option could be take the IKFast solutions as input seeds to other gradient descendent IK solver (e.g., KDL, bio_ik, track_ik, ...). The package everything in a IK_moveit_pluging. + +## References + +<https://robotics.stackexchange.com/questions/9152/inverse-kinematics-after-calibration> +<https://forum.universal-robots.com/t/inverse-kinematics-python/24735> +<https://github.com/ros-industrial/universal_robot/pull/414> +<https://iopscience.iop.org/article/10.1088/1742-6596/1449/1/012128> + +<https://github.com/ros-industrial/universal_robot/issues/357> +<https://github.com/UniversalRobots/Universal_Robots_ROS_Driver/issues/316> + +<https://github.com/ros-industrial/universal_robot/issues/564>