diff --git a/.github/workflows/nexus_integration_tests.yaml b/.github/workflows/nexus_integration_tests.yaml index 6c1838a..e39130d 100644 --- a/.github/workflows/nexus_integration_tests.yaml +++ b/.github/workflows/nexus_integration_tests.yaml @@ -11,10 +11,10 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - docker_image: ['ros:humble-ros-base'] + docker_image: ['ros:iron-ros-base'] container: image: ${{ matrix.docker_image }} - timeout-minutes: 30 + timeout-minutes: 60 steps: - uses: actions/checkout@v2 - uses: actions/cache@v3 diff --git a/.github/workflows/style.yaml b/.github/workflows/style.yaml index af92c2d..fdeaabd 100644 --- a/.github/workflows/style.yaml +++ b/.github/workflows/style.yaml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - docker_image: ['ros:humble-ros-base'] + docker_image: ['ros:iron-ros-base'] container: image: ${{ matrix.docker_image }} steps: @@ -19,8 +19,8 @@ jobs: uses: actions/checkout@v2 - name: uncrustify run: | - sudo apt update && sudo apt install -y ros-humble-rmf-utils - /ros_entrypoint.sh ament_uncrustify -c /opt/ros/humble/share/rmf_utils/rmf_code_style.cfg . --language C++ --exclude nexus_endpoints/nexus_endpoints.hpp + sudo apt update && sudo apt install -y ros-iron-rmf-utils + /ros_entrypoint.sh ament_uncrustify -c /opt/ros/iron/share/rmf_utils/rmf_code_style.cfg . --language C++ --exclude nexus_endpoints/nexus_endpoints.hpp - name: pycodestyle run: | sudo apt update && sudo apt install -y pycodestyle curl diff --git a/README.md b/README.md index 96525a4..b0d4f65 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ A ROS 2 framework which enables configuration and orchestration of process workf For details on architecture and concepts [see](./docs/concepts.md). ## Requirements -* [ROS 2 Humble](https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html) on `Ubuntu 22.04` +* [ROS 2 Iron](https://docs.ros.org/en/iron/Installation/Ubuntu-Install-Debians.html) on `Ubuntu 22.04` ## Setup @@ -21,12 +21,12 @@ cd ~/ws_nexus/src/ git clone git@github.com:OpenSourceRobotics/nexus vcs import . < nexus/abb.repos cd ~/ws_nexus -rosdep install --from-paths src --ignore-src --rosdistro humble -y -r +rosdep install --from-paths src --ignore-src --rosdistro iron -y -r ``` ### Build the NEXUS workspace ```bash -source /opt/ros/humble/setup.bash +source /opt/ros/iron/setup.bash colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release ``` @@ -90,10 +90,10 @@ The linter of choice is `uncrustify` and the configuration used may be reference Instead of invoking `uncrustify` directly, use `ament_uncrustify` instead which is a wrapper around a specific version of `uncrustify`. You may locally run the linter as follows ```bash -sudo apt update && sudo apt install -y ros-humble-rmf-utils # This is a one-time step -source /opt/ros/humble/setup.bash +sudo apt update && sudo apt install -y ros-iron-rmf-utils # This is a one-time step +source /opt/ros/iron/setup.bash cd ~/ws_nexus/src/nexus -ament_uncrustify -c /opt/ros/humble/share/rmf_utils/rmf_code_style.cfg . --language C++ --exclude nexus_endpoints/nexus_endpoints.hpp +ament_uncrustify -c /opt/ros/iron/share/rmf_utils/rmf_code_style.cfg . --language C++ --exclude nexus_endpoints/nexus_endpoints.hpp ``` To automatically reformat the code, append `--reformat` to the `ament_uncrustify` line above. It is highly recommended to audit the changes by the linter before committing. @@ -105,12 +105,12 @@ A linter such as `pycodestyle` may be used for linting. ## Known Issues ### Unable to scale speeds of cartesian motions in Humble -The `humble` version of `moveit2` [lacks support](https://github.com/ros-planning/moveit2/issues/1967) for scaling velocity and accelerations of motion plans generated from cartesian interpolation. -The fixes are likely to land in further distro releases. +`moveit2` version 2.7.4 and below has a bug that prevents using `cached_ik_kinematics_plugin/CachedKDLKinematicsPlugin`. +The fixes will be available when [a new release into ROS Iron is made](https://github.com/ros-planning/moveit2/issues/2327). -The workaround for now is to rely on fixes incorporated into custom forks of `moveit2` packages which are compatible with `humble`. +The workaround for now is to use the `iron` branch on the upstream repository directly. ->Note: First make sure all `moveit2` binaries are purged from the system via `sudo apt purge ros-humble-moveit*`. +>Note: First make sure all `moveit2` binaries are purged from the system via `sudo apt purge ros-iron-moveit*`. Then as part of the workspace setup, clone in repositories from the [thirdparty.repos](./thirdparty.repos) file. Follow the reset of the Setup and Build instructions from above. diff --git a/abb.repos b/abb.repos index 0e49f75..ab5d92c 100644 --- a/abb.repos +++ b/abb.repos @@ -18,4 +18,4 @@ repositories: thirdparty/abb/abb_ros2: type: git url: https://github.com/yadunund/abb_ros2.git - version: humble + version: main diff --git a/nexus_common/include/nexus_common/logging.hpp b/nexus_common/include/nexus_common/logging.hpp index 5c31f01..9551fed 100644 --- a/nexus_common/include/nexus_common/logging.hpp +++ b/nexus_common/include/nexus_common/logging.hpp @@ -177,8 +177,10 @@ public: static std::string to_string(const BtLogging::LogReport& report); * @param log_level The log level to set to, if not provided it will be read from * NEXUS_LOG_LEVEL environment variable. If the log level is invalid, it will be ignored. * - * Note: ros2 humble still does not support externally setting log level, using env var - * best supports scenarios like `ros2 launch`. + * Note: ROS Iron only supports externally setting log level using the + * `--log-level` CLI flag. + * This function allows it to be set via an environment variable + * `NEXUS_LOG_LEVEl`. */ template void configure_logging(NodePtrT node, diff --git a/nexus_integration_tests/config/workcell_1_bts/place_on_conveyor.xml b/nexus_integration_tests/config/workcell_1_bts/place_on_conveyor.xml index 9494fa2..75d1b9f 100644 --- a/nexus_integration_tests/config/workcell_1_bts/place_on_conveyor.xml +++ b/nexus_integration_tests/config/workcell_1_bts/place_on_conveyor.xml @@ -5,7 +5,7 @@ - + @@ -14,14 +14,14 @@ - + - + diff --git a/nexus_integration_tests/launch/workcell.launch.py b/nexus_integration_tests/launch/workcell.launch.py index 847b7a2..3cc1b70 100644 --- a/nexus_integration_tests/launch/workcell.launch.py +++ b/nexus_integration_tests/launch/workcell.launch.py @@ -196,10 +196,9 @@ def launch_setup(context, *args, **kwargs): IncludeLaunchDescription( [ PathJoinSubstitution([ - FindPackageShare("nexus_integration_tests"), + FindPackageShare("abb_bringup"), 'launch', - 'include', - 'nexus_control.launch.py', + 'abb_control.launch.py', ]) ], launch_arguments=[ @@ -271,7 +270,6 @@ def launch_setup(context, *args, **kwargs): condition=IfCondition(use_zenoh_bridge), ), activate_node_service("motion_planner_server", ros_domain_id.perform(context)), - activate_node_service("robot_controller_server", ros_domain_id.perform(context)), ] diff --git a/nexus_integration_tests/launch/zenoh_bridge.launch.py b/nexus_integration_tests/launch/zenoh_bridge.launch.py index 8e66d2a..b6adb2c 100644 --- a/nexus_integration_tests/launch/zenoh_bridge.launch.py +++ b/nexus_integration_tests/launch/zenoh_bridge.launch.py @@ -24,7 +24,10 @@ LaunchConfiguration, PathJoinSubstitution, ) -from launch_ros.substitutions import FindPackageShare +from launch_ros.substitutions import ( + ExecutableInPackage, + FindPackageShare, +) def launch_setup(context, *args, **kwargs): @@ -35,28 +38,27 @@ def launch_setup(context, *args, **kwargs): log_level = LaunchConfiguration("log_level") ros_domain_id = LaunchConfiguration("ros_domain_id") - dds_localhost_only_text = "" + cmd = [ + ExecutableInPackage( + executable="zenoh_bridge_dds", + package="nexus_zenoh_bridge_dds_vendor", + ), + "--config", + PathJoinSubstitution([ + FindPackageShare(zenoh_config_package), + zenoh_config_filename + ]), + "--domain", + ros_domain_id, + ] if IfCondition(dds_localhost_only).evaluate(context): - dds_localhost_only_text = " --dds-localhost-only" + cmd.append("--dds-localhost-only") zenoh_bridge_exec = ExecuteProcess( - cmd=[ - "RUST_LOG="+log_level.perform(context), - FindExecutable(name="ros2"), - "run", - "nexus_zenoh_bridge_dds_vendor", - "zenoh_bridge_dds", - "--config", - PathJoinSubstitution([ - FindPackageShare(zenoh_config_package), - zenoh_config_filename - ]), - "--domain", - ros_domain_id, - dds_localhost_only_text, - ], + cmd=cmd, shell=True, + additional_env={"RUST_LOG": log_level.perform(context)}, ) return [zenoh_bridge_exec] diff --git a/nexus_integration_tests/package.xml b/nexus_integration_tests/package.xml index 730121c..b8f27c9 100644 --- a/nexus_integration_tests/package.xml +++ b/nexus_integration_tests/package.xml @@ -36,7 +36,6 @@ launch_xml nexus_capabilities nexus_motion_planner - nexus_robot_controller nexus_rviz_plugins nexus_system_orchestrator nexus_workcell_orchestrator diff --git a/nexus_integration_tests/test_parallel_wo.py b/nexus_integration_tests/test_parallel_wo.py index 615a3a0..48d3d8c 100644 --- a/nexus_integration_tests/test_parallel_wo.py +++ b/nexus_integration_tests/test_parallel_wo.py @@ -22,11 +22,21 @@ from rclpy.action import ActionClient from rclpy.action.client import ClientGoalHandle from ros_testcase import RosTestCase +import subprocess class ParallelWoTest(NexusTestCase): @RosTestCase.timeout(60) async def asyncSetUp(self): + # todo(YV): Find a better fix to the problem below. + # zenoh-bridge was bumped to 0.72 as part of the upgrade to + # ROS 2 Iron. However with this upgrade, the bridge does not clearly + # terminate when a SIGINT is received leaving behind zombie bridge + # processes from previous test cases. As a result, workcell registration + # fails for this testcase due to multiple bridges remaining active. + # Hence we explicitly kill any zenoh processes before launching the test. + subprocess.Popen('pkill -9 -f zenoh', shell=True) + self.proc = managed_process( ("ros2", "launch", "nexus_integration_tests", "launch.py"), ) diff --git a/nexus_integration_tests/test_pick_and_place.py b/nexus_integration_tests/test_pick_and_place.py index c49bbc9..6369320 100644 --- a/nexus_integration_tests/test_pick_and_place.py +++ b/nexus_integration_tests/test_pick_and_place.py @@ -25,11 +25,20 @@ from rclpy.action import ActionClient from rclpy.action.client import ClientGoalHandle, GoalStatus from ros_testcase import RosTestCase - +import subprocess class PickAndPlaceTest(NexusTestCase): @RosTestCase.timeout(60) async def asyncSetUp(self): + # todo(YV): Find a better fix to the problem below. + # zenoh-bridge was bumped to 0.72 as part of the upgrade to + # ROS 2 Iron. However with this upgrade, the bridge does not clearly + # terminate when a SIGINT is received leaving behind zombie bridge + # processes from previous test cases. As a result, workcell registration + # fails for this testcase due to multiple bridges remaining active. + # Hence we explicitly kill any zenoh processes before launching the test. + subprocess.Popen('pkill -9 -f zenoh', shell=True) + self.proc = managed_process( ("ros2", "launch", "nexus_integration_tests", "launch.py"), ) diff --git a/nexus_motion_planner/src/motion_planner_server.cpp b/nexus_motion_planner/src/motion_planner_server.cpp index 272f2dd..1ecd6f1 100644 --- a/nexus_motion_planner/src/motion_planner_server.cpp +++ b/nexus_motion_planner/src/motion_planner_server.cpp @@ -269,8 +269,8 @@ bool MotionPlannerServer::initialize_move_group_interfaces() MoveGroupInterface::Options options{std::move(group_name)}; if (_use_namespace) { - options.move_group_namespace_ = name; - options.robot_description_ = name + ".robot_description"; + options.move_group_namespace = name; + options.robot_description = name + ".robot_description"; } try { @@ -520,9 +520,9 @@ void MotionPlannerServer::plan_with_move_group( { MoveGroupInterface::Plan plan; res->result.error_code = interface->plan(plan); - res->result.trajectory_start = std::move(plan.start_state_); - res->result.trajectory = std::move(plan.trajectory_); - res->result.planning_time = std::move(plan.planning_time_); + res->result.trajectory_start = std::move(plan.start_state); + res->result.trajectory = std::move(plan.trajectory); + res->result.planning_time = std::move(plan.planning_time); } if (_execute_trajectory) { diff --git a/nexus_network_configuration/README.md b/nexus_network_configuration/README.md index b3622dc..bcddfd3 100644 --- a/nexus_network_configuration/README.md +++ b/nexus_network_configuration/README.md @@ -54,5 +54,3 @@ workcell_orchestrators: ```bash ros2 run nexus_network_configuration nexus_network_configuration -n -r -o ``` - -> Note: The latest version of [zenoh-plugin-dds](https://github.com/eclipse-zenoh/zenoh-plugin-dds) does not require a custom CycloneDDS configuration to listen to DDS traffic on the loopback interface, and this could simply be toggled by using either `ROS_LOCALHOST_ONLY=1` or specifying the `dds-localhost-only` flag. However, the humble binary does have have these changes in as of 2/10/2022 diff --git a/nexus_network_configuration/scripts/set_up_network.sh b/nexus_network_configuration/scripts/set_up_network.sh index 2bd6840..123f353 100755 --- a/nexus_network_configuration/scripts/set_up_network.sh +++ b/nexus_network_configuration/scripts/set_up_network.sh @@ -1,11 +1,11 @@ #!/bin/bash # This script does the following: -# 1. Install CycloneDDS (Humble dist.) if not already installed +# 1. Install CycloneDDS (Iron dist.) if not already installed # 2. Change RMW_IMPLEMENTATION to CycloneDDS # 3. Enable multicast on loopback interface -RMW_PACKAGE="ros-humble-rmw-cyclonedds-cpp" +RMW_PACKAGE="ros-iron-rmw-cyclonedds-cpp" PKG_OK=$(dpkg-query -W --showformat='${Status}\n' $RMW_PACKAGE|grep "install ok installed") diff --git a/nexus_zenoh_bridge_dds_vendor/CMakeLists.txt b/nexus_zenoh_bridge_dds_vendor/CMakeLists.txt index 50ae8ea..4cd13dc 100644 --- a/nexus_zenoh_bridge_dds_vendor/CMakeLists.txt +++ b/nexus_zenoh_bridge_dds_vendor/CMakeLists.txt @@ -1,22 +1,25 @@ cmake_minimum_required(VERSION 3.16) -set(PROJECT_NAME nexus_zenoh_bridge_dds_vendor) -project(${PROJECT_NAME} VERSION 0.6.0) +project(nexus_zenoh_bridge_dds_vendor) -include(ExternalProject) +# Default to C++17 +if(NOT CMAKE_CXX_STANDARD) + set(CMAKE_CXX_STANDARD 17) + set(CMAKE_CXX_STANDARD_REQUIRED ON) +endif() find_package(ament_cmake REQUIRED) +find_package(ament_cmake_vendor_package REQUIRED) -ExternalProject_Add(zenoh_bridge_dds - URL https://github.com/koonpeng/zenoh-plugin-dds/releases/download/0.6.0-beta.1/zenoh_bridge_dds-0.6.0-beta.1.tar.gz - PREFIX "zenoh_bridge_dds-bin" - CONFIGURE_COMMAND "" - BUILD_COMMAND "" - INSTALL_COMMAND "" +ament_vendor(zeno_bridge_dds_vendor + VCS_URL https://github.com/eclipse-zenoh/zenoh-plugin-dds.git + VCS_VERSION 0.7.2-rc ) +# TODO(sloretz) make a nice way to get this path from ament_vendor +set(INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/zeno_bridge_dds_vendor-prefix/install") install( - DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/zenoh_bridge_dds-bin/src/zenoh_bridge_dds/lib/zenoh_bridge_dds" - DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/${PROJECT_NAME}" + DIRECTORY "${INSTALL_DIR}/lib/zenoh_bridge_dds/" + DESTINATION "lib/${PROJECT_NAME}" USE_SOURCE_PERMISSIONS ) diff --git a/nexus_zenoh_bridge_dds_vendor/package.xml b/nexus_zenoh_bridge_dds_vendor/package.xml index 2342303..3e9aef8 100644 --- a/nexus_zenoh_bridge_dds_vendor/package.xml +++ b/nexus_zenoh_bridge_dds_vendor/package.xml @@ -2,12 +2,16 @@ nexus_zenoh_bridge_dds_vendor - 0.5.0 + 0.0.1 Newer version of zenoh_bridge_dds for NEXUS Teo Koon Peng Apache License 2.0 ament_cmake + ament_cmake_vendor_package + + cargo + clang ament_cmake diff --git a/thirdparty.repos b/thirdparty.repos index 9c366f5..15a29e7 100644 --- a/thirdparty.repos +++ b/thirdparty.repos @@ -5,17 +5,17 @@ repositories: version: 2.2.2 thirdparty/moveit/moveit2: type: git - url: https://github.com/koonpeng/moveit2.git - version: kp/scale_get_cartesian_path_humble + url: https://github.com/ros-planning/moveit2.git + version: iron thirdparty/moveit/moveit_resources: type: git url: https://github.com/ros-planning/moveit_resources.git - version: humble + version: 2.1.1 thirdparty/moveit/object_recognition_msgs: type: git url: https://github.com/wg-perception/object_recognition_msgs - version: ros2 + version: 2.0.0 thirdparty/PickNikRobotics/pick_ik: type: git url: https://github.com/picknikrobotics/pick_ik - version: 1.0.0 + version: 1.0.2