Skip to content

Commit ccdf77e

Browse files
committed
Minor fixes
Co-Authored-By: Julián Bermúdez Ortega <julianbermudez@eprosima.com> Update _docs/tutorials/advanced/zephyr/zephyr_emulator/index.md Co-Authored-By: Julián Bermúdez Ortega <julianbermudez@eprosima.com> Update _docs/tutorials/advanced/zephyr/zephyr_emulator/index.md Co-Authored-By: Julián Bermúdez Ortega <julianbermudez@eprosima.com> Update _docs/tutorials/advanced/zephyr/zephyr_emulator/index.md Co-Authored-By: Julián Bermúdez Ortega <julianbermudez@eprosima.com> Update _docs/tutorials/advanced/zephyr/zephyr_emulator/index.md Co-Authored-By: Julián Bermúdez Ortega <julianbermudez@eprosima.com> Update _docs/tutorials/advanced/zephyr/zephyr_emulator/index.md Co-Authored-By: Julián Bermúdez Ortega <julianbermudez@eprosima.com> Update _docs/tutorials/advanced/zephyr/zephyr_emulator/index.md Co-Authored-By: Julián Bermúdez Ortega <julianbermudez@eprosima.com> Update _docs/tutorials/advanced/zephyr/zephyr_emulator/index.md Co-Authored-By: Julián Bermúdez Ortega <julianbermudez@eprosima.com> Update _docs/tutorials/advanced/zephyr/zephyr_emulator/index.md Co-Authored-By: Julián Bermúdez Ortega <julianbermudez@eprosima.com> Update _docs/tutorials/advanced/zephyr/zephyr_emulator/index.md Co-Authored-By: Julián Bermúdez Ortega <julianbermudez@eprosima.com> Update pushd popd
1 parent 41f75d8 commit ccdf77e

2 files changed

Lines changed: 13 additions & 11 deletions

File tree

  • _docs/tutorials/advanced

_docs/tutorials/advanced/freertos/freertos_getting_started/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ micro-ROS apps for Olimex + FreeRTOS are located at `firmware/freertos_apps/apps
6868

6969
```bash
7070
# Creating a new app
71-
cd firmware/freertos_apps/apps
71+
pushd firmware/freertos_apps/apps
7272
mkdir my_brand_new_app
7373
cd my_brand_new_app
7474
touch app.c app-colcon.meta
75-
cd ../../../
75+
popd
7676
```
7777

7878
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:

_docs/tutorials/advanced/zephyr/zephyr_emulator/index.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ This tutorial requires no hardware beyond a Linux host computer.
1515

1616
## Adding a new micro-ROS app
1717

18-
First of all make sure that you have a **ROS 2** installation.
18+
First of all, make sure that you have a **ROS 2** installation.
1919

2020
***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)*
2121

@@ -31,6 +31,7 @@ cd microros_ws
3131
git clone -b $ROS_DISTRO https://github.com/micro-ROS/micro-ros-build.git src/micro-ros-build
3232

3333
# Update dependencies using rosdep
34+
apt update && apt install python3-colcon-metadata
3435
rosdep update
3536
rosdep install --from-path src --ignore-src -y
3637

@@ -39,14 +40,15 @@ colcon build
3940
source install/local_setup.bash
4041
```
4142

42-
Let's install last version of CMake:
43+
Let's install the last version of CMake:
4344

4445
```bash
46+
apt install wget
4547
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | sudo apt-key add -
4648
sudo apt install software-properties-common
4749
sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main'
4850
sudo apt update
49-
sudo apt install cmake -y
51+
sudo apt install cmake
5052
```
5153

5254
Now, let's create a firmware workspace that targets all the required code and tools for Zephyr emulator:
@@ -271,7 +273,7 @@ First of all, create and build a micro-ROS agent:
271273
ros2 run micro_ros_setup create_agent_ws.sh
272274

273275
# Build micro-ROS-Agent packages, this may take a while.
274-
colcon build --metas src
276+
colcon build
275277
source install/local_setup.bash
276278
```
277279

@@ -286,7 +288,7 @@ And run the Zephyr app in another command line (remember sourcing ROS 2 and micr
286288

287289
```bash
288290
source /opt/ros/$ROS_DISTRO/setup.bash
289-
source install/local_setup.bash
291+
source microros_ws/install/local_setup.bash
290292

291293
# Flash/run step
292294
ros2 run micro_ros_setup flash_firmware.sh
@@ -304,7 +306,7 @@ ros2 topic echo /microROS/ping
304306
You should see the topic messages published by the Ping Pong node every 5 seconds:
305307

306308
```
307-
pgarrido@pgarrido:~$ ros2 topic echo /microROS/ping
309+
user@user:~$ ros2 topic echo /microROS/ping
308310
stamp:
309311
sec: 20
310312
nanosec: 867000000
@@ -338,7 +340,7 @@ ros2 topic pub --once /microROS/ping std_msgs/msg/Header '{frame_id: "fake_ping"
338340
Now, we should see on the ping subscriber our fake ping along with the board pings:
339341

340342
```
341-
pgarrido@pgarrido:~$ ros2 topic echo /microROS/ping
343+
user@user:~$ ros2 topic echo /microROS/ping
342344
stamp:
343345
sec: 0
344346
nanosec: 0
@@ -369,7 +371,7 @@ frame_id: fake_ping
369371

370372
## Multiple Ping Pong nodes
371373

372-
One of the advantages of having an emulator 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 thw following on each:
374+
One of the advantages of having an emulator 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:
373375

374376
```bash
375377
cd microros_ws
@@ -399,4 +401,4 @@ Ping received with seq 1435780593_546591567. Answering.
399401
Ping received with seq 2034268578_1681483056. Answering.
400402
```
401403

402-
***TIP:** use the help flag to discover some Zephyr emulation features `./firmware/build/zephyr/zephyr.exe -h`*
404+
***TIP:** use the help flag to discover some Zephyr emulation features `./firmware/build/zephyr/zephyr.exe -h`*

0 commit comments

Comments
 (0)