Skip to content

Commit d881cfb

Browse files
authored
Modify nuttx tutorial (#359)
1 parent e31868d commit d881cfb

1 file changed

Lines changed: 51 additions & 21 deletions

File tree

  • _docs/tutorials/core/first_application_rtos

_docs/tutorials/core/first_application_rtos/nuttx.md

Lines changed: 51 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,33 @@ Each app is represented by a folder containing the following files:
3131
* `Make.defs`: This file contains the NuttX build system definitions.
3232
* `Makefile`: This file contains the NuttX specific app build script.
3333

34-
{% include first_application_common/config.md %}
34+
## Configuring the firmware
3535

36-
In this tutorial, we will use a Serial transport (labeled as `serial`) and focus on the out-of-the-box `uros_pingpong`
36+
The configuration step will set up the main micro-ROS options and select the desired application.
37+
It can be executed with the following command:
38+
39+
```bash
40+
# Configure step
41+
ros2 run micro_ros_setup configure_firmware.sh [APP] [OPTIONS]
42+
```
43+
44+
In this tutorial, we will use a Serial transport and focus on the out-of-the-box `uros_pingpong`
3745
application located [here](https://github.com/micro-ROS/nuttx_apps/tree/foxy/examples/uros_pingpong).
3846
To execute this application with the chosen transport, run the configuration command above by specifying the `[APP]` parameter as below:
3947

4048
```bash
4149
# Configure step with ping_pong app and serial-usb transport
42-
ros2 run micro_ros_setup configure_firmware.sh drive_base
50+
ros2 run micro_ros_setup configure_firmware.sh pingpong
4351
```
4452

4553
and with no `[OPTIONS]` parameter.
54+
55+
A pre-configured ethernet example is also available:
56+
```bash
57+
# Configure step with ping_pong app and serial-usb transport
58+
ros2 run micro_ros_setup configure_firmware.sh pingpong-eth
59+
```
60+
4661
To proceed with the configuration, clone the following NuttX tools repo:
4762

4863
```bash
@@ -64,29 +79,44 @@ sudo ldconfig
6479
popd
6580
```
6681

67-
We'll now open an interactive NuttX menu config, which allows to modify the configuration of the RTOS, including adding a new application.
82+
Now we have two options to configure our micro-ROS transport:
6883

69-
```bash
70-
cd firmware/NuttX
71-
make menuconfig
72-
```
84+
- Interactive NuttX menu config
85+
* Launch the configuration menu:
7386

74-
To add the `uros_pingpong` application, follow the steps listed below:
87+
```bash
88+
cd firmware/NuttX
89+
make menuconfig
90+
```
7591

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 set the Serial port as micro-ROS transport. 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.
92+
* You can check that the application has been selected under `Application Configuration ---> Examples ---> micro-ROS Ping Pong`.
93+
* The transport is also pre-configured under the `Application Configuration ---> micro-ROS ---> Transport` option.
94+
* To configure the transport, use the `IP address of the agent` and `Port number of the agent` options for UDP and `Serial port to use` for the serial example.
95+
* To save the changes, navigate to the bottom menu with the left and right arrows, and click on the `Save` button.
96+
* You will be asked if you want to save your new `.config` configuration, and you need to click `Ok`, and then `Exit`.
97+
* Push three times the `Esc` key to close the menu and go back to `microros_ws` with:
8498

85-
When the configuration process is over, go back to the `microros_ws`:
99+
```bash
100+
cd ../..
101+
```
86102

87-
```bash
88-
cd ../..
89-
```
103+
- `kconfig-tweak` console commands:
104+
* Go to Nuttx configuration path:
105+
106+
```bash
107+
cd firmware/NuttX
108+
```
109+
110+
* UDP transport configuration:
111+
```bash
112+
kconfig-tweak --set-val CONFIG_UROS_AGENT_IP "127.0.0.1"
113+
kconfig-tweak --set-val CONFIG_UROS_AGENT_PORT 8888
114+
```
115+
116+
* Serial transport configuration:
117+
```bash
118+
kconfig-tweak --set-val CONFIG_UROS_SERIAL_PORT "/dev/ttyS0"
119+
```
90120

91121
You can check the complete content of the `uros_pingpong` app
92122
[here](https://github.com/micro-ROS/nuttx_apps/tree/foxy/examples/uros_pingpong).

0 commit comments

Comments
 (0)