Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating moveit and canadarm setup #36

Merged
merged 9 commits into from
Mar 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 29 additions & 8 deletions moveit2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -83,30 +83,51 @@ RUN python3 -m pip install -U \

# Get the MoveIt2 source code
WORKDIR ${HOME_DIR}
RUN sudo git clone https://github.com/ros-planning/moveit2.git -b main moveit2/src
RUN sudo git clone https://github.com/ros-planning/moveit2.git -b ${ROSDISTRO} moveit2/src
RUN cd ${MOVEIT2_DIR}/src \
&& sudo git clone https://github.com/ros-planning/moveit2_tutorials.git -b ${ROSDISTRO}

# Update the ownership of the source files (had to use sudo above to work around
# a possible inherited 'insteadof' from the host that forces use of ssh
RUN sudo chown -R ${USERNAME}:${USERNAME} ${MOVEIT2_DIR}

# Get rosinstall_generator
RUN sudo apt-get update -y && sudo apt-get install -y python3-rosinstall-generator

# Generate repos file for moveit2 dependencies, excluding packages from Space ROS core.
COPY --chown=${USERNAME}:${USERNAME} moveit2-pkgs.txt /tmp/
COPY --chown=${USERNAME}:${USERNAME} excluded-pkgs.txt /tmp/
RUN rosinstall_generator \
--rosdistro ${ROSDISTRO} \
--deps \
--exclude-path ${SPACEROS_DIR}/src \
--exclude $(cat /tmp/excluded-pkgs.txt) -- \
-- $(cat /tmp/moveit2-pkgs.txt) \
> /tmp/moveit2_generated_pkgs.repos

# Get the repositories required by MoveIt2, but not included in Space ROS
WORKDIR ${MOVEIT2_DIR}
COPY --chown=${USERNAME}:${USERNAME} moveit2.repos ./
RUN sudo vcs import src < moveit2.repos
RUN vcs import src < /tmp/moveit2_generated_pkgs.repos
COPY --chown=${USERNAME}:${USERNAME} moveit2_tutorials.repos /tmp/
RUN vcs import src < /tmp/moveit2_tutorials.repos

# Update the ownership of the source files (had to use sudo above to work around
# a possible inherited 'insteadof' from the host that forces use of ssh
RUN sudo chown -R ${USERNAME}:${USERNAME} ${MOVEIT2_DIR}

# Install system dependencies
RUN rosdep install --from-paths ../spaceros/src src --ignore-src --rosdistro ${ROSDISTRO} -y --skip-keys "console_bridge fastcdr fastrtps rti-connext-dds-5.3.1 urdfdom_headers rmw_connextdds ros_testing rmw_connextdds rmw_fastrtps_cpp rmw_fastrtps_dynamic_cpp composition demo_nodes_py lifecycle rosidl_typesupport_fastrtps_cpp rosidl_typesupport_fastrtps_c ikos diagnostic_aggregator diagnostic_updater joy qt_gui rqt_gui rqt_gui_py"
RUN /bin/bash -c 'source ${SPACEROS_DIR}/install/setup.bash' \
&& rosdep install --from-paths ../spaceros/src src --ignore-src --rosdistro ${ROSDISTRO} -r -y --skip-keys "console_bridge generate_parameter_library fastcdr fastrtps rti-connext-dds-5.3.1 urdfdom_headers rmw_connextdds ros_testing rmw_connextdds rmw_fastrtps_cpp rmw_fastrtps_dynamic_cpp composition demo_nodes_py lifecycle rosidl_typesupport_fastrtps_cpp rosidl_typesupport_fastrtps_c ikos diagnostic_aggregator diagnostic_updater joy qt_gui rqt_gui rqt_gui_py"

# Apply a patch to octomap_msgs to work around a build issue
COPY --chown=${USERNAME}:${USERNAME} octomap_fix.diff ./src/octomap_msgs
RUN cd src/octomap_msgs && git apply octomap_fix.diff

# Build MoveIt2
RUN /bin/bash -c 'source ${SPACEROS_DIR}/install/setup.bash && colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON'
RUN /bin/bash -c 'source ${SPACEROS_DIR}/install/setup.bash \
&& colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON --event-handlers desktop_notification- status- --parallel-workers 1'

# Enable the container to run GUI apps and add a couple sample apps for testing
RUN touch ${HOME}/.Xauthority
EXPOSE 8887
# Add a couple sample GUI apps for testing
RUN sudo apt-get install -y \
firefox \
glmark2 \
Expand Down
28 changes: 27 additions & 1 deletion moveit2/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MoveIt2 Docker Image

The MoveIt2 Docker image uses the Space ROS docker image (*openrobotics/spaceros:latest*) as its base image. The MoveIt2 Dockerfile installs all of the prerequisite system dependencies to build MoveIt2 and then pulls and builds the latest MoveIt2 source code.
The MoveIt2 Docker image uses the Space ROS docker image (*openrobotics/spaceros:latest*) as its base image. The MoveIt2 Dockerfile installs all of the prerequisite system dependencies to build MoveIt2 (and Moveit2 tutorials) and then pulls and builds the latest MoveIt2 and Moveit2 tutorials source code.

## Building the MoveIt2 Image

Expand Down Expand Up @@ -42,3 +42,29 @@ Upon startup, the container automatically runs the entrypoint.sh script, which s
```
spaceros-user@8e73b41a4e16:~/moveit2#
```

## Running MoveIt2 Tutorials

Run the following command to launch the MoveIt2 tutorials demo launch file:

```
ros2 launch moveit2_tutorials demo.launch.py rviz_tutorial:=true
```

You should see lots of console output and the rviz2 window appear:

![rviz2 tutorial window](resources/moveit2-rviz-tutorial.png)

You can now following the [MoveIt2 Tutorial documentation](https://moveit.picknik.ai/galactic/doc/tutorials/quickstart_in_rviz/quickstart_in_rviz_tutorial.html).

## Running the MoveIt2 Move Group C++ Interface Demo

To run the Move Group C++ Interface Demo, execute the following command:

```
ros2 launch moveit2_tutorials move_group.launch.py
```

![rviz2 move group window](resources/moveit2-rviz.png)

Then, you can follow the [Move Group C++ Interface Demo documentation](https://moveit.picknik.ai/humble/doc/examples/move_group_interface/move_group_interface_tutorial.html).
10 changes: 10 additions & 0 deletions moveit2/excluded-pkgs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
fastcdr
fastrtps
fastrtps_cmake_module
rmw_fastrtps_cpp
rmw_fastrtps_dynamic_cpp
rmw_fastrtps_shared_cpp
rmw_connextdds
rosidl_typesupport_fastrtps_c
rosidl_typesupport_fastrtps_cpp
urdfdom_headers
37 changes: 37 additions & 0 deletions moveit2/moveit2-pkgs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
ackermann_msgs
angles
backward_ros
control_msgs
control_toolbox
eigen_stl_containers
geometric_shapes
graph_msgs
ignition/ignition_cmake2_vendor
ignition/ignition_math6_vendor
image_common
interactive_markers
joint_state_publisher
laser_geometry
launch_param_builder
moveit_msgs
moveit_resources
moveit_task_constructor
navigation_msgs
object_recognition_msgs
octomap
ompl
orocos_kinematics_dynamics
python_qt_binding
random_numbers
realtime_tools
resource_retriever
ros2_control
ros2_controllers
ruckig
rviz2
srdfdom
urdf_parser_py
vision_opencv
warehouse_ros
xacro
yaml_cpp_vendor
191 changes: 0 additions & 191 deletions moveit2/moveit2.repos

This file was deleted.

17 changes: 17 additions & 0 deletions moveit2/moveit2_tutorials.repos
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
repositories:
moveit_task_constructor:
type: git
url: https://github.com/ros-planning/moveit_task_constructor.git
version: ros2
moveit_visual_tools:
type: git
url: https://github.com/ros-planning/moveit_visual_tools
version: ros2
rosparam_shortcuts:
type: git
url: https://github.com/PickNikRobotics/rosparam_shortcuts
version: ros2
rviz_visual_tools:
type: git
url: https://github.com/PickNikRobotics/rviz_visual_tools.git
version: ros2
Loading