Skip to content

Commit 6f4df77

Browse files
committed
Initial
1 parent eaa8cdc commit 6f4df77

5 files changed

Lines changed: 120 additions & 9 deletions

File tree

_data/docs.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@
3131
- concepts/rtos/NuttX
3232
- concepts/rtos/Zephyr
3333
- concepts/rtos/comparison
34-
- concepts/rtos/integration_with_colcon
34+
35+
- title: Build System
36+
docs:
37+
- concepts/build_system
38+
- concepts/build_system/external_build_systems
3539

3640
- title: Benchmarking
3741
docs:
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
title: External Build Systems
3+
permalink: /docs/concepts/build_system/external_build_systems/
4+
---
5+
6+
Once you have read about the oficial[ **micro_ros_setup** tool](/docs/concepts/build_system/), this page will present some other approaches for building micro-ROS as a module or component integrated in other build systems.
7+
8+
## micro-ROS component for ESP-IDF
9+
10+
The [micro-ROS component for ESP-IDF](https://github.com/micro-ROS/micro_ros_espidf_component) allows to integrate micro-ROS as a component in an Espressif ESP-IDF Build System. This component allows the user to integrate the micro-ROS API and utilities in an already created ESP-IDF project just by cloning or copying a folder.
11+
12+
The procedure for configuring the built micro-ROS library is based in `colcon.meta`. For more details visit the [Github repository](https://github.com/micro-ROS/micro_ros_espidf_component).
13+
14+
## micro-ROS module for Zephyr
15+
16+
The [micro-ROS module for Zephyr](https://github.com/micro-ROS/micro_ros_zephyr_module) allows to integrate micro-ROS as a module in a Zephyr RTOS project. This component allows the user to integrate the micro-ROS API and utilities in an already created Zephyr RTOS project just by cloning or copying a folder.
17+
18+
The procedure for configuring the built micro-ROS library is based in `colcon.meta`. For more details visit the [Github repository](https://github.com/micro-ROS/micro_ros_espidf_component).
19+
20+
## micro-ROS for Arduino
21+
22+
The [micro-ROS for Arduino](https://github.com/micro-ROS/micro_ros_arduino) support package is a special port of micro-ROS provided as a set of precompiled libraries for specific platforms. The main reason of this approach is that Arduino does not allow the build of a complex library such as micro-ROS, so by using this solution a ready-to-use solution is provided to the Arduino users.
23+
24+
Along with this support package there are [detailed instructions](https://github.com/micro-ROS/micro_ros_arduino#how-to-build-the-precompiled-library) for rebuilding the micro-ROS for Arduino libraries for users that need to tune the default configuration.
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
---
2+
title: micro-ROS Build System
3+
permalink: /docs/concepts/build_system/
4+
---
5+
6+
micro-ROS provides two ways of building a micro-ROS application for embedded platforms:
7+
- using the **micro_ros_setup** as a tool integrated in a ROS 2 workspace
8+
- using external integrations tools. Click [here](/docs/concepts/build_system/external_build_systems/) for more details about this option.
9+
10+
**micro_ros_setup** provides an standalone build system in the form of a ROS 2 package that can be integrated in a common ROS 2 workspace. This tool is available in [micro-ROS/micro_ros_setup](https://github.com/micro-ROS/micro_ros_setup) repository in GitHub.
11+
12+
The micro_ros_setup tools is in charge of generating micro-ROS images that contains micro-ROS apps for the [supported hardware](/docs/overview/hardware/) boards and [RTOS](/docs/concepts/rtos/).
13+
14+
As the micro_ros_setup package can be installed as any other ROS 2 package its usage will be through the ROS 2 CLI tool. For example in order to install the micro-ROS build system in a ROS 2 workspace just download it and build with `colcon`:
15+
16+
```bash
17+
# Source the ROS 2 installation
18+
source /opt/ros/$ROS_DISTRO/setup.bash
19+
20+
# Create a workspace and download the micro-ROS tools
21+
mkdir microros_ws
22+
cd microros_ws
23+
git clone -b $ROS_DISTRO https://github.com/micro-ROS/micro_ros_setup.git src/micro_ros_setup
24+
25+
# Update dependencies using rosdep
26+
sudo apt update && rosdep update
27+
rosdep install --from-path src --ignore-src -y
28+
29+
# Install pip
30+
sudo apt-get install python3-pip
31+
32+
# Build micro-ROS tools and source them
33+
colcon build
34+
source install/local_setup.bash
35+
```
36+
37+
### micro-ROS client
38+
39+
Once it is installed the build system tool has some utilities that can be used in order to prepare, build, flash and use a micro-ROS application. The micro-ROS buils system is a four step procedure.In the first step, the user can create a new micro-ROS application by configuring the target hardware and RTOS:
40+
41+
```bash
42+
# Create step
43+
ros2 run micro_ros_setup create_firmware_ws.sh [RTOS] [HARDWARE BOARD]
44+
```
45+
46+
It is possible to obtain a list of the supported hardware by running the command without any argument. By soing so, it possible to see that along with the RTOSes and hardware supported by micro-ROS this build system also provides three extra options:
47+
- By using `zephyr` as RTOS and `host` as hardware name, it is possible to obtain a Zephyr RTOS image with your micro-ROS app that runs in your host computer.
48+
- By using just `host` as RTOS, micro-ROS will build a set of [micro-ROS demo applications](https://github.com/micro-ROS/micro-ROS-demos) natively in your host machine. This applications behaves just like a micro-ROS app (using the same layers and middleware) but allows the user to debug and test the applications.
49+
- By using `generate_lib` as RTOS it is possible to configure the build system for generating static libraries (`.a`) and a set of headers (`include`) that can be linked in any other external tool. This option requires a valid CMake toolchain.
50+
51+
Once the build system has create the new firmware project, it is possible to configure it using:
52+
53+
```bash
54+
# Configure step
55+
ros2 run micro_ros_setup configure_firmware.sh [APP] [OPTIONS]
56+
```
57+
58+
Running this command without any argument it will output a list of example application valid for the selected RTOS.
59+
Common options available at this configuration step are:
60+
- `--transport` or `-t`: `udp`, `serial` or any hardware specific transport label
61+
- `--dev` or `-d`: agent string descriptor in a serial-like transport
62+
- `--ip` or `-i`: agent IP in a network-like transport
63+
- `--port` or `-p`: agent port in a network-like transport
64+
65+
66+
Finally, it is possible to build and flash a micro-ROS app using:
67+
68+
```bash
69+
# Build step
70+
ros2 run micro_ros_setup build_firmware.sh
71+
72+
# Flash step
73+
ros2 run micro_ros_setup flash_firmware.sh
74+
```
75+
76+
### micro-ROS agent
77+
78+
The micro-ROS build system is also able to ease the compilation of the micro-ROS Agent in a ROS 2 workspace using these commands:
79+
80+
```bash
81+
# Download micro-ROS-Agent packages
82+
ros2 run micro_ros_setup create_agent_ws.sh
83+
ros2 run micro_ros_setup build_agent.sh
84+
source install/local_setup.bash
85+
ros2 run micro_ros_agent micro_ros_agent [OPTIONS]
86+
```
87+
88+
***TIP:** Remember that micro-ROS Agent can be also be used with this simple Docker command: `docker run -it --rm -v /dev:/dev --privileged --net=host microros/micro-ros-agent:foxy [OPTIONS]`*

_docs/concepts/rtos/integration_with_colcon/index.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

_includes/docs_nav.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
{% if page.path contains "_docs/concepts" and section.title == "RTOS" %}
1414
{% assign should_show_this_menu = true %}
1515
{% endif %}
16+
{% if page.path contains "_docs/concepts" and section.title == "Build System" %}
17+
{% assign should_show_this_menu = true %}
18+
{% endif %}
1619
{% if page.path contains "_docs/concepts" and section.title == "Benchmarking" %}
1720
{% assign should_show_this_menu = true %}
1821
{% endif %}

0 commit comments

Comments
 (0)