-
Notifications
You must be signed in to change notification settings - Fork 111
|
Hi, micro-ROS community! As you might know, PlatformIO has become a really popular solution for embedded development, it provides a complete embedded development environment compatible with tons of boards, frameworks, and platforms. Most of you have been using our micro-ROS for Arduino library to integrate micro-ROS in the PlatformIO environment, but we think that we can do it much better. So, we have been developing a proper solution for integrating the micro-ROS build system in the PlatformIO build system. micro-ROS for Arduino provide a precompiled set of libraries due to the lack of advanced features for building the micro-ROS stack in the Arduino IDE/CLI development environment. Meanwhile, PlatformIO allows complex build processes where the micro-ROS library can be compiled just in time for the used platform avoiding cross-compilation compatibility issues. Also, it provides a much more flexible way of configuring the micro-ROS library with custom packages and/or custom middleware configurations. We have reached a semi-functional status where some platforms are supported but we need your help to provide feedback and comments about your needs as micro-ROS developers. So we are opening a beta testing period before releasing this tool on the PlatformIO registry. We ask the community to:
Sincerely, the micro-ROS team. Technical detailsThe micro-ROS library for PlatformIO is designed to be modular. It relies on the advanced scripting features of the build system. As you can see in extra_script.py, the library is being built on the fly using the compiler and flags that the environment provides. In platform_code folder we include sources related to the framework. In this case, only This way, arduino/clock_gettime.cpp provides a the timing functionality required by micro-ROS using the Arduino API. As you can see, there are much more interesting frameworks such as CMSIS, FreeRTOS, libopencm3 or Zephyr RTOS. That means that those frameworks should be integrated creating Regarding the transports, they are also included in the framework folder. For example, the Serial transport for arduino is implemented using the This way you can create a PlaformIO project with the following [env:portenta_h7_m7] platform = ststm32 board = portenta_h7_m7 framework = arduino microros_transport = serial microros_distro = galactic lib_deps = https://github.com/micro-ROS/micro_ros_platformio
Tasks to be doneThe following tasks should be addressed:
Board testingThe following use cases shall be tested in hardware:
|
All reactions
-
🎉 2 -
❤️ 4
Replies: 8 comments 28 replies
Hi @pablogs9,
Thanks for using PlatformIO! 😊 A few comments for integration:
-
microros_transport = serial, users will see a warning about the unknowing configuration option. Please useboard_microros.transport = upload. Later you can get this data viaenv.BoardConfig().get("microros.transport") -
global_env['LIBS'].append(,global_env['_CPPDEFFLAGS'], please don't operate with private SCons scopes. See https://docs.platformio.org/en/latest/projectconf/section_env_build.html#build-flagsglobal_env.Append(LIBS=['a', 'b', 'c'])- https://github.com/espressif/arduino-esp32/blob/master/tools/platformio-build-esp32.py
Please ping me when you apply changes in https://github.com/micro-ROS/micro_ros_platformio/blob/main/extra_script.py
Thanks for your work!
All reactions
@ivankravets Of course, there you go:
All reactions
Add micro-ROS defines to user application
The user's application has its own isolated environment named projenv. See example https://docs.platformio.org/en/latest/manifests/library-json/fields/build/extrascript.html
Please note that you will need to use the latest PIO Core Dev (pio upgrade --dev). Accessing projenv in library extra script was added in PIO Core 6.0.3 that has not been released yet.
Does it work now?
All reactions
Yes!
Is there a way to get the used PIO Core version inside the extrascript?
I would like to keep this working for users with older versions.
All reactions
Sorry for the delay, PlaformIO Core 6.1 is out! Please upgrade https://github.com/platformio/platformio-core/releases/tag/v6.1.0
All reactions
Thanks! Upgrading on #36
All reactions
I will try to use this library in my project. It should go fairly easy as it already uses PlatformIO. The project requires support for:
- custom meta file
- custom transport
- custom
clock_gettime - extra packages
As all of this is possible now, I'll start trying to switch to this library and report any issues or ask questions when unsure about something.
All reactions
-
👍 1 -
🚀 1
What should I set board_microros_transport to when I use a custom transport?
All reactions
You have to create a <framework>/<board_microros_transport> folder on the [platform_code](https://github.com/micro-ROS/micro_ros_platformio/tree/main/platform_code) folder.
For example:
platform.ini:framework = arduino board_microros_transport = wifi
- Transport source files: platform_code/arduino/wifi
- Also, a
MICRO_ROS_TRANSPORT_<FRAMEWORK>_<TRANSPORT>definition will be available:
micro_ros_platformio/ci/src/main.cpp
Line 3 in de7a61c
#if defined(MICRO_ROS_TRANSPORT_ARDUINO_WIFI)
All reactions
I would rather avoid modifying this project to add my custom transport. I currently have the sources for the custom transport under my project's src directory. The library script:
# Add platformio library general include path global_env.Append(CPPPATH=[ main_path + "/platform_code", main_path + "/platform_code/{}/{}".format(framework, microros_transport)]) # Add platformio library general to library include path env.Append(CPPPATH=[ main_path + "/platform_code", main_path + "/platform_code/{}/{}".format(framework, microros_transport)])
will still add additional include paths no matter what I set board_microros_transport to.
Could we, for example, make setting the board_microros_transport to custom not add the additional include paths?
All reactions
That's a good idea. We will take a look at that.
All reactions
Working on it here: #21
All reactions
#21 merged, the additional include paths will only add the aux micro_ros_platformio.h header.
You can check the custom transport section on the repository README and an actual example on our CI project source, under the #if defined(MICRO_ROS_TRANSPORT_ARDUINO_CUSTOM) conditionals.
@bjsowa Also, we would be happy to add your use case's transport to the repository, feel free to open a PR.
All reactions
Main task completed and merged, we are ready for Remove PlatformIO from micro-ROS for Arduino repo step.
All reactions
Go ahead
All reactions
Done! micro-ROS/micro_ros_arduino#957
Also added to micro_ros_setup docs: micro-ROS/micro_ros_setup#504
All reactions
I've tested the seeed_xiao and mkrzero boards with serial and they seem to work fine.
All reactions
I have been developing my own custom messages within the extra_packages folder. This is working well so far, but I find the required re-compilation process of microROS to be a little annoying.
It is very slow and downloads many things behind the scenes, so it is a bit inefficient. Is there a way to force a recompilation of libraries without downloading everything again?
All reactions
All reactions
It is very slow and downloads many things behind the scenes, so it is a bit inefficient. Is there a way to force a recompilation of libraries without downloading everything again?
No, this is not possible right now.
You can modify the build script to avoid deleting the sources, triggering a colcon build over the updated extra_packages.
But this is not trivial and may take an excesive ammount of time.
Maybe you can use a Linux app to test your micro-ROS app, the rebuild would be quite faster with this approach.
All reactions
Hello, community!
I was spending many time struggling with that error comes from strdup.c library.
The project includes esp32 platform.
Build command:
pio run -e esp32-espidf
Screen of error.
Untitled
Learning of solutions in www didn't provide me any positive effect. Could it be fixed somehow? Please, take a look.
UPD:
I detected that context of strdup.c file which comes after classical installation from here differs from context provided this platformio repository.
In the classical we have call rcutils_strndup(str, strlen(str), allocator)
In PlatformIO we have call rcutils_strndup(str, SIZE_MAX, allocator)
There is the root of error behaviour. Could versions of code be aligned in the future?