Skip to content

Commit a1e0a45

Browse files
pablogs9Your Name
authored andcommitted
Updates
1 parent e6b5411 commit a1e0a45

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

  • _docs/tutorials/advanced/linux/linux_getting_started

_docs/tutorials/advanced/linux/linux_getting_started/index.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ touch app.c CMakeLists.cmake
5757
popd
5858
```
5959

60-
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:
60+
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:
6161

6262
![pingpong](http://www.plantuml.com/plantuml/png/ZOwnIWGn48RxFCNFzSkoUG2vqce5jHEHi1dtWZkPa6GByNntavZY10yknMJu-ORlFwPiOjvvK-d3-M2YOR1uMKvHc93ZJafvoMML07d7h1NAE-DPWblg_na8vnwEx9OeZmzFOt1-BK7AzetJciPxCfRYVw1S0SbRLBEg1IpXPIvpUWLCmZpXIm6BS3addt7uQpu0ZQlxT1MK2r0g-7sfqbsbRrVfMrMwgbev3CDTlsqJGtJhATUmSMrMg5TKwaZUxfcttuMt7m00)
6363

@@ -275,16 +275,21 @@ Then run the agent:
275275
ros2 run micro_ros_agent micro_ros_agent udp4 --port 8888
276276
```
277277

278-
Then run the app:
278+
Then run the app in another command line (remember sourcing ROS 2 and micro-ROS installation):
279279

280280
```bash
281+
source /opt/ros/$ROS_DISTRO/setup.bash
282+
source install/local_setup.bash
283+
281284
# Run a micro-ROS agent
282285
ros2 run micro_ros_demos_rcl my_brand_new_app
283286
```
284287

285-
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
288+
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:
286289

287290
```bash
291+
source /opt/ros/$ROS_DISTRO/setup.bash
292+
288293
# Subscribe to micro-ROS ping topic
289294
ros2 topic echo /microROS/ping
290295
```
@@ -308,13 +313,18 @@ frame_id: '730417256_1085377743'
308313
On another command line, let's subscribe to the pong topic
309314

310315
```bash
316+
source /opt/ros/$ROS_DISTRO/setup.bash
317+
311318
# Subscribe to micro-ROS pong topic
312319
ros2 topic echo /microROS/pong
313320
```
314321

315-
At this point, we know that our app is publishing pings. Let's check if it also answers to someone else pings:
322+
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:
316323

317324
```bash
325+
source /opt/ros/$ROS_DISTRO/setup.bash
326+
327+
318328
# Send a fake ping
319329
ros2 topic pub --once /microROS/ping std_msgs/msg/Header '{frame_id: "fake_ping"}'
320330
```

0 commit comments

Comments
 (0)