From df1c57486d5b0380bdb19900bd8c4c311258bcd3 Mon Sep 17 00:00:00 2001 From: Antonio cuadros Date: Tue, 11 May 2021 16:12:24 +0200 Subject: [PATCH] Set Micro XRCE-DDS RMW on tutorials --- _docs/tutorials/core/first_application_linux/index.md | 9 ++++++--- _docs/tutorials/core/zephyr_emulator/index.md | 2 +- _includes/first_application_common/build_system.md | 2 +- _includes/first_application_common/test_app_host.md | 6 +++--- _includes/first_application_common/test_app_rtos.md | 6 +++--- 5 files changed, 14 insertions(+), 11 deletions(-) diff --git a/_docs/tutorials/core/first_application_linux/index.md b/_docs/tutorials/core/first_application_linux/index.md index 8a573f0b..b1f57641 100644 --- a/_docs/tutorials/core/first_application_linux/index.md +++ b/_docs/tutorials/core/first_application_linux/index.md @@ -74,12 +74,15 @@ To give micro-ROS access to the ROS 2 dataspace, run the agent: ros2 run micro_ros_agent micro_ros_agent udp4 --port 8888 ``` -And then, in another command line, run the micro-ROS node (remember sourcing the ROS 2 and micro-ROS installations): +And then, in another command line, run the micro-ROS node (remember sourcing the ROS 2 and micro-ROS installations, and setting the RMW Micro XRCE-DDS implementation): ```bash -source /opt/ros/foxy/setup.bash +source /opt/ros/$ROS_DISTRO/setup.bash source install/local_setup.bash +# Use RMW Micro XRCE-DDS implementation +export RMW_IMPLEMENTATION=rmw_microxrcedds + # Run a micro-ROS node ros2 run micro_ros_demos_rclc ping_pong ``` @@ -96,7 +99,7 @@ each: ```bash cd microros_ws -source /opt/ros/foxy/setup.bash +source /opt/ros/$ROS_DISTRO/setup.bash source install/local_setup.bash ros2 run micro_ros_demos_rclc ping_pong diff --git a/_docs/tutorials/core/zephyr_emulator/index.md b/_docs/tutorials/core/zephyr_emulator/index.md index f2823c5f..b188b276 100644 --- a/_docs/tutorials/core/zephyr_emulator/index.md +++ b/_docs/tutorials/core/zephyr_emulator/index.md @@ -77,7 +77,7 @@ Finally, in order to run the micro-ROS node inside of the Zephyr RTOS emulator, open a new command shell and execute the flash step by means of the flashing command: ```bash -source /opt/ros/foxy/setup.bash +source /opt/ros/$ROS_DISTRO/setup.bash source install/local_setup.bash # Flash/run step diff --git a/_includes/first_application_common/build_system.md b/_includes/first_application_common/build_system.md index 8b2bbf6e..710f2d89 100644 --- a/_includes/first_application_common/build_system.md +++ b/_includes/first_application_common/build_system.md @@ -15,7 +15,7 @@ Once you have a ROS 2 installation in the computer, follow these steps to instal ```bash # Source the ROS 2 installation -source /opt/ros/foxy/setup.bash +source /opt/ros/$ROS_DISTRO/setup.bash # Create a workspace and download the micro-ROS tools mkdir microros_ws diff --git a/_includes/first_application_common/test_app_host.md b/_includes/first_application_common/test_app_host.md index bdedb098..42990dc7 100644 --- a/_includes/first_application_common/test_app_host.md +++ b/_includes/first_application_common/test_app_host.md @@ -6,7 +6,7 @@ Open a new command line. We are going to listen to the `ping` topic with ROS 2 to check whether the micro-ROS Ping Pong node is correctly publishing the expected pings: ```bash -source /opt/ros/foxy/setup.bash +source /opt/ros/$ROS_DISTRO/setup.bash # Subscribe to micro-ROS ping topic ros2 topic echo /microROS/ping @@ -35,7 +35,7 @@ So, first of all, let's subscribe with ROS 2 to the `pong` topic from a new shel (notice that initially we don't expect to receive any pong, since none has been sent yet): ```bash -source /opt/ros/foxy/setup.bash +source /opt/ros/$ROS_DISTRO/setup.bash # Subscribe to micro-ROS pong topic ros2 topic echo /microROS/pong @@ -44,7 +44,7 @@ ros2 topic echo /microROS/pong And now, let's publish a `fake_ping` with ROS 2 from yet another command line: ```bash -source /opt/ros/foxy/setup.bash +source /opt/ros/$ROS_DISTRO/setup.bash # Send a fake ping ros2 topic pub --once /microROS/ping std_msgs/msg/Header '{frame_id: "fake_ping"}' diff --git a/_includes/first_application_common/test_app_rtos.md b/_includes/first_application_common/test_app_rtos.md index 30b49982..bcd733f0 100644 --- a/_includes/first_application_common/test_app_rtos.md +++ b/_includes/first_application_common/test_app_rtos.md @@ -7,7 +7,7 @@ Open a new command line. We are going to listen to the `ping` topic with ROS 2 to check whether the micro-ROS Ping Pong node is correctly publishing the expected pings: ```bash -source /opt/ros/foxy/setup.bash +source /opt/ros/$ROS_DISTRO/setup.bash # Subscribe to micro-ROS ping topic ros2 topic echo /microROS/ping @@ -36,7 +36,7 @@ So, first of all, let's subscribe with ROS 2 to the `pong` topic from a new shel (notice that initially we don't expect to receive any pong, since none has been sent yet): ```bash -source /opt/ros/foxy/setup.bash +source /opt/ros/$ROS_DISTRO/setup.bash # Subscribe to micro-ROS pong topic ros2 topic echo /microROS/pong @@ -45,7 +45,7 @@ ros2 topic echo /microROS/pong And now, let's publish a `fake_ping` with ROS 2 from yet another command line: ```bash -source /opt/ros/foxy/setup.bash +source /opt/ros/$ROS_DISTRO/setup.bash # Send a fake ping ros2 topic pub --once /microROS/ping std_msgs/msg/Header '{frame_id: "fake_ping"}'