From 4882a32b3940c4136d0108df49b90234ae5b0d8a Mon Sep 17 00:00:00 2001 From: Pablo Garrido Date: Tue, 24 Mar 2020 13:07:31 +0100 Subject: [PATCH 1/9] Initial tutorial Update Update --- .../linux/linux_getting_started/index.md | 387 ++++++++++++++++++ 1 file changed, 387 insertions(+) create mode 100644 _docs/tutorials/advanced/linux/linux_getting_started/index.md diff --git a/_docs/tutorials/advanced/linux/linux_getting_started/index.md b/_docs/tutorials/advanced/linux/linux_getting_started/index.md new file mode 100644 index 00000000..e9b807b0 --- /dev/null +++ b/_docs/tutorials/advanced/linux/linux_getting_started/index.md @@ -0,0 +1,387 @@ +--- +title: Linux Getting Started +permalink: /docs/tutorials/advanced/linux/linux_getting_started/ +--- + +This tutorial aims to create a new micro-ROS application on Linux for testing purposes. + +## Adding a new micro-ROS app + +First of all, make sure that you have a **ROS 2** installation. + +***TIP:** if you are familiar with Docker containers, this image may be useful: [ros:dashing](https://hub.docker.com/layers/ros/library/ros/dashing/images/sha256-b796c14ea663537129897769aa6c715a851ca08dffd4875ef2ecaa31a4dbd431?context=explore)* + +On the **ROS 2** installation open a command line and follow these steps: + +```bash +# Source the ROS 2 installation +source /opt/ros/$ROS_DISTRO/setup.bash + +# Create a workspace and download the micro-ROS tools +mkdir microros_ws +cd microros_ws +git clone -b $ROS_DISTRO https://github.com/micro-ROS/micro-ros-build.git src/micro-ros-build + +# Update dependencies using rosdep +rosdep update +rosdep install --from-path src --ignore-src -y + +# Build micro-ROS tools and source them +colcon build +source install/local_setup.bash +``` + +Now, let's create a firmware workspace that targets all the required code and tools: + +```bash +# Create step +ros2 run micro_ros_setup create_firmware_ws.sh host +``` + +Now you have all the required tools to build micro-ROS. At this point, you must know that the micro-ROS build system is a four-step workflow: + + +1. **Create**: retrieves all the required packages for a specific RTOS and hardware platform. +2. **Configure**: configures the downloaded packages with options such as the micro-ROS application, the selected transport layer or the micro-ROS agent IP address (in network transports). +3. **Build**: generates a binary file ready for being loaded in the hardware. +4. **Flash**: load the micro-ROS software in the hardware. + +micro-ROS apps for Linux are located at `src/uros/micro-ROS-demos/rcl/`. In order to create a new application, create a new folder containing two files: the app code and the CMake file. + +```bash +# Creating a new app +pushd src/uros/micro-ROS-demos/rcl/ +mkdir my_brand_new_app +cd my_brand_new_app +touch app.c CMakeLists.cmake +popd +``` + +For this example we are going to create a ping pong app where a node sends a ping package with a unique identifier using a publisher and the same package is received by a pong subscriber. The node will also answer to: + +![pingpong](http://www.plantuml.com/plantuml/png/ZOwnIWGn48RxFCNFzSkoUG2vqce5jHEHi1dtWZkPa6GByNntavZY10yknMJu-ORlFwPiOjvvK-d3-M2YOR1uMKvHc93ZJafvoMML07d7h1NAE-DPWblg_na8vnwEx9OeZmzFOt1-BK7AzetJciPxCfRYVw1S0SbRLBEg1IpXPIvpUWLCmZpXIm6BS3addt7uQpu0ZQlxT1MK2r0g-7sfqbsbRrVfMrMwgbev3CDTlsqJGtJhATUmSMrMg5TKwaZUxfcttuMt7m00) + +To start creating this app, the `CMakeLists.cmake` file should looks like: + +```cmake +cmake_minimum_required(VERSION 3.5) + +project(my_brand_new_app LANGUAGES C) + +find_package(ament_cmake REQUIRED) +find_package(rcl REQUIRED) +find_package(std_msgs REQUIRED) +find_package(rmw_microxrcedds REQUIRED) + +add_executable(${PROJECT_NAME} app.c) + +ament_target_dependencies(${PROJECT_NAME} + rcl + std_msgs + rmw_microxrcedds + ) + +install(TARGETS ${PROJECT_NAME} + DESTINATION ${PROJECT_NAME} + ) +``` + +Meanwhile `app.c` should look like the following code: + +```c +#include +#include +#include + +#include + +#include +#include +#include + +#define STRING_BUFFER_LEN 100 + +// Publishing ping guard condition thread +void * trigger_guard_condition(void *args){ + rcl_guard_condition_t * guard_condition = (rcl_guard_condition_t *)args; + + while(true){ + rcl_trigger_guard_condition(guard_condition); + sleep(5); + } +} + +int main(int argc, const char * const * argv) +{ + //Init RCL options + rcl_init_options_t options = rcl_get_zero_initialized_init_options(); + rcl_init_options_init(&options, rcl_get_default_allocator()); + + // Init RCL context + rcl_context_t context = rcl_get_zero_initialized_context(); + rcl_init(0, NULL, &options, &context); + + // Create a node + rcl_node_options_t node_ops = rcl_node_get_default_options(); + rcl_node_t node = rcl_get_zero_initialized_node(); + rcl_node_init(&node, "pingpong_node", "", &context, &node_ops); + + // Create a reliable ping publisher + rcl_publisher_options_t ping_publisher_ops = rcl_publisher_get_default_options(); + rcl_publisher_t ping_publisher = rcl_get_zero_initialized_publisher(); + rcl_publisher_init(&ping_publisher, &node, ROSIDL_GET_MSG_TYPE_SUPPORT(std_msgs, msg, Header), "/microROS/ping", &ping_publisher_ops); + + // Create a best effort pong publisher + rcl_publisher_options_t pong_publisher_ops = rcl_publisher_get_default_options(); + pong_publisher_ops.qos.reliability = RMW_QOS_POLICY_RELIABILITY_BEST_EFFORT; + rcl_publisher_t pong_publisher = rcl_get_zero_initialized_publisher(); + rcl_publisher_init(&pong_publisher, &node, ROSIDL_GET_MSG_TYPE_SUPPORT(std_msgs, msg, Header), "/microROS/pong", &pong_publisher_ops); + + // Create a best effort pong subscriber + rcl_subscription_options_t pong_subscription_ops = rcl_subscription_get_default_options(); + pong_subscription_ops.qos.reliability = RMW_QOS_POLICY_RELIABILITY_BEST_EFFORT; + rcl_subscription_t pong_subscription = rcl_get_zero_initialized_subscription(); + rcl_subscription_init(&pong_subscription, &node, ROSIDL_GET_MSG_TYPE_SUPPORT(std_msgs, msg, Header), "/microROS/pong", &pong_subscription_ops); + + // Create a best effort ping subscriber + rcl_subscription_options_t ping_subscription_ops = rcl_subscription_get_default_options(); + ping_subscription_ops.qos.reliability = RMW_QOS_POLICY_RELIABILITY_BEST_EFFORT; + rcl_subscription_t ping_subscription = rcl_get_zero_initialized_subscription(); + rcl_subscription_init(&ping_subscription, &node, ROSIDL_GET_MSG_TYPE_SUPPORT(std_msgs, msg, Header), "/microROS/ping", &ping_subscription_ops); + + // Create guard condition + rcl_guard_condition_t guard_condition = rcl_get_zero_initialized_guard_condition(); + rcl_guard_condition_options_t guard_condition_options = rcl_guard_condition_get_default_options(); + rcl_guard_condition_init(&guard_condition, &context, guard_condition_options); + + pthread_t guard_condition_thread; + pthread_create(&guard_condition_thread, NULL, trigger_guard_condition, &guard_condition); + + // Create a wait set + rcl_wait_set_t wait_set = rcl_get_zero_initialized_wait_set(); + rcl_wait_set_init(&wait_set, 2, 1, 0, 0, 0, 0, &context, rcl_get_default_allocator()); + + // Create and allocate the pingpong publication message + std_msgs__msg__Header msg; + char msg_buffer[STRING_BUFFER_LEN]; + msg.frame_id.data = msg_buffer; + msg.frame_id.capacity = STRING_BUFFER_LEN; + + // Create and allocate the pingpong subscription message + std_msgs__msg__Header rcv_msg; + char rcv_buffer[STRING_BUFFER_LEN]; + rcv_msg.frame_id.data = rcv_buffer; + rcv_msg.frame_id.capacity = STRING_BUFFER_LEN; + + // Set device id and sequence number; + int device_id = rand(); + int seq_no; + + int pong_count = 0; + struct timespec ts; + rcl_ret_t rc; + + do { + // Clear and set the waitset + rcl_wait_set_clear(&wait_set); + + size_t index_pong_subscription; + rcl_wait_set_add_subscription(&wait_set, &pong_subscription, &index_pong_subscription); + + size_t index_ping_subscription; + rcl_wait_set_add_subscription(&wait_set, &ping_subscription, &index_ping_subscription); + + size_t index_guardcondition; + rcl_wait_set_add_guard_condition(&wait_set, &guard_condition, &index_guardcondition); + + // Run session for 100 ms + rcl_wait(&wait_set, RCL_MS_TO_NS(100)); + + // Check if some pong message is received + if (wait_set.subscriptions[index_pong_subscription]) { + rc = rcl_take(wait_set.subscriptions[index_pong_subscription], &rcv_msg, NULL, NULL); + if(rc == RCL_RET_OK && strcmp(msg.frame_id.data,rcv_msg.frame_id.data) == 0) { + pong_count++; + printf("Pong for seq %s (%d)\n", rcv_msg.frame_id.data, pong_count); + } + } + + // Check if some ping message is received and pong it + if (wait_set.subscriptions[index_ping_subscription]) { + rc = rcl_take(wait_set.subscriptions[index_ping_subscription], &rcv_msg, NULL, NULL); + + // Dont pong my own pings + if(rc == RCL_RET_OK && strcmp(msg.frame_id.data,rcv_msg.frame_id.data) != 0){ + printf("Ping received with seq %s. Answering.\n", rcv_msg.frame_id.data); + rcl_publish(&pong_publisher, (const void*)&rcv_msg, NULL); + } + } + + // Check if it is time to send a ping + if (wait_set.guard_conditions[index_guardcondition]) { + // Generate a new random sequence number + seq_no = rand(); + sprintf(msg.frame_id.data, "%d_%d", seq_no, device_id); + msg.frame_id.size = strlen(msg.frame_id.data); + + // Fill the message timestamp + clock_gettime(CLOCK_REALTIME, &ts); + msg.stamp.sec = ts.tv_sec; + msg.stamp.nanosec = ts.tv_nsec; + + // Reset the pong count and publish the ping message + pong_count = 0; + rcl_publish(&ping_publisher, (const void*)&msg, NULL); + printf("Ping send seq %s\n", msg.frame_id.data); + } + + usleep(10000); + } while (true); +} +``` + +Don't forget to register your app in `src/uros/micro-ROS-demos/rcl/CMakeLists.txt` by adding the following line: + +``` +export_executable(my_brand_new_app) +``` + +When the configuring step ends, just build the firmware: + +```bash +# Build step +ros2 run micro_ros_setup build_firmware.sh +``` + +## Running the micro-ROS app + +The micro-ROS app is ready to connect to a micro-ROS-Agent and start talking with the rest of the ROS 2 world. + +First of all, create and build a micro-ROS agent: + +```bash +# Download micro-ROS-Agent packages +ros2 run micro_ros_setup create_agent_ws.sh + +# Build micro-ROS-Agent packages, this may take a while. +# Build micro-ROS-Agent packages, this may take a while. +colcon build --metas src +source install/local_setup.bash +``` + +Then run the agent: + +```bash +# Run a micro-ROS agent +ros2 run micro_ros_agent micro_ros_agent udp4 --port 8888 +``` + +Then run the app: + +```bash +# Run a micro-ROS agent +ros2 run micro_ros_demos_rcl my_brand_new_app +``` + +And finally, let's check that everything is working. We are going to listen to ping topic to check whether the Ping Pong node is publishing its own pings + +```bash +# Subscribe to micro-ROS ping topic +ros2 topic echo /microROS/ping +``` + +You should see the topic messages published by the Ping Pong node every 5 seconds: + +``` +pgarrido@pgarrido:~$ ros2 topic echo /microROS/ping +stamp: + sec: 20 + nanosec: 867000000 +frame_id: '1344887256_1085377743' +--- +stamp: + sec: 25 + nanosec: 942000000 +frame_id: '730417256_1085377743' +--- +``` + +On another command line, let's subscribe to the pong topic + +```bash +# Subscribe to micro-ROS pong topic +ros2 topic echo /microROS/pong +``` + +At this point, we know that our app is publishing pings. Let's check if it also answers to someone else pings: + +```bash +# Send a fake ping +ros2 topic pub --once /microROS/ping std_msgs/msg/Header '{frame_id: "fake_ping"}' +``` + +Now, we should see on the ping subscriber our fake ping along with the board pings: + +``` +pgarrido@pgarrido:~$ ros2 topic echo /microROS/ping +stamp: + sec: 0 + nanosec: 0 +frame_id: fake_ping +--- +stamp: + sec: 305 + nanosec: 973000000 +frame_id: '451230256_1085377743' +--- +stamp: + sec: 310 + nanosec: 957000000 +frame_id: '2084670932_1085377743' +--- +``` + +And in the pong subscriber, we should see the board's answer to our fake ping: + +``` +pgarrido@pgarrido:~$ ros2 topic echo /microROS/pong +stamp: + sec: 0 + nanosec: 0 +frame_id: fake_ping +--- +``` + + +## Multiple Ping Pong nodes + +One of the advantages of having an Linux micro-ROS app is that you don't need to buy a bunch of hardware in order to test some multi-node micro-ROS apps. So, with the same micro-ROS agent of the last section, let's open four different command lines and run the following on each: + +```bash +cd microros_ws + +source /opt/ros/$ROS_DISTRO/setup.bash +source install/local_setup.bash + +ros2 run micro_ros_demos_rcl my_brand_new_app +``` + +As soon as all micro-ROS node are up and connected to the micro-ROS agent you will see them interacting: + +``` +pgarrido@pgarrido$ ros2 run micro_ros_demos_rcl my_brand_new_app +UDP mode => ip: 127.0.0.1 - port: 8888 +Ping send seq 1711620172_1742614911 <---- This micro-ROS node sends a ping with ping ID "1711620172" and node ID "1742614911" +Pong for seq 1711620172_1742614911 (1) <---- The first mate pongs my ping +Pong for seq 1711620172_1742614911 (2) <---- The second mate pongs my ping +Pong for seq 1711620172_1742614911 (3) <---- The third mate pongs my ping +Ping received with seq 1845948271_546591567. Answering. <---- A ping is received from a mate identified as "546591567", let's pong it. +Ping received with seq 232977719_1681483056. Answering. <---- A ping is received from a mate identified as "1681483056", let's pong it. +Ping received with seq 1134264528_1107823050. Answering. <---- A ping is received from a mate identified as "1107823050", let's pong it. +Ping send seq 324239260_1742614911 +Pong for seq 324239260_1742614911 (1) +Pong for seq 324239260_1742614911 (2) +Pong for seq 324239260_1742614911 (3) +Ping received with seq 1435780593_546591567. Answering. +Ping received with seq 2034268578_1681483056. Answering. +``` \ No newline at end of file From 1ec8414485cd9461ca6fffb4c2a16552bd41e40a Mon Sep 17 00:00:00 2001 From: Pablo Garrido Date: Tue, 24 Mar 2020 13:08:12 +0100 Subject: [PATCH 2/9] Update docs --- _data/docs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/_data/docs.yml b/_data/docs.yml index 71716ac8..4532c0c3 100644 --- a/_data/docs.yml +++ b/_data/docs.yml @@ -74,4 +74,5 @@ - title: Advanced Tutorials with Linux docs: + - tutorials/advanced/linux/linux_getting_started - tutorials/advanced/linux/tracing From e6b5411d66ced912adfc6f7002330428228b0199 Mon Sep 17 00:00:00 2001 From: Pablo Garrido Date: Tue, 24 Mar 2020 13:21:38 +0100 Subject: [PATCH 3/9] Fix --- _docs/tutorials/advanced/linux/linux_getting_started/index.md | 1 - 1 file changed, 1 deletion(-) diff --git a/_docs/tutorials/advanced/linux/linux_getting_started/index.md b/_docs/tutorials/advanced/linux/linux_getting_started/index.md index e9b807b0..0368cbcf 100644 --- a/_docs/tutorials/advanced/linux/linux_getting_started/index.md +++ b/_docs/tutorials/advanced/linux/linux_getting_started/index.md @@ -263,7 +263,6 @@ First of all, create and build a micro-ROS agent: # Download micro-ROS-Agent packages ros2 run micro_ros_setup create_agent_ws.sh -# Build micro-ROS-Agent packages, this may take a while. # Build micro-ROS-Agent packages, this may take a while. colcon build --metas src source install/local_setup.bash From a1e0a45c6fcd592acd1be0ddb4c4e2d7c3981164 Mon Sep 17 00:00:00 2001 From: Pablo Garrido Date: Tue, 24 Mar 2020 16:08:59 +0100 Subject: [PATCH 4/9] Updates --- .../linux/linux_getting_started/index.md | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/_docs/tutorials/advanced/linux/linux_getting_started/index.md b/_docs/tutorials/advanced/linux/linux_getting_started/index.md index 0368cbcf..fc26e56e 100644 --- a/_docs/tutorials/advanced/linux/linux_getting_started/index.md +++ b/_docs/tutorials/advanced/linux/linux_getting_started/index.md @@ -57,7 +57,7 @@ touch app.c CMakeLists.cmake popd ``` -For this example we are going to create a ping pong app where a node sends a ping package with a unique identifier using a publisher and the same package is received by a pong subscriber. The node will also answer to: +For this example we are going to create a ping pong app where a node sends a ping package with a unique identifier using a publisher and the same package is received by a pong subscriber. The node will also answer to pings received from other nodes with a pong message: ![pingpong](http://www.plantuml.com/plantuml/png/ZOwnIWGn48RxFCNFzSkoUG2vqce5jHEHi1dtWZkPa6GByNntavZY10yknMJu-ORlFwPiOjvvK-d3-M2YOR1uMKvHc93ZJafvoMML07d7h1NAE-DPWblg_na8vnwEx9OeZmzFOt1-BK7AzetJciPxCfRYVw1S0SbRLBEg1IpXPIvpUWLCmZpXIm6BS3addt7uQpu0ZQlxT1MK2r0g-7sfqbsbRrVfMrMwgbev3CDTlsqJGtJhATUmSMrMg5TKwaZUxfcttuMt7m00) @@ -275,16 +275,21 @@ Then run the agent: ros2 run micro_ros_agent micro_ros_agent udp4 --port 8888 ``` -Then run the app: +Then run the app in another command line (remember sourcing ROS 2 and micro-ROS installation): ```bash +source /opt/ros/$ROS_DISTRO/setup.bash +source install/local_setup.bash + # Run a micro-ROS agent ros2 run micro_ros_demos_rcl my_brand_new_app ``` -And finally, let's check that everything is working. We are going to listen to ping topic to check whether the Ping Pong node is publishing its own pings +And finally, let's check that everything is working in another command line. We are going to listen to ping topic to check whether the Ping Pong node is publishing its own pings: ```bash +source /opt/ros/$ROS_DISTRO/setup.bash + # Subscribe to micro-ROS ping topic ros2 topic echo /microROS/ping ``` @@ -308,13 +313,18 @@ frame_id: '730417256_1085377743' On another command line, let's subscribe to the pong topic ```bash +source /opt/ros/$ROS_DISTRO/setup.bash + # Subscribe to micro-ROS pong topic ros2 topic echo /microROS/pong ``` -At this point, we know that our app is publishing pings. Let's check if it also answers to someone else pings: +At this point, we know that our app is publishing pings. Let's check if it also answers to someone else pings in a new command line: ```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"}' ``` From 94db54a2102b0d9bf0b978d02028e09bddf5d37c Mon Sep 17 00:00:00 2001 From: Pablo Garrido Date: Wed, 25 Mar 2020 08:11:52 +0100 Subject: [PATCH 5/9] Fix --- _docs/tutorials/advanced/linux/linux_getting_started/index.md | 1 - 1 file changed, 1 deletion(-) diff --git a/_docs/tutorials/advanced/linux/linux_getting_started/index.md b/_docs/tutorials/advanced/linux/linux_getting_started/index.md index fc26e56e..1c5ea5b5 100644 --- a/_docs/tutorials/advanced/linux/linux_getting_started/index.md +++ b/_docs/tutorials/advanced/linux/linux_getting_started/index.md @@ -324,7 +324,6 @@ At this point, we know that our app is publishing pings. Let's check if it also ```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"}' ``` From e5191f9e1d612fdfe217d5a3be0ad5475c224f6d Mon Sep 17 00:00:00 2001 From: Pablo Garrido Date: Thu, 26 Mar 2020 10:27:00 +0100 Subject: [PATCH 6/9] Updates --- .../linux/linux_getting_started/index.md | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/_docs/tutorials/advanced/linux/linux_getting_started/index.md b/_docs/tutorials/advanced/linux/linux_getting_started/index.md index 1c5ea5b5..3e5af1ae 100644 --- a/_docs/tutorials/advanced/linux/linux_getting_started/index.md +++ b/_docs/tutorials/advanced/linux/linux_getting_started/index.md @@ -246,25 +246,22 @@ Don't forget to register your app in `src/uros/micro-ROS-demos/rcl/CMakeLists.tx export_executable(my_brand_new_app) ``` -When the configuring step ends, just build the firmware: - -```bash -# Build step -ros2 run micro_ros_setup build_firmware.sh -``` - ## Running the micro-ROS app The micro-ROS app is ready to connect to a micro-ROS-Agent and start talking with the rest of the ROS 2 world. -First of all, create and build a micro-ROS agent: +First of all, create a micro-ROS agent: ```bash # Download micro-ROS-Agent packages ros2 run micro_ros_setup create_agent_ws.sh +``` + +When the all client and agent packages are ready, just build them all: -# Build micro-ROS-Agent packages, this may take a while. -colcon build --metas src +```bash +# Build step +ros2 run micro_ros_setup build_firmware.sh source install/local_setup.bash ``` @@ -374,7 +371,7 @@ source install/local_setup.bash ros2 run micro_ros_demos_rcl my_brand_new_app ``` -As soon as all micro-ROS node are up and connected to the micro-ROS agent you will see them interacting: +As soon as all micro-ROS nodes are up and connected to the micro-ROS agent you will see them interacting: ``` pgarrido@pgarrido$ ros2 run micro_ros_demos_rcl my_brand_new_app From 0263174fab55fece46ea7f9642a7bba0ee476b6b Mon Sep 17 00:00:00 2001 From: Pablo Garrido Date: Tue, 31 Mar 2020 15:33:06 +0200 Subject: [PATCH 7/9] Update index.md --- _docs/tutorials/advanced/linux/linux_getting_started/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_docs/tutorials/advanced/linux/linux_getting_started/index.md b/_docs/tutorials/advanced/linux/linux_getting_started/index.md index 3e5af1ae..917c7999 100644 --- a/_docs/tutorials/advanced/linux/linux_getting_started/index.md +++ b/_docs/tutorials/advanced/linux/linux_getting_started/index.md @@ -23,7 +23,7 @@ cd microros_ws git clone -b $ROS_DISTRO https://github.com/micro-ROS/micro-ros-build.git src/micro-ros-build # Update dependencies using rosdep -rosdep update +sudo apt update && rosdep update rosdep install --from-path src --ignore-src -y # Build micro-ROS tools and source them @@ -389,4 +389,4 @@ Pong for seq 324239260_1742614911 (2) Pong for seq 324239260_1742614911 (3) Ping received with seq 1435780593_546591567. Answering. Ping received with seq 2034268578_1681483056. Answering. -``` \ No newline at end of file +``` From 3f78d10091a3cccdaf6c285354319b5843315231 Mon Sep 17 00:00:00 2001 From: Pablo Garrido Date: Wed, 1 Apr 2020 10:24:35 +0200 Subject: [PATCH 8/9] Update cmake --- _docs/tutorials/advanced/linux/linux_getting_started/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_docs/tutorials/advanced/linux/linux_getting_started/index.md b/_docs/tutorials/advanced/linux/linux_getting_started/index.md index 917c7999..d21590ba 100644 --- a/_docs/tutorials/advanced/linux/linux_getting_started/index.md +++ b/_docs/tutorials/advanced/linux/linux_getting_started/index.md @@ -53,7 +53,7 @@ micro-ROS apps for Linux are located at `src/uros/micro-ROS-demos/rcl/`. In orde pushd src/uros/micro-ROS-demos/rcl/ mkdir my_brand_new_app cd my_brand_new_app -touch app.c CMakeLists.cmake +touch app.c CMakeLists.txt popd ``` @@ -61,7 +61,7 @@ For this example we are going to create a ping pong app where a node sends a pin ![pingpong](http://www.plantuml.com/plantuml/png/ZOwnIWGn48RxFCNFzSkoUG2vqce5jHEHi1dtWZkPa6GByNntavZY10yknMJu-ORlFwPiOjvvK-d3-M2YOR1uMKvHc93ZJafvoMML07d7h1NAE-DPWblg_na8vnwEx9OeZmzFOt1-BK7AzetJciPxCfRYVw1S0SbRLBEg1IpXPIvpUWLCmZpXIm6BS3addt7uQpu0ZQlxT1MK2r0g-7sfqbsbRrVfMrMwgbev3CDTlsqJGtJhATUmSMrMg5TKwaZUxfcttuMt7m00) -To start creating this app, the `CMakeLists.cmake` file should looks like: +To start creating this app, the `CMakeLists.txt` file should looks like: ```cmake cmake_minimum_required(VERSION 3.5) From 48fa31ad56a1e59dc88437a89fcfbf183e70a848 Mon Sep 17 00:00:00 2001 From: Pablo Garrido Date: Wed, 1 Apr 2020 10:42:42 +0200 Subject: [PATCH 9/9] Update user --- .../advanced/linux/linux_getting_started/index.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/_docs/tutorials/advanced/linux/linux_getting_started/index.md b/_docs/tutorials/advanced/linux/linux_getting_started/index.md index d21590ba..be019371 100644 --- a/_docs/tutorials/advanced/linux/linux_getting_started/index.md +++ b/_docs/tutorials/advanced/linux/linux_getting_started/index.md @@ -294,7 +294,7 @@ ros2 topic echo /microROS/ping You should see the topic messages published by the Ping Pong node every 5 seconds: ``` -pgarrido@pgarrido:~$ ros2 topic echo /microROS/ping +user@user:~$ ros2 topic echo /microROS/ping stamp: sec: 20 nanosec: 867000000 @@ -328,7 +328,7 @@ ros2 topic pub --once /microROS/ping std_msgs/msg/Header '{frame_id: "fake_ping" Now, we should see on the ping subscriber our fake ping along with the board pings: ``` -pgarrido@pgarrido:~$ ros2 topic echo /microROS/ping +user@user:~$ ros2 topic echo /microROS/ping stamp: sec: 0 nanosec: 0 @@ -349,7 +349,7 @@ frame_id: '2084670932_1085377743' And in the pong subscriber, we should see the board's answer to our fake ping: ``` -pgarrido@pgarrido:~$ ros2 topic echo /microROS/pong +user@user:~$ ros2 topic echo /microROS/pong stamp: sec: 0 nanosec: 0 @@ -374,7 +374,7 @@ ros2 run micro_ros_demos_rcl my_brand_new_app As soon as all micro-ROS nodes are up and connected to the micro-ROS agent you will see them interacting: ``` -pgarrido@pgarrido$ ros2 run micro_ros_demos_rcl my_brand_new_app +user@user$ ros2 run micro_ros_demos_rcl my_brand_new_app UDP mode => ip: 127.0.0.1 - port: 8888 Ping send seq 1711620172_1742614911 <---- This micro-ROS node sends a ping with ping ID "1711620172" and node ID "1742614911" Pong for seq 1711620172_1742614911 (1) <---- The first mate pongs my ping