From a0850d748a07baf5f7537ff68f58dc823eb7d969 Mon Sep 17 00:00:00 2001 From: pedro-fuoco Date: Thu, 7 Nov 2024 01:14:15 -0300 Subject: [PATCH 1/2] Tools: add ROS 2 jazzy support --- Tools/ros2/{ros2.repos => humble.repos} | 0 .../{ros2_macos.repos => humble_macos.repos} | 0 Tools/ros2/jazzy.repos | 9 +++++++++ Tools/ros2/jazzy_macos.repos | 17 +++++++++++++++++ 4 files changed, 26 insertions(+) rename Tools/ros2/{ros2.repos => humble.repos} (100%) rename Tools/ros2/{ros2_macos.repos => humble_macos.repos} (100%) create mode 100644 Tools/ros2/jazzy.repos create mode 100644 Tools/ros2/jazzy_macos.repos diff --git a/Tools/ros2/ros2.repos b/Tools/ros2/humble.repos similarity index 100% rename from Tools/ros2/ros2.repos rename to Tools/ros2/humble.repos diff --git a/Tools/ros2/ros2_macos.repos b/Tools/ros2/humble_macos.repos similarity index 100% rename from Tools/ros2/ros2_macos.repos rename to Tools/ros2/humble_macos.repos diff --git a/Tools/ros2/jazzy.repos b/Tools/ros2/jazzy.repos new file mode 100644 index 0000000000000..204cf778dde01 --- /dev/null +++ b/Tools/ros2/jazzy.repos @@ -0,0 +1,9 @@ +repositories: + ardupilot: + type: git + url: https://github.com/ArduPilot/ardupilot.git + version: master + micro_ros_agent: + type: git + url: https://github.com/micro-ROS/micro-ROS-Agent.git + version: jazzy diff --git a/Tools/ros2/jazzy_macos.repos b/Tools/ros2/jazzy_macos.repos new file mode 100644 index 0000000000000..96f711a1312bf --- /dev/null +++ b/Tools/ros2/jazzy_macos.repos @@ -0,0 +1,17 @@ +repositories: + ardupilot: + type: git + url: https://github.com/srmainwaring/ardupilot.git + version: pr/pr-dds-launch-tests + microxrcedds_gen: + type: git + url: https://github.com/eProsima/Micro-XRCE-DDS-Gen.git + version: develop + micro_ros_agent: + type: git + url: https://github.com/srmainwaring/micro-ROS-Agent.git + version: cmake-macos + micro_ros_msgs: + type: git + url: https://github.com/micro-ROS/micro_ros_msgs.git + version: jazzy From 808605df1b60ae106d2b25018f9b76af96eaf6fb Mon Sep 17 00:00:00 2001 From: pedro-fuoco Date: Thu, 7 Nov 2024 01:14:47 -0300 Subject: [PATCH 2/2] Tools: update README to follow ArduPilot Wiki --- Tools/ros2/README.md | 158 +------------------------------------------ 1 file changed, 1 insertion(+), 157 deletions(-) diff --git a/Tools/ros2/README.md b/Tools/ros2/README.md index 4fd2e6e6bf8f5..4093b30013fb8 100644 --- a/Tools/ros2/README.md +++ b/Tools/ros2/README.md @@ -36,163 +36,7 @@ ArduPilot `AP_DDS` client library. ## Prerequisites -The packages depend on: - -- [ROS 2 Humble](https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html) - - -## Install Ubuntu - -#### 1. Create a workspace folder - -```bash -mkdir -p ~/ros2_ws/src && cd ~/ros2_ws/src -``` - -The ROS 2 tutorials contain more details regarding [ROS 2 workspaces](https://docs.ros.org/en/humble/Tutorials/Workspace/Creating-A-Workspace.html). - -#### 2. Get the `ros2.repos` file - -```bash -cd ~/ros2_ws/src -wget https://raw.githubusercontent.com/ArduPilot/ardupilot/master/Tools/ros2/ros2.repos -vcs import --recursive < ros2.repos -``` - -#### 3. Update dependencies - -```bash -cd ~/ros2_ws -source /opt/ros/humble/setup.bash -sudo apt update -rosdep update -rosdep install --rosdistro ${ROS_DISTRO} --from-paths src -``` - -#### 4. Build - -Check that the [ROS environment](https://docs.ros.org/en/humble/Tutorials/Beginner-CLI-Tools/Configuring-ROS2-Environment.html#check-environment-variables) is configured correctly: - -```bash -ROS_VERSION=2 -ROS_PYTHON_VERSION=3 -ROS_DISTRO=humble -``` - -```bash -cd ~/ros2_ws -colcon build --cmake-args -DBUILD_TESTING=ON -``` - -#### 5. Test - -```bash -source ./install/setup.bash -colcon test --packages-select ardupilot_dds_tests -colcon test-result --all --verbose -``` - -To debug a specific test, you can do the following: -``` -colcon --log-level DEBUG test --packages-select ardupilot_dds_tests --event-handlers=console_direct+ --pytest-args -k test_dds_udp_geopose_msg_recv -s -``` - -## Install macOS - -The install procedure on macOS is similar, except that all dependencies -must be built from source and additional compiler flags are needed. - -#### 1. Create a workspace folder - -```bash -mkdir -p ~/ros2_ws/src && cd ~/ros2_ws/src -``` - -#### 2. Get the `ros2_macos.repos` file - -The `ros2_macos.repos` includes additional dependencies to build: - -```bash -cd ~/ros2_ws/src -wget https://raw.githubusercontent.com/ArduPilot/ardupilot/master/Tools/ros2/ros2_macos.repos -vcs import --recursive < ros2_macos.repos -``` - -#### 3. Update dependencies - -```bash -cd ~/ros2_ws -source /{path_to_your_ros_distro_workspace}/install/setup.zsh -``` - -#### 4.1. Build microxrcedds_gen: - -```bash -cd ~/ros2_ws/src/microxrcedds_gen -./gradlew assemble -export PATH=$PATH:$(pwd)/scripts -``` - -#### 4.2. Build colcon projects - -```bash -colcon build --symlink-install --cmake-args \ --DBUILD_TESTING=ON \ --DCMAKE_BUILD_TYPE=RelWithDebInfo \ --DCMAKE_MACOSX_RPATH=FALSE \ --DUAGENT_SOCKETCAN_PROFILE=OFF \ --DUAGENT_LOGGER_PROFILE=OFF \ --DUAGENT_USE_SYSTEM_LOGGER=OFF \ --DUAGENT_USE_SYSTEM_FASTDDS=ON \ --DUAGENT_USE_SYSTEM_FASTCDR=ON \ ---event-handlers=desktop_notification- -``` - -#### 5. Test - -```bash -colcon test \ ---pytest-args -s -v \ ---event-handlers console_cohesion+ desktop_notification- \ ---packages-select ardupilot_dds_tests -``` - -## Install Docker - -#### 0. Build the image and run the container - -Clone the ArduPilot docker project: - -```bash -git clone https://github.com/ArduPilot/ardupilot_dev_docker.git -``` - -Build the container: - -```bash -cd ~/ardupilot_dev_docker/docker -docker build -t ardupilot/ardupilot-dev-ros -f Dockerfile_dev-ros . -``` - -Start the container in interactive mode: - -```bash -docker run -it --name ardupilot-dds ardupilot/ardupilot-dev-ros -``` - -Connect another bash process to the running container: - -```bash -docker container exec -it ardupilot-dds /bin/bash -``` - -The remaining steps 1 - 5 are the same as for Ubuntu. You may need to -install MAVProxy if it is not available on the container. - - -```bash -pip install -U MAVProxy -``` +Follow the installation instructions in the [ArduPilot Wiki](https://ardupilot.org/dev/docs/ros2.html) ## Test details