From b004096c8e9f6ccbed986de6641a2be2309b18f8 Mon Sep 17 00:00:00 2001 From: Borja Outerelo Date: Sat, 17 Nov 2018 21:07:21 +0100 Subject: [PATCH] Release v0.0.1-alpha (#7) * Updates missing links. (#3) * Refs #3788. Updates missing links. * Refs #3788. Updates wrong names. * Refs #3788. Removes not needed background execution. * Windows build issue fix (#4) * Feature/doc update (#6) * Updated demo steps * Fixed demo sentence (Linux) * Update content * Updated doc for a split client-Agent work spaces * Update README.md Co-Authored-By: qeyup <42214121+qeyup@users.noreply.github.com> * Update README.md Co-Authored-By: qeyup <42214121+qeyup@users.noreply.github.com> * Update README.md Co-Authored-By: qeyup <42214121+qeyup@users.noreply.github.com> * Update README.md Co-Authored-By: qeyup <42214121+qeyup@users.noreply.github.com> * Update README.md Co-Authored-By: qeyup <42214121+qeyup@users.noreply.github.com> * Update README.md Co-Authored-By: qeyup <42214121+qeyup@users.noreply.github.com> * Update README.md Co-Authored-By: qeyup <42214121+qeyup@users.noreply.github.com> * Update README.md Co-Authored-By: qeyup <42214121+qeyup@users.noreply.github.com> * Update README.md Co-Authored-By: qeyup <42214121+qeyup@users.noreply.github.com> * Update README.md Co-Authored-By: qeyup <42214121+qeyup@users.noreply.github.com> * Update README.md Co-Authored-By: qeyup <42214121+qeyup@users.noreply.github.com> * Update README.md Co-Authored-By: qeyup <42214121+qeyup@users.noreply.github.com> * Update README.md Co-Authored-By: qeyup <42214121+qeyup@users.noreply.github.com> * Update README.md Co-Authored-By: qeyup <42214121+qeyup@users.noreply.github.com> * Update README.md Co-Authored-By: qeyup <42214121+qeyup@users.noreply.github.com> * Update README.md Co-Authored-By: qeyup <42214121+qeyup@users.noreply.github.com> * Update README.md Co-Authored-By: qeyup <42214121+qeyup@users.noreply.github.com> * Update README.md Co-Authored-By: qeyup <42214121+qeyup@users.noreply.github.com> * Update README.md Co-Authored-By: qeyup <42214121+qeyup@users.noreply.github.com> * Update README.md Co-Authored-By: qeyup <42214121+qeyup@users.noreply.github.com> * Update README.md Co-Authored-By: qeyup <42214121+qeyup@users.noreply.github.com> * Update README.md Co-Authored-By: qeyup <42214121+qeyup@users.noreply.github.com> --- C/RAD0_altitude_sensor/CMakeLists.txt | 4 +- README.md | 250 +++++++++++++++----------- 2 files changed, 151 insertions(+), 103 deletions(-) diff --git a/C/RAD0_altitude_sensor/CMakeLists.txt b/C/RAD0_altitude_sensor/CMakeLists.txt index cd2e370..ea2b6e7 100644 --- a/C/RAD0_altitude_sensor/CMakeLists.txt +++ b/C/RAD0_altitude_sensor/CMakeLists.txt @@ -16,7 +16,9 @@ endif() add_executable(${PROJECT_NAME} main.c) ament_target_dependencies(${PROJECT_NAME} rclc std_msgs) -target_link_libraries(${PROJECT_NAME} m) +if(NOT WIN32) + target_link_libraries(${PROJECT_NAME} m) +endif() install(TARGETS ${PROJECT_NAME} diff --git a/README.md b/README.md index 1129cf1..3101e07 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,11 @@ The primary purpose for this repository is to organise all packages for the [Micro-ROS project](https://microros.github.io/micro-ROS/) functionalities demonstrations. All packages contained in this repository are a part of the Micro-ROS project stack. -For more information about Micro-ROS project click [here](https://microros.github.io/micro-ROS/). + +## Previous step + +To run all the demonstrations, you need to set up the ROS2 environment and build all the required packages. +Click [here](https://github.com/microROS/micro-ROS-doc) to read further about how to do this previous step. ## Package clusters @@ -16,130 +20,153 @@ The repository contains the below packages clusters: ##### Int32_publisher -The purpose of the package is to publish one of the most basic ROS 2 messages and demonstrate how Micro-ROS layers (rcl, typesupport and rmw) handle it. +The purpose of the package is to publish one of the most basic ROS2 messages and demonstrate how Micro-ROS layers (rcl, typesupport and rmw) handle it. For each publication, the message value increases in one unit order to see in the subscriber side the message variations. ##### Int32_subscriber -The purpose of the package is to subscribe to one of the most basic ROS 2 messages and demonstrate how Micro-ROS layers (rcl, typesupport and rmw) handle it. +The purpose of the package is to subscribe to one of the most basic ROS2 messages and demonstrate how Micro-ROS layers (rcl, typesupport and rmw) handle it. -#### Run demonstration +#### Run demonstration (Linux) -To run the demonstration, as a first step, you have to build all the required packages in a Micro-ROS workspace. -To read further about how to build the Micro-ROS workspace click [here](). +Run the micro-ROS Agent. +For the micro-ROS Agent to find the XML reference file, the execution must be done from the executable folder. ```bash -cd ~/ros2_ws -colcon build --cmake-args -DBUILD_SHARED_LIBS=ON --packages-up-to int32_publisher int32_subscriber uros_agent +cd ~/agent_ws/install/uros_agent/lib/uros_agent/ +./uros_agent udp 8888 ``` -Configure the environment +You may prefer to run the Agent in the background and discard all outputs to keep using the same terminal for the next step. ```bash -. ~/ros2_ws/install/local_setup.bash +cd ~/agent_ws/install/uros_agent/lib/uros_agent/ +./uros_agent udp 8888 > /dev/null & ``` -Run the Micro XRCE-DDS Agent +Run the publisher. ```bash -cd ~/ros2_ws/install/microxrcedds_agent/bin -./MicroXRCEAgent udp 8888 +~/client_ws/install/int32_publisher_c/lib/int32_publisher_c/./int32_publisher_c ``` -You may prefer to run the Agent in the background and discard all outputs to keep using the same terminal for the next step. +You may prefer to run the publisher in the background and discard all outputs to keep using the terminal for the next step. ```bash -cd ~/ros2_ws/install/microxrcedds_agent/bin -./MicroXRCEAgent udp 8888 > /dev/null & + ~/client_ws/install/int32_publisher_c/lib/int32_publisher_c/./int32_publisher_c > /dev/null & ``` -Run the publisher. +Run the subscriber. ```bash - ~/ros2_ws/install/int32_publisher/lib/int32_publisher/./int32_publisher +~/client_ws/install/int32_subscriber_c/lib/int32_subscriber_c/./int32_subscriber_c ``` -You may prefer to run the publisher in the background and discard all outputs to keep using the terminal for the next step. +#### Run demonstration (Windows) + +Run the micro-ROS Agent. +For the micro-ROS Agent to find the XML reference file, the execution must be done from the executable folder. + +```bash +cd C:\A\install\Lib\uros_agent\ +uros_agent.exe udp 8888 +``` + +Run the publisher. ```bash - ~/ros2_ws/install/int32_publisher/lib/int32_publisher/./int32_publisher > /dev/null & +cd C:\C\install\Lib\int32_publisher_c\ +int32_publisher_c.exe ``` Run the subscriber. ```bash -~/ros2_ws/install/int32_subscriber/lib/int32_subscriber/./int32_subscriber +cd C:\C\install\Lib\int32_subscriber_c\ +int32_subscriber_c.exe ``` + ### String message demonstration -#### Packages +#### String packages -##### string_publisher +##### String_publisher -The purpose of the package is to publish a simple string ROS 2 message and demonstrate how Micro-ROS layers (rcl, typesupport and rmw) handle it. +The purpose of the package is to publish a simple string ROS2 message and demonstrate how Micro-ROS layers (rcl, typesupport and rmw) handle it. For each publication, the message string number increases in one unit order to see in the subscriber side the message variations. ##### String_subscriber -The purpose of the package is to subscribe to a simple string ROS 2 message and demonstrate how Micro-ROS layers (rcl, typesupport and rmw) handle it. +The purpose of the package is to subscribe to a simple string ROS2 message and demonstrate how Micro-ROS layers (rcl, typesupport and rmw) handle it. -#### Run demonstration +#### Run string demonstration (Linux) -To run the demonstration, as a first step, you have to build all the required packages in a Micro-ROS workspace. -To read further about how to build the Micro-ROS workspace click [here](). +Run the micro-ROS Agent. +For the micro-ROS Agent to find the XML reference file, the execution must be done from the executable folder. ```bash -cd ~/ros2_ws -colcon build --cmake-args -DBUILD_SHARED_LIBS=ON --packages-up-to string_publisher string_subscriber uros_agent +cd ~/agent_ws/install/uros_agent/lib/uros_agent/ +./uros_agent udp 8888 ``` -Configure the environment +You may prefer to run the Agent in the background and discard all outputs to keep using the same terminal for the next step. ```bash -. ~/ros2_ws/install/local_setup.bash +cd ~/agent_ws/install/uros_agent/lib/uros_agent/ +./uros_agent udp 8888 > /dev/null & ``` -Run the Micro XRCE-DDS Agent +Run the publisher. ```bash -cd ~/ros2_ws/install/microxrcedds_agent/bin -./MicroXRCEAgent udp 8888 + ~/client_ws/install/string_publisher_c/lib/string_publisher_c/./string_publisher_c ``` -You may prefer to run the Agent in the background and discard all outputs to keep using the same terminal for the next step. +You may prefer to run the publisher in the background and discard all outputs in order to keep using the terminal for the next step. ```bash -cd ~/ros2_ws/install/microxrcedds_agent/bin -./MicroXRCEAgent udp 8888 > /dev/null & + ~/client_ws/install/string_publisher_c/lib/string_publisher_c/./string_publisher_c > /dev/null & ``` -Run the publisher. +Run the subscriber. + +```bash +~/client_ws/install/string_subscriber_c/lib/string_subscriber_c/./string_subscriber_c +``` + +#### Run string demonstration (Windows) + +Run the micro-ROS Agent. +For the micro-ROS Agent to find the XML reference file, the execution must be done from the executable folder. ```bash - ~/ros2_ws/install/string_publisher/lib/string_publisher/./string_publisher +cd C:\A\install\Lib\uros_agent\ +uros_agent.exe udp 8888 ``` -You may prefer to run the publisher in the background and discard all outputs in order still using the terminal for the next step. +Run the publisher. ```bash - ~/ros2_ws/install/string_publisher/lib/string_publisher/./string_publisher > /dev/null & +cd C:\C\install\Lib\string_publisher_c\ +string_publisher_c.exe ``` Run the subscriber. ```bash -~/ros2_ws/install/string_subscriber/lib/string_subscriber/./string_subscriber +cd C:\C\install\Lib\string_subscriber_c\ +string_subscriber_c.exe ``` ### Complex message demonstration -#### Packages +#### Complex packages ##### complex_msg One of the purposes of the package is to demonstrate how typesupport code is generated for a complex message. -Also, the generation of a complex ROS 2 structure message is used to demonstrate how the different layers (rcl, typesupport and rmw) handle it. +Also, the generation of a complex ROS2 structure message is used to demonstrate how the different layers (rcl, typesupport and rmw) handle it. The message structure contains the following types: - All primitive data types. @@ -148,70 +175,80 @@ The message structure contains the following types: ##### Complex_msg_publisher -The purpose of the package is to publish a complex ROS 2 message and demonstrate how Micro-ROS layers (rcl, typesupport and rmw) handle it. +The purpose of the package is to publish a complex ROS2 message and demonstrate how Micro-ROS layers (rcl, typesupport and rmw) handle it. For each publication, the message values increases in one unit order to see in the subscriber side the message variations. ##### Complex_msg_subscriber -The purpose of the package is to subscribe to a complex ROS 2 message and demonstrate how Micro-ROS layers (rcl, typesupport and rmw) handle it. +The purpose of the package is to subscribe to a complex ROS2 message and demonstrate how Micro-ROS layers (rcl, typesupport and rmw) handle it. + +#### Run complex demonstration (Linux) -#### Run demonstration -To run the demonstration, as a first step, you have to build all the required packages in a Micro-ROS workspace. -To read further about how to build the Micro-ROS workspace click [here](). +Run the micro-ROS Agent ```bash -cd ~/ros2_ws -colcon build --cmake-args -DBUILD_SHARED_LIBS=ON --packages-up-to complex_msgs complex_msg_publisher complex_msg_subscriber uros_agent +cd ~/agent_ws/install/uros_agent/lib/uros_agent/ +./uros_agent udp 8888 ``` -Configure the environment +You may prefer to run the Agent in the background and discard all outputs to keep using the same terminal for the next step. ```bash -. ~/ros2_ws/install/local_setup.bash +cd ~/agent_ws/install/uros_agent/lib/uros_agent/ +./uros_agent udp 8888 > /dev/null & ``` -Run the Micro XRCE-DDS Agent +Run the publisher. ```bash -cd ~/ros2_ws/install/microxrcedds_agent/bin -./MicroXRCEAgent udp 8888 + ~/client_ws/install/complex_msg_publisher_c/lib/complex_msg_publisher_c/./complex_msg_publisher_c ``` You may prefer to run the Agent in the background and discard all outputs to keep using the same terminal for the next step. ```bash -cd ~/ros2_ws/install/microxrcedds_agent/bin -./MicroXRCEAgent udp 8888 > /dev/null & + ~/client_ws/install/complex_msg_publisher_c/lib/complex_msg_publisher_c/./complex_msg_publisher_c > /dev/null & ``` -Run the publisher. +Run the subscriber. ```bash - ~/ros2_ws/install/complex_msg_publisher/lib/complex_msg_publisher/./complex_msg_publisher +~/client_ws/install/complex_msg_subscriber_c/lib/complex_msg_subscriber_c/./complex_msg_subscriber_c ``` -You may prefer to run the Agent in the background and discard all outputs to keep using the same terminal for the next step. +#### Run complex demonstration (Windows) + +Run the micro-ROS Agent. +For the micro-ROS Agent to find the XML reference file, the execution must be done from the executable folder. + +```bash +cd C:\A\install\Lib\uros_agent\ +uros_agent.exe udp 8888 +``` + +Run the publisher. ```bash - ~/ros2_ws/install/complex_msg_publisher/lib/complex_msg_publisher/./complex_msg_publisher > /dev/null & +cd C:\C\install\Lib\complex_msg_publisher_c\ +complex_msg_publisher_c.exe ``` Run the subscriber. ```bash -~/ros2_ws/install/complex_msg_subscriber/lib/complex_msg_subscriber/./complex_msg_subscriber +cd C:\C\install\Lib\complex_msg_subscriber_c\ +complex_msg_subscriber_c.exe ``` + ### Real application demonstration This purpose of the packages is to demonstrate Micro-ROS stack can be used in a real application scenario. In this demonstration, an altitude control system is simulated. -The primary purpose of this is to see how Micro-ROS communicates with ROS 2 nodes. +The primary purpose of this is to demonstrate how Micro-ROS communicates with ROS2 nodes. -For further information about this demonstration click [here]() - -#### Packages +#### Real application packages ##### rad0_actuator @@ -239,7 +276,7 @@ The mission of this node is to read altitude values and send to the actuator eng It also publishes the status (OK, WARNING or FAILURE) as a DDS topic. The status depends on the altitude value. -The node is built using the ROS 2 middleware packages (rmw_fastrtps and rosidl_typesupport_fastrtps). +The node is built using the ROS2 middleware packages (rmw_fastrtps and rosidl_typesupport_fastrtps). It is meant to be running in on a regular PC, and it is directly connected to de DDS world. @@ -253,88 +290,97 @@ The node is built using the Micro-ROS middleware packages (rmw_micro_xrcedds and It is meant to be running in a microcontroller processor, but for this demonstration, the node runs on the host PC. The node is connected to the DDS world through a Micro XRCE-DDS Agent. -#### Run demonstration - -Note: For this demonstration, you need at least two open terminals, one for the Micro-ROS workspace and the other for the ROS 2 workspace. +#### Run real application demonstration (Linux) ##### Micro-ROS nodes -To run the demonstration, as a first step, you have to build all the required packages in a Micro-ROS workspace. -To read further about how to build the Micro-ROS workspace click [here](). +Run the micro-ROS Agent. +For the micro-ROS Agent to find the XML reference file, the execution must be done from the executable folder. ```bash -cd ~/ros2_ws -colcon build --cmake-args -DBUILD_SHARED_LIBS=ON --packages-up-to rad0_actuator rad0_display rad0_altitude_sensor uros_agent +cd ~/uros_WS/install/uros_agent/lib/uros_agent/ +./uros_agent udp 8888 ``` -Configure the environment +You may prefer to run the Agent in the background and discard all outputs to keep using the same terminal for the next step. ```bash -. ~/ros2_ws/install/local_setup.bash +cd ~/uros_WS/install/uros_agent/lib/uros_agent/ +./uros_agent udp 8888 > /dev/null & ``` -Run the Micro XRCE-DDS Agent +Run the altitude_sensor node. ```bash -cd ~/ros2_ws/install/microxrcedds_agent/bin -./MicroXRCEAgent udp 8888 +~/client_ws/install/rad0_altitude_sensor_c/lib/rad0_altitude_sensor_c/./rad0_altitude_sensor_c ``` -You may prefer to run the Agent in the background and discard all outputs to keep using the same terminal for the next steps. +You may prefer to run the publisher in the background and discard all outputs to keep using the terminal for the next steps. ```bash -cd ~/ros2_ws/install/microxrcedds_agent/bin -./MicroXRCEAgent udp 8888 > /dev/null & +~/client_ws/install/rad0_altitude_sensor_c/lib/rad0_altitude_sensor_c/./rad0_altitude_sensor_c > /dev/null & ``` -Run the altitude_sensor node. +Run the actuator node. ```bash - ~/ros2_ws/install/rad0_altitude_sensor/lib/rad0_altitude_sensor/./rad0_altitude_sensor + ~/client_ws/install/rad0_actuator_c/lib/rad0_actuator_c/./rad0_actuator_c ``` You may prefer to run the publisher in the background and discard all outputs to keep using the terminal for the next steps. ```bash - ~/ros2_ws/install/rad0_altitude_sensor/lib/rad0_altitude_sensor/./rad0_altitude_sensor > /dev/null & + ~/client_ws/install/rad0_actuator_c/lib/rad0_actuator_c/./rad0_actuator_c > /dev/null & ``` -Run the actuator node. +Run the display node. ```bash - ~/ros2_ws/install/rad0_actuator/lib/rad0_actuator/./rad0_actuator +~/client_ws/install/rad0_display_c/lib/rad0_display_c/./rad0_display_c ``` -You may prefer to run the publisher in the background and discard all outputs to keep using the terminal for the next steps. +##### ROS2 nodes ```bash - ~/ros2_ws/install/rad0_actuator/lib/rad0_actuator/./rad0_actuator > /dev/null & +~/agent_ws/install/rad0_display_c/lib/rad0_display_c/./rad0_display_c ``` -Run the display node. +#### Run real application demonstration (Windows) + +##### Micro-ROS nodes + +Run the micro-ROS Agent. +For the micro-ROS Agent to find the XML reference file, the execution must be done from the executable folder. ```bash -~/ros2_ws/install/rad0_display/lib/rad0_display/./rad0_display +cd C:\A\install\Lib\uros_agent\ +uros_agent.exe udp 8888 ``` -##### ROS 2 nodes - -To run the demonstration, you have first to build all required packages in a ROS 2 workspace. -To read further about how to build the ROS 2 workspace click [here](). +Run the altitude_sensor node. ```bash -cd ~/ros2_ws -colcon build --packages-up-to rad0_control +cd C:\C\install\Lib\rad0_altitude_sensor_c +rad0_altitude_sensor_c.exe ``` -Configure the environment +Run the actuator node. ```bash -. ~/ros2_ws/install/local_setup.bash +cd C:\C\install\Lib\rad0_actuator_c +rad0_actuator_c.exe ``` Run the display node. ```bash -ros2 run control control & +cd C:\C\install\Lib\rad0_display_c\ +rad0_display_c.exe +``` + +##### ROS2 nodes + +```bash +cd C:\A\install\Lib\rad0_control_cpp\ +rad0_control_cpp.exe ```