Skip to content

Commit 3e64c0a

Browse files
committed
First micro-ROS app tutorials migrated to foxy.
1 parent 4557917 commit 3e64c0a

20 files changed

Lines changed: 144 additions & 373 deletions

File tree

_docs/tutorials/advanced/nuttx/6lowpan/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ The last step is to connect a mini-USB cable to the OTG2 USB port (this USB port
5454

5555
To create and flash the firmware, we are going to use the micro-ROS build system.
5656
You can find the instructions at the micro-ros-build's [README](https://github.com/micro-ROS/micro-ros-build/blob/dashing/micro_ros_setup/README.md).
57-
For this particular guide, it is necessary yo use the branch `dashing` and the configuration profile `uros_6lowpan`.
57+
For this particular guide, it is necessary to use the branch `dashing` and the configuration profile `uros_6lowpan`.
5858

5959
Once you follow all the instructions in the build system and flash the board, everything is ready.
6060

_docs/tutorials/advanced/zephyr_emulator/index.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ ros2 run micro_ros_setup create_firmware_ws.sh zephyr host
2525
{% include first_application_common/config.md %}
2626

2727
In this tutorial, we will use a UDP transport that looks for the agent on the port UDP/8888 at localhost, and focus on
28-
the out-of-the-box `host_ping_pong` application located at `firmware/zephyr_apps/apps/host_ping_pong`.
28+
the out-of-the-box `ping_pong` application located at `firmware/zephyr_apps/apps/ping_pong`.
2929
To execute this application with the chosen transport, run the configuration command above by specifying the `[APP]`
3030
and `[OPTIONS]` parameters as below::
3131

@@ -34,16 +34,16 @@ and `[OPTIONS]` parameters as below::
3434
ros2 run micro_ros_setup configure_firmware.sh host_ping_pong --transport udp --ip 127.0.0.1 --port 8888
3535
```
3636

37-
You can check the complete content of the `host_ping_pong` app
38-
[here](https://github.com/micro-ROS/zephyr_apps/tree/dashing/apps/host_ping_pong).
37+
You can check the complete content of the `ping_pong` app
38+
[here](https://github.com/micro-ROS/zephyr_apps/tree/foxy/apps/ping_pong).
3939

4040
{% include first_application_common/pingpong_logic.md %}
4141

4242
The contents of the Zephyr app specific files can be found here:
43-
[main.c](https://github.com/micro-ROS/zephyr_apps/blob/dashing/apps/host_ping_pong/src/main.c),
44-
[app-colcon.meta](https://github.com/micro-ROS/zephyr_apps/blob/dashing/apps/host_ping_pong/app-colcon.meta),
45-
[CMakeLists.txt](https://github.com/micro-ROS/zephyr_apps/blob/dashing/apps/host_ping_pong/CMakeLists.txt)
46-
and [prj.conf](https://github.com/micro-ROS/zephyr_apps/blob/dashing/apps/host_ping_pong/prj.conf).
43+
[main.c](https://github.com/micro-ROS/zephyr_apps/blob/foxy/apps/ping_pong/src/main.c),
44+
[app-colcon.meta](https://github.com/micro-ROS/zephyr_apps/blob/foxy/apps/ping_pong/app-colcon.meta),
45+
[CMakeLists.txt](https://github.com/micro-ROS/zephyr_apps/blob/foxy/apps/ping_pong/CMakeLists.txt)
46+
and [host-udp.conf](https://github.com/micro-ROS/zephyr_apps/blob/foxy/apps/ping_pong/host-udp.conf).
4747
A thorough review of these files is illustrative of how to create a micro-ROS app in this RTOS.
4848

4949
## Building the firmware
@@ -79,7 +79,7 @@ To do that, let's open a new command line and create a micro-ROS agent
7979

8080
```bash
8181
# Download micro-ROS-Agent packages
82-
source /opt/ros/dashing/setup.bash
82+
source /opt/ros/foxy/setup.bash
8383
source install/local_setup.bash
8484

8585
ros2 run micro_ros_setup create_agent_ws.sh

_docs/tutorials/core/first_application_linux/index.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ export_executable(<my_app>)
3939
In this tutorial, we will focus on the out-of-the-box `ping_pong` application located at
4040
`src/uros/micro-ROS-demos/rcl/ping_pong`.
4141
You can check the complete content of this app
42-
[here](https://github.com/micro-ROS/micro-ROS-demos/tree/dashing/rcl/ping_pong).
42+
[here](https://github.com/micro-ROS/micro-ROS-demos/tree/foxy/rclc/ping_pong).
4343

4444
{% include first_application_common/pingpong_logic.md %}
4545

4646
The contents of the host app specific files can be found here:
47-
[main.c](https://github.com/micro-ROS/micro-ROS-demos/blob/dashing/rcl/ping_pong/main.c) and
48-
[CMakeLists.txt](https://github.com/micro-ROS/micro-ROS-demos/blob/dashing/rcl/ping_pong/CMakeLists.txt).
47+
[main.c](https://github.com/micro-ROS/micro-ROS-demos/blob/foxy/rclc/ping_pong/main.c) and
48+
[CMakeLists.txt](https://github.com/micro-ROS/micro-ROS-demos/blob/foxy/rclc/ping_pong/CMakeLists.txt).
4949
A thorough review of these files is illustrative of how to create a micro-ROS app in this RTOS.
5050

5151
## Building the firmware
@@ -77,7 +77,7 @@ ros2 run micro_ros_agent micro_ros_agent udp4 --port 8888
7777
And then, in another command line, run the micro-ROS node (remember sourcing the ROS 2 and micro-ROS installations):
7878

7979
```bash
80-
source /opt/ros/dashing/setup.bash
80+
source /opt/ros/foxy/setup.bash
8181
source install/local_setup.bash
8282

8383
# Run a micro-ROS agent
@@ -96,7 +96,7 @@ each:
9696
```bash
9797
cd microros_ws
9898

99-
source /opt/ros/dashing/setup.bash
99+
source /opt/ros/foxy/setup.bash
100100
source install/local_setup.bash
101101

102102
ros2 run micro_ros_demos_rcl ping_pong

_docs/tutorials/core/first_application_rtos/freertos.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,15 @@ run the configuration command above by specifying the `[APP]` and `[OPTIONS]` pa
4343
# Configure step with ping_pong app and serial-usb transport
4444
ros2 run micro_ros_setup configure_firmware.sh ping_pong --transport serial --dev 3
4545
```
46+
4647
You can check the complete content of the `ping_pong` app
47-
[here](https://github.com/micro-ROS/freertos_apps/tree/dashing/apps/ping_pong).
48+
[here](https://github.com/micro-ROS/freertos_apps/tree/foxy/apps/ping_pong).
4849

4950
{% include first_application_common/pingpong_logic.md %}
5051

5152
The contents of the FreeRTOS app specific files can be found here:
52-
[app.c](https://github.com/micro-ROS/freertos_apps/blob/dashing/apps/ping_pong/app.c) and
53-
[app-colcon.meta](https://github.com/micro-ROS/freertos_apps/blob/dashing/apps/ping_pong/app-colcon.meta).
53+
[app.c](https://github.com/micro-ROS/freertos_apps/blob/foxy/apps/ping_pong/app.c) and
54+
[app-colcon.meta](https://github.com/micro-ROS/freertos_apps/blob/foxy/apps/ping_pong/app-colcon.meta).
5455
A thorough review of these files is illustrative of how to create a micro-ROS app in this RTOS.
5556

5657
{% include first_application_common/build_and_flash.md %}
@@ -64,9 +65,11 @@ connected to the computer using the usb to serial cable.
6465
<img width="400" style="padding-right: 25px;" src="../imgs/5.jpg">
6566

6667
***TIP:** Color codes are applicable to
67-
[this cable](https://www.olimex.com/Products/Components/Cables/USB-Serial-Cable/USB-Serial-Cable-F/).
68+
[this cable](https://www.olimex.com/Products/Components/Cables/USB-Serial-Cable/USB-SERIAL-F/).
6869
Make sure to match Olimex Rx with Cable Tx and vice-versa. Remember GND!*
6970

7071
{% include first_application_common/run_app.md %}
7172

7273
{% include first_application_common/test_app_rtos.md %}
74+
75+
This completes the First micro-ROS Application on FreeRTOS tutorial. Do you want to [go back](../) and try a different RTOS, i.e. NuttX or Zephyr?
5.06 MB
Loading

_docs/tutorials/core/first_application_rtos/nuttx.md

Lines changed: 98 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -5,103 +5,148 @@ redirect_from:
55
- /docs/tutorials/advanced/nuttx/nuttx_getting_started/
66
---
77

8-
{% include first_application_common/old_common/section_01_intro.md %}
8+
## Target platform
99

10-
In this tutorial, you'll learn the use of micro-ROS with NuttX.
10+
In this tutorial, you'll learn the use of micro-ROS with NuttX by testing a Ping Pong application.
11+
{% include first_application_common/target_hardware.md %}
12+
* [USB-to-Serial Cable Female](https://www.olimex.com/Products/Components/Cables/USB-Serial-Cable/USB-SERIAL-F/)
13+
* [USB-to-mini-USB cable](https://www.olimex.com/Products/Components/Cables/CABLE-USB-A-MINI-1.8M/)
1114

12-
{% include first_application_common/old_common/section_02_target_hardware_and_workspace.md %}
15+
{% include first_application_common/build_system.md %}
1316

1417
```bash
1518
# Create step
1619
ros2 run micro_ros_setup create_firmware_ws.sh nuttx olimex-stm32-e407
1720
```
1821

19-
{% include first_application_common/old_common/section_03_configuring_firmware.md %}
22+
Once the command is executed, a folder named `firmware` must be present in your workspace.
2023

21-
| RTOS | `[APP]` | `[OPTIONS]` | Configured app |
22-
| :------: | --------------- | ---------------------------- | :------------------------------------------------------------------------------: |
23-
| **NuttX** | **`uros_pingpong`** | | [**Source**](https://github.com/micro-ROS/apps/tree/feature/pingpong_app/examples/uros_pingpong) |
24-
| FreeRTOS | `ping_pong` | `--transport serial --dev 3` | [Source](https://github.com/micro-ROS/freertos_apps/tree/dashing/apps/ping_pong) |
25-
| Zephyr | `ping_pong` | `--transport serial-usb` | [Source](https://github.com/micro-ROS/zephyr_apps/tree/dashing/apps/ping_pong) |
24+
This step is in charge, among other things, of creating a set of micro-ROS apps for the specific platform you are
25+
addressing.
26+
In the case of NuttX, these are located [here](https://github.com/micro-ROS/apps/tree/foxy/examples).
27+
Each app is represented by a folder containing the following files:
2628

27-
{% include first_application_common/old_common/section_04_demo_description.md %}
29+
* `app.c`: This file contains the logic of the application.
30+
* `Kconfig`: This file contains the NuttX Kconfig configuration.
31+
* `Make.defs`: This file contains the NuttX build system definitions.
32+
* `Makefile`: This file contains the NuttX specific app build script.
2833

29-
Create a new app:
34+
{% include first_application_common/config.md %}
35+
36+
In this tutorial, we will use a Serial transport (labeled as `serial`) and focus on the out-of-the-box `uros_pingpong`
37+
application located [here](https://github.com/micro-ROS/apps/tree/foxy/examples/uros_pingpong).
38+
To execute this application with the chosen transport, run the configuration command above by specifying the `[APP]` parameter as below:
3039

3140
```bash
32-
# Go to app folder inside firmware
33-
cd firmware/apps/examples
34-
35-
# Create your app folder and required files. Contents of these file can be found in column Sample app in table above
36-
mkdir uros_pingpong
37-
cd uros_pingpong
38-
touch Kconfig
39-
touch Makefile
40-
touch app.c
41-
touch Make.defs
41+
# Configure step with ping_pong app and serial-usb transport
42+
ros2 run micro_ros_setup configure_firmware.sh drive_base
4243
```
4344

44-
Create a specific configuration. We're going to start from an already existing one and modify it for our new application.
45+
and with no `[OPTIONS]` parameter.
46+
To proceed with the configuration, clone the following NuttX tools repo:
4547

46-
Execute the following command:
4748
```bash
48-
cd microros_ws
49-
ros2 run micro_ros_setup configure_firmware.sh uros
49+
# Download the tools necessary to work with NuttX
50+
git clone https://bitbucket.org/nuttx/tools.git firmware/tools
5051
```
5152

52-
Install required `kconfig-frontends`:
53+
and then install the required `kconfig-frontends`:
5354

5455
```bash
55-
git clone https://bitbucket.org/nuttx/tools.git firmware/tools
56-
5756
pushd firmware/tools/kconfig-frontends
58-
./configure --enable-mconf --disable-nconf --disable-gconf --disable-qconf
59-
LD_RUN_PATH=/usr/local/lib && make && sudo make install && sudo ldconfig
57+
./configure
58+
make
59+
60+
# if the make command fails, type: autoreconf -f -i , and then rerun the make command.
61+
62+
sudo make install
63+
sudo ldconfig
6064
popd
6165
```
6266

63-
This sets the Ethernet and micro-ROS required configuration. However, in order to add our application, we're going to modify it:
67+
We'll now open an interactive NuttX menu config, which allows to modify the configuration of the RTOS, including adding a new application.
6468

6569
```bash
6670
cd firmware/NuttX
6771
make menuconfig
6872
```
6973

70-
This will open the NuttX menu config, which allows you to modify the configuration of the RTOS, including adding a new application.
74+
To add the `uros_pingpong` application, follow the steps listed below:
75+
76+
* On the menu, follow the path: `Application Configuration ---> Examples`
77+
* A list of the available applications will appear. You need to find: `micro-ROS Ping-Pong` and press the space bar to add it.
78+
* Navigate to the bottom menu with the left and right arrows, and click on the `Exit` button.
79+
* When you're back to the `Application Configuration` menu, go to `micro-ROS ---> Transport (UDP transport)`.
80+
* A list of the available transports will appear. You need to go to `Serial transport` and press the space bar to add it. After that, you'll be automatically redirected to the previous menu.
81+
* Navigate to the bottom menu with the left and right arrows, and click on the `Save` button.
82+
* You will be asked if you want to save your new `.config` configuration, and you need to click `Ok`, and then `Exit`.
83+
* Finally, push three times the `Esc` key to close the menu.
84+
85+
When the configuration process is over, go back to the `microros_ws`:
86+
87+
```bash
88+
cd ../..
89+
```
90+
91+
You can check the complete content of the `uros_pingpong` app
92+
[here](https://github.com/micro-ROS/apps/tree/foxy/examples/uros_pingpong).
7193

72-
- On the menu, follow the path:
73-
``Application Configuration -> Examples ``
74-
![](../imgs/nuttx_menuconfig.png)
94+
{% include first_application_common/pingpong_logic.md %}
7595

76-
- A list of the available applications will appear. You need to find: ``micro-ROS Ping-Pong`` and click ``y`` to add it.
77-
![](../imgs/nuttx_examples.png)
96+
The contents of the FreeRTOS app specific files can be found here:
97+
[app.c](https://github.com/micro-ROS/apps/blob/foxy/examples/uros_pingpong/app.c),
98+
[Kconfig](https://github.com/micro-ROS/apps/blob/foxy/examples/uros_pingpong/Kconfig),
99+
[Make.defs](https://github.com/micro-ROS/apps/blob/foxy/examples/uros_pingpong/Make.defs) and
100+
[Makefile](https://github.com/micro-ROS/apps/blob/foxy/examples/uros_pingpong/Makefile).
101+
A thorough review of these files is illustrative of how to create a micro-ROS app in this RTOS.
78102

79-
- Now push three times the key ``ESC`` to close the menu. You will be asked if you want to save your new configuration, and you need to click ``Yes``.
103+
{% include first_application_common/build_and_flash.md %}
80104

81-
To save your configuration execute the following commands:
105+
{% include first_application_common/agent_creation.md %}
106+
107+
Then, depending on the selected transport and RTOS, the board connection to the agent may differ.
108+
In this tutorial, we're using the Olimex STM32-E407 Serial connection, for which the Olimex development board is
109+
connected to the computer using the usb to serial cable.
110+
111+
<img width="400" style="padding-right: 25px;" src="../imgs/5.jpg">
112+
113+
Additionally, you'll need to connect a USB-to-mini-USB cable to the USB OTG 1 connector (the miniUSB connector
114+
that is closer to the Ethernet port).
115+
116+
<img width="500" style="padding-right: 25px;" src="../imgs/7.jpg">
117+
118+
***TIP:** Color codes are applicable to
119+
[this cable](https://www.olimex.com/Products/Components/Cables/USB-Serial-Cable/USB-SERIAL-F/).
120+
Make sure to match Olimex Rx with Cable Tx and vice-versa. Remember GND!*
121+
122+
## Running the micro-ROS app
123+
124+
At this point, you have both the client and the agent correctly installed.
125+
126+
To start micro-ROS, you first need to run the agent:
82127

83128
```bash
84-
cd uros_ws/firmware/NuttX
85-
make savedefconfig
129+
# Run a micro-ROS agent
130+
ros2 run micro_ros_agent micro_ros_agent serial --dev [device]
86131
```
87132

88-
This will generate a file called ``defconfig`` inside of ``uros_ws/firmware/NuttX``. This file is a config profile with all the configuration required to run your specific application.
133+
***TIP:** you can use this command to find your serial device name: `ls /dev/serial/by-id/*`*
89134

90-
Finally create a folder called ``uros_pingpong`` into ``uros_ws/firmware/NuttX/configs/olimex-stm32-e407`` and move the defconfig file to uros_pingpong folder so you can execute:
135+
Then, in order to launch the micro-ROS application, you need to install and open Minicom,
136+
a text-based serial port communications program. Open a new shell, and type:
91137

92138
```bash
93-
# Configure step
94-
ros2 run micro_ros_setup configure_firmware.sh uros_pingpong
139+
sudo minicom -D [device] -b 115200
95140
```
96141

97-
{% include first_application_common/old_common/section_05_building_flashing_and_running.md %}
142+
***TIP:** you can use this command to find your serial device name: `ls /dev/serial/by-id/*`. Select the one that starts with `usb-NuttX`.*
143+
144+
From inside the Minicom application, press three times the `Enter` key. Once you enter the Minicom command line, type:
98145

99-
| RTOS | micro-ROS Client to Agent |
100-
| :------: | ------------------------- |
101-
| **NuttX** | **Serial** |
102-
| FreeRTOS | Serial |
103-
| Zephyr | USB |
146+
```bash
147+
uros_pingpong
148+
```
104149

105-
{% include first_application_common/old_common/section_06_agent.md %}
150+
{% include first_application_common/test_app_rtos.md %}
106151

107-
This completes the First micro-ROS Application on NuttX tutorial. Do you want to [go back](../) and try a different RTOS, i.e. FreeRTOS or Zephyr?
152+
This completes the First micro-ROS Application on NuttX tutorial. Do you want to [go back](../) and try a different RTOS, i.e. FreeRTOS or Zephyr?

_docs/tutorials/core/first_application_rtos/zephyr.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ run the configuration command above by specifying the `[APP]` and `[OPTIONS]` pa
3131
ros2 run micro_ros_setup configure_firmware.sh ping_pong --transport serial-usb
3232
```
3333
You can check the complete content of the `ping_pong` app
34-
[here](https://github.com/micro-ROS/zephyr_apps/tree/dashing/apps/ping_pong).
34+
[here](https://github.com/micro-ROS/zephyr_apps/tree/foxy/apps/ping_pong).
3535

3636
{% include first_application_common/pingpong_logic.md %}
3737

3838
The contents of the Zephyr app specific files can be found here:
39-
[main.c](https://github.com/micro-ROS/zephyr_apps/blob/dashing/apps/ping_pong/src/main.c),
40-
[app-colcon.meta](https://github.com/micro-ROS/zephyr_apps/blob/dashing/apps/ping_pong/app-colcon.meta),
41-
[CMakeLists.txt](https://github.com/micro-ROS/zephyr_apps/blob/dashing/apps/ping_pong/CMakeLists.txt)
42-
and [prj.conf](https://github.com/micro-ROS/zephyr_apps/blob/dashing/apps/ping_pong/prj.conf).
39+
[main.c](https://github.com/micro-ROS/zephyr_apps/blob/foxy/apps/ping_pong/src/main.c),
40+
[app-colcon.meta](https://github.com/micro-ROS/zephyr_apps/blob/foxy/apps/ping_pong/app-colcon.meta),
41+
[CMakeLists.txt](https://github.com/micro-ROS/zephyr_apps/blob/foxy/apps/ping_pong/CMakeLists.txt)
42+
and [serial-usb.conf](https://github.com/micro-ROS/zephyr_apps/blob/foxy/apps/ping_pong/serial-usb.conf).
4343
A thorough review of these files is illustrative of how to create a micro-ROS app in this RTOS.
4444

4545
{% include first_application_common/build_and_flash.md %}
@@ -55,3 +55,5 @@ to the computer using the USB OTG 2 connector (the miniUSB connector that is fur
5555
{% include first_application_common/run_app.md %}
5656

5757
{% include first_application_common/test_app_rtos.md %}
58+
59+
This completes the First micro-ROS Application on Zepjyr tutorial. Do you want to [go back](../) and try a different RTOS, i.e. NuttX or FreeRTOS?

0 commit comments

Comments
 (0)