micro-ros / micro_ros_zephyr_module Goto Github PK
View Code? Open in Web Editor NEWmicro-ROS Zephyr module and sample code
License: Apache License 2.0
micro-ROS Zephyr module and sample code
License: Apache License 2.0
Following steps to reproduce:
environment : macos 10.15.7
installing tools :
python3 -m pip install colcon-common-extensions
pip3 install catkin_pkg lark-parser empy
clone the git
in zephyr directory execute
west init && west update
add root dir:
export GNUARMEMB_TOOLCHAIN_PATH="$HOME/tools/gcc-arm-none-eabi-8-2018-q4-major"
export ZEPHYR_TOOLCHAIN_VARIANT="gnuarmemb"
source modules/libmicroros/zephyr/zephyr/zephyr-env.sh
west build -b disco_l475_iot1 micro_ros_zephyr_module
result:
Linking C executable zephyr/zephyr_prebuilt.elf
tools/gcc-arm-none-eabi-8-2018-q4-major/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld: /Users/d/_Projects/gitprojects/w/micro_ros_zephyr_module/modules/libmicroros/libmicroros.a: member /Users/d/_Projects/gitprojects/w/micro_ros_zephyr_module/modules/libmicroros/libmicroros.a(/) in archive is not an object
Hi! I'm trying to integrate micro-ros into an existing zephyr project using this module.
The build fails, and it seems like what's happening is that it tries to build message-definitions for fastrtps, which is not possible due to a fastcdr
only being installed for "64bit", and i'm building for my ARM microcontroller.
(Why does this even happen? If i understand correctly ROS2 galactic uses cyclone exclusively, and micro-ros doesnt use either of those...)
I would appreciate if anyone has experienced this before and knows a solution, or has ideas on how to solve this.
CMake Error at /opt/ros/galactic/share/rosidl_typesupport_fastrtps_c/cmake/rosidl_typesupport_fastrtps_c-extras.cmake:5 (find_package):
Could not find a configuration file for package "fastcdr" that is
compatible with requested version "".
The following configuration files were considered but not accepted:
/opt/ros/galactic/lib/cmake/fastcdr/fastcdr-config.cmake, version: 1.0.20 (64bit)
Call Stack (most recent call first):
/opt/ros/galactic/share/rosidl_typesupport_fastrtps_c/cmake/rosidl_typesupport_fastrtps_cConfig.cmake:41 (include)
/home/jonasotto/io-board-software/modules/libmicroros/micro_ros_src/install/share/rosidl_typesupport_c/cmake/rosidl_typesupport_c-extras.cmake:13 (find_package)
/home/jonasotto/io-board-software/modules/libmicroros/micro_ros_src/install/share/rosidl_typesupport_c/cmake/rosidl_typesupport_cConfig.cmake:41 (include)
/home/jonasotto/io-board-software/modules/libmicroros/micro_ros_src/install/share/rosidl_default_generators/cmake/rosidl_default_generators-extras.cmake:21 (find_package)
/home/jonasotto/io-board-software/modules/libmicroros/micro_ros_src/install/share/rosidl_default_generators/cmake/rosidl_default_generatorsConfig.cmake:41 (include)
CMakeLists.txt:15 (find_package)
---
Failed <<< unique_identifier_msgs [3.52s, exited with code 1]
Some relevant information:
Following steps to reproduce:
environment : macos 10.15.7
zephy: 2.4.99
installing tools :
python3 -m pip install colcon-common-extensions
pip3 install catkin_pkg lark-parser empy
clone the git
in zephyr directory execute
west init && west update
add root dir:
export GNUARMEMB_TOOLCHAIN_PATH="$HOME/tools/gcc-arm-none-eabi-8-2018-q4-major"
export ZEPHYR_TOOLCHAIN_VARIANT="gnuarmemb"
source modules/libmicroros/zephyr/zephyr/zephyr-env.sh
west build -b disco_l475_iot1 micro_ros_zephyr_module
RANLIB patch applied!!!
gcc-arm-none-eabi-8-2018-q4-major/arm-none-eabi/lib/thumb/v7e-m/nofp/libc.a(lib_a-fini.o): in function __libc_fini_array': fini.c:(.text.__libc_fini_array+0x26): undefined reference to
_fini'
How should someone add this module to their existing zephyr project?
Hello, I am working on the nRF52840 chip with Zephyr RTOS and I was wondering if it is feasible/reliable implementing mirco-ROS over the BLE 5.0 transport protocol (following this tutorial) with this chip for streaming data from a sensor @200 Hz? And if it is the case, are there any similar works I can look at?
Thank you!
I have taken the folder "modules/libmicroros" from the foxy branch and added them to my application. When building, the following output happens:
/home/jan/zephyrproject/autonomous-system-controller/Software/application/modules/libmicroros/micro_ros_src/src/rcutils/src/time_unix.c:33:10: fatal error: posix/time.h: No such file or directory
33 | #include <posix/time.h> // Points to Zephyr toolchain posix time implementation
| ^~~~~~~~~~~~~~
There the include path for Zephyr is wrong (at least for my tested versions 3.1.0 and 3.2.0). Is has to be
#include <zephyr/posix/time.h>
Changing this makes it compile and link without any error.
Dear micro-ROS maintainers,
Due to a recent change in Zephyr code it is no longer possible to successfully compile micro-ROS using the latest Zephyr code.
The notified problem is: " in function uxr_nanos': undefined reference to
z_impl_clock_gettime' "
The Zephyr developers have removed the `z_impl_clock_gettime' function and replaced it by the clock_gettime function. As far as I can tell this seems to only be a change in name with similar functionality, but you can better check that yourself as well.
The change happened in commit 95a22b1 in the lib/posix/clock.c file.
As far as I can see this function is only used in the micro-ROS Micro-XRCE-DDS-Client/src/c/util/time.c file (https://github.com/eProsima/Micro-XRCE-DDS-Client/blob/master/src/c/util/time.c)
As a temporary fix I could use a wrapper in my main file for the new function name and could get my code compiling again.
int z_impl_clock_gettime(clockid_t clock_id, struct timespec *ts){
return clock_gettime(clock_id, ts);
}
It would however be nice to have this change incorporated in the general micro-ROS code.
I hope to have provided sufficient information.
Kind regards
Hi just some general questions.
I am trying to use this module on a custom-made STM32 board we would use in Formula Student in our Driverless racing part.
I have tried several things to get it to compile with UDP as a transport layer, but when not using native posix, I get a lot of errors.
Many things are then defined twice or more if I use the socket.h with the ETH_STM32_HAL. I have attached an example of this below.
If I comment out the unistd.h, I get a step further but then it happens with other includes like the poll.h or netdb.h
I am a bit new to Zephyr and especially to ethernet. Maybe someone has an example prj.conf for example for the olimex e407?
My other option would be to use the microros setup with the olimex e407 board and change the device tree before building, so not a high priority, but an example would fit very nicely in this repo I think.
Thanks in advance for any suggestions :)
In file included from /home/jan/micro_ros_zephyr_module/modules/libmicroros/microros_transports/udp/microros_transports.h:21,
from /home/jan/micro_ros_zephyr_module/src/main.c:15:
/home/jan/zephyrproject/zephyr/include/zephyr/net/socket.h:698:19: error: static declaration of 'close' follows non-static declaration
698 | static inline int close(int sock)
| ^~~~~
In file included from /home/jan/zephyr-sdk-0.14.2/arm-zephyr-eabi/arm-zephyr-eabi/sys-include/unistd.h:4,
from /home/jan/micro_ros_zephyr_module/modules/libmicroros/microros_transports/udp/microros_transports.h:18,
from /home/jan/micro_ros_zephyr_module/src/main.c:15:
/home/jan/zephyr-sdk-0.14.2/arm-zephyr-eabi/arm-zephyr-eabi/sys-include/sys/unistd.h:30:9: note: previous declaration of 'close' was here
30 | int close (int __fildes);
| ^~~~~
In file included from /home/jan/micro_ros_zephyr_module/modules/libmicroros/microros_transports/udp/microros_transports.h:22,
from /home/jan/micro_ros_zephyr_module/src/main.c:15:
/home/jan/zephyrproject/zephyr/include/zephyr/posix/poll.h:23:19: error: redefinition of 'poll'
23 | static inline int poll(struct pollfd *fds, int nfds, int timeout)
| ^~~~
In file included from /home/jan/micro_ros_zephyr_module/modules/libmicroros/microros_transports/udp/microros_transports.h:21,
from /home/jan/micro_ros_zephyr_module/src/main.c:15:
/home/jan/zephyrproject/zephyr/include/zephyr/net/socket.h:775:19: note: previous definition of 'poll' was here
775 | static inline int poll(struct zsock_pollfd *fds, int nfds, int timeout)
| ^~~~
It seems the rmw_uros_ping_agent
always returns RMW_RET_ERROR
after the rclc_support_init
is called.
(Please correct me if this is not the right place for this issue)
Two tests were tried to reproduce the problem. The agent was kept alive during the test.
rclc_support_t
, and then check the agent's availability again with ping.AGENT_CONNECTED
state.loop 0|1|2|...
.The firmware keeps connecting to and disconnecting from the agent repeatedly.
The log from the first test (official demo)
[00:00:00.000,000] <inf> can_stm32: Init of CAN_1 done
[00:00:02.478,000] <err> eth_stm32_hal: Failed to enqueue frame into RX queue: -115
[00:00:02.480,000] <inf> uros_transport: Waiting for uROS agent.
[00:00:03.487,000] <inf> uros_transport: Connected to uROS agent and created entities.
[00:00:03.988,000] <inf> uros_transport: Disconnected from agent. Switching to waiting for uROS agent
[00:00:03.996,000] <inf> uros_transport: Waiting for uROS agent.
[00:00:05.004,000] <inf> uros_transport: Connected to uROS agent and created entities.
[00:00:05.504,000] <inf> uros_transport: Disconnected from agent. Switching to waiting for uROS agent
[00:00:05.513,000] <inf> uros_transport: Waiting for uROS agent.
The log from the second test (my custom test)
[00:00:00.000,000] <inf> can_stm32: Init of CAN_1 done
[00:00:02.393,000] <err> eth_stm32_hal: Failed to enqueue frame into RX queue: -115
[00:00:02.394,000] <inf> microros: Found the microros agent.
[00:00:04.396,000] <inf> microros: Disconnect from the microros agent
[00:00:05.397,000] <inf> microros: Found the microros agent.
[00:00:07.400,000] <inf> microros: Disconnect from the microros agent
[00:00:08.400,000] <inf> microros: Found the microros agent.
[00:00:10.402,000] <inf> microros: Disconnect from the microros agent
[00:00:11.403,000] <inf> microros: Found the microros agent.
The program I used for the test is as follows.
#include <stdint.h>
#include "zephyr.h"
#include "zephyr/logging/log.h"
// microros
#include "microros_transports.h"
#include "rcl/rcl.h"
#include "rclc/rclc.h"
#include "rmw_microros/rmw_microros.h"
LOG_MODULE_REGISTER(microros);
#define RCCHECK(fn) \
{ \
rcl_ret_t temp_rc = fn; \
if ((temp_rc != RCL_RET_OK)) { \
LOG_ERR("line %d: error %d.", __LINE__, (int)(temp_rc)); \
} \
}
void main() {
rmw_uros_set_custom_transport(MICRO_ROS_FRAMING_REQUIRED, (void*)(&default_params), &zephyr_transport_open,
&zephyr_transport_close, &zephyr_transport_write, &zephyr_transport_read);
while (true) {
while (rmw_uros_ping_agent(100, 1) != RMW_RET_OK) {
LOG_INF("Waiting for microros agent...");
k_msleep(1000);
}
LOG_INF("Found the microros agent.");
rcl_allocator_t allocator;
rclc_support_t support;
allocator = rcl_get_default_allocator();
RCCHECK(rclc_support_init(&support, 0, NULL, &allocator))
k_msleep(1000);
size_t loop_count = 0;
while (rmw_uros_ping_agent(1000, 1) == RMW_RET_OK) {
LOG_INF("loop %d", loop_count++);
k_msleep(1000);
}
RCCHECK(rclc_support_fini(&support))
LOG_INF("Disconnect from the microros agent");
k_msleep(1000);
}
}
The agent verbose level is set to 4, and the INFO level agent log is as follows.
[1656710159.408739] info | UDPv4AgentLinux.cpp | init | running... | port: 8888
[1656710159.408878] info | Root.cpp | set_verbose_level | logger setup | verbose_level: 4
[1656710160.147612] info | Root.cpp | create_client | create | client_key: 0x57995EE5, session_id: 0x81
[1656710160.147740] info | SessionManager.hpp | establish_session | session established | client_key: 0x57995EE5, address: 10.42.0.2:19125
[1656710162.149116] info | Root.cpp | delete_client | delete | client_key: 0x57995EE5
[1656710162.149203] info | SessionManager.hpp | destroy_session | session closed | client_key: 0x57995EE5, address: 10.42.0.2:19125
[1656710163.151464] info | Root.cpp | create_client | create | client_key: 0x567B653D, session_id: 0x81
[1656710163.151542] info | SessionManager.hpp | establish_session | session established | client_key: 0x567B653D, address: 10.42.0.2:4599
[1656710165.152946] info | Root.cpp | delete_client | delete | client_key: 0x567B653D
[1656710165.153018] info | SessionManager.hpp | destroy_session | session closed | client_key: 0x567B653D, address: 10.42.0.2:4599
Is it possible to use this module on an ESP chip (I'm trying to use it on ESP32)?
I'm able to build 'micro_ros_zephyr_module' using 'west build -b disco_l475_iot1' but I'm having errors caused by 'app.overlay' content when building with 'west build -p auto -b esp32_devkitc_wroom':
-- west build: generating a build systemwroom
Loading Zephyr default modules (Zephyr base).
-- Application: /home/ognjen/zephyrproject/applications/micRobbit-firmware/app/modules/micro_ros_zephyr_module
-- CMake version: 3.22.1
-- Found Python3: /usr/bin/python3 (found suitable version "3.10.12", minimum required is "3.8") found components: Interpreter
-- Cache files will be written to: /home/ognjen/.cache/zephyr
-- Zephyr version: 3.5.99 (/home/ognjen/zephyrproject/zephyr)
-- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
-- Board: esp32_devkitc_wroom
-- ZEPHYR_TOOLCHAIN_VARIANT not set, trying to locate Zephyr SDK
-- Found host-tools: zephyr 0.16.3 (/opt/zephyr-sdk-0.16.3)
-- Found toolchain: zephyr 0.16.3 (/opt/zephyr-sdk-0.16.3)
-- Found Dtc: /opt/zephyr-sdk-0.16.3/sysroots/x86_64-pokysdk-linux/usr/bin/dtc (found suitable version "1.6.0", minimum required is "1.4.6")
-- Found BOARD.dts: /home/ognjen/zephyrproject/zephyr/boards/xtensa/esp32_devkitc_wroom/esp32_devkitc_wroom.dts
-- Found devicetree overlay: /home/ognjen/zephyrproject/applications/micRobbit-firmware/app/modules/micro_ros_zephyr_module/app.overlay
devicetree error: /home/ognjen/zephyrproject/applications/micRobbit-firmware/app/modules/micro_ros_zephyr_module/app.overlay:2 (column 14): parse error: undefined node label 'usbotg_fs'
-- In: /home/ognjen/zephyrproject/applications/micRobbit-firmware/app/modules/micro_ros_zephyr_module/build/zephyr, command: /usr/bin/python3;/home/ognjen/zephyrproject/zephyr/scripts/dts/gen_defines.py;--dts;/home/ognjen/zephyrproject/applications/micRobbit-firmware/app/modules/micro_ros_zephyr_module/build/zephyr/zephyr.dts.pre;--dtc-flags;'';--bindings-dirs;/home/ognjen/zephyrproject/zephyr/dts/bindings;--header-out;/home/ognjen/zephyrproject/applications/micRobbit-firmware/app/modules/micro_ros_zephyr_module/build/zephyr/include/generated/devicetree_generated.h.new;--dts-out;/home/ognjen/zephyrproject/applications/micRobbit-firmware/app/modules/micro_ros_zephyr_module/build/zephyr/zephyr.dts.new;--edt-pickle-out;/home/ognjen/zephyrproject/applications/micRobbit-firmware/app/modules/micro_ros_zephyr_module/build/zephyr/edt.pickle;--vendor-prefixes;/home/ognjen/zephyrproject/zephyr/dts/bindings/vendor-prefixes.txt
CMake Error at /home/ognjen/zephyrproject/zephyr/cmake/modules/dts.cmake:268 (message):
gen_defines.py failed with return code: 1
Call Stack (most recent call first):
/home/ognjen/zephyrproject/zephyr/cmake/modules/zephyr_default.cmake:129 (include)
/home/ognjen/zephyrproject/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
/home/ognjen/zephyrproject/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
CMakeLists.txt:7 (find_package)
-- Configuring incomplete, errors occurred!
FATAL ERROR: command exited with status 1: /usr/bin/cmake -DWEST_PYTHON=/usr/bin/python3 -B/home/ognjen/zephyrproject/applications/micRobbit-firmware/app/modules/micro_ros_zephyr_module/build -GNinja -DBOARD=esp32_devkitc_wroom -S/home/ognjen/zephyrproject/applications/micRobbit-firmware/app/modules/micro_ros_zephyr_module
I found in this issue statement that this module should be usable on any board supported by Zephyr.
Thanks in advance.
I am trying to include custom messages in the microros build, is this currently possible using this module? Any help on this would be appreciated.
Here is the feature I would like to use:
https://micro.ros.org/docs/tutorials/advanced/create_new_type/
Hai, I am trying ping_pong example with Nucleo-G474RE board. I have added 'nucleo_g474re' to the CMakeLists.txt file.
After building and flashing the firmware, created the microROS agent and built. Then I run the agent and it shows in the first figure.
Then in a new terminal, I tried to echo the microROS topic using the following command,
'ros2 topic echo /microROS/ping'
But it shows the error
"topic [/microROS/ping] does not appear to be published yet Could not determine the type for the passed topic"
This shows in the second figure.
I tried it with both serial and serial-usb transport.
I tried it by adding '-v6' to agent run command.
I tried it by setting ROS_DOMAIN_ID=0 in all terminals.
But the error is not resolved.
Please advise me how to solve this problem.
Thank you.
Sachin
When Zephyr Project resolves zephyrproject-rtos/zephyr#28438, update module to follow example interfacing pattern for out-of-tree modules.
Hardware description: Nucleo F746ZG
RTOS: Zephyr 3.1.99, Zephyr SDK 0.14.0
Installation type: micro_ros_zephyr_module
Version or commit hash: humble
Transport: UDP IPv4
Agent: microros/micro-ros-agent:humble docker image
The issue is seen when the agent is already running on the host PC and the microROS device is started after. The microROS code first pings the agent to identify its presence and then proceeds to creating microROS entities. Could this in anyway be connected to HARD_LIVELINESS_CHECK
? Do we need to have this check present to avoid the agent from sending invalid data to microROS and hence microROS failing to init nodes?
No error codes on calling rclc_node_init_default
Error code 1 on RCCHECK(rclc_node_init_default(&node, "zephyr_benchmark", "", &support))
.
Block of relevant code used
rmw_uros_set_custom_transport(MICRO_ROS_FRAMING_REQUIRED, static_cast<void*>(&default_params), zephyr_transport_open,
zephyr_transport_close, zephyr_transport_write, zephyr_transport_read);
while (true) {
while (rmw_uros_ping_agent(ping_timeout, 2) != RMW_RET_OK) {
LOG_ERR("Wait for agent...");
}
LOG_INF("Agent connected.");
allocator = rcl_get_default_allocator();
RCCHECK(rclc_support_init(&support, 0, nullptr, &allocator))
RCCHECK(rclc_node_init_default(&node, "zephyr_benchmark", "", &support))
}
Using the above configuration, I am trying to create and use 4 services that use trigger std messages.
All 4 services have been added to the executor, but for the last 2 services rclc_service_init_best_effort returns RCL_RET_ERROR.
Using the CLI on a computer connected to the ROS network
ros2 service call [tab autocomplete] displays 4 services.
Also service call CLI commands do not get a response.
Using the CLI on a computer connected to the ROS network
ros2 service call [tab autocomplete] displays 2 services.
Also service call CLI commands do get a response.
Hardware description:
nucleo_h743zi
RTOS:
Installation type:
Version or commit hash:
Humble
We are moving towards zephyr microros module from the non-module style.
There are a couple of services we are using, specifically trigger style service.
There used to be a std_srvs/srv under /mcu_ws/install/include/std_srvs/ in the non-module style and using it as below seemed to work.
I'm unable to find the std services in the module solution. Has it moved?
This is what my modules/libmicroros/include folder looks like:
Thank you!
Hello,
I'm more familiar with the old style of using zephyr(micro_ros_setup). My issues was here, and have been directed here.
Questions:
Using the nightly workflow as a template, I create a docker image based off Ubuntu 22.04, with necessary apt installs. Once built, under a container, I have a build script(z.sh) which gets sourced(source z.sh), with necessary zephyr sdk install. Any guidance/comments on this setup?
z.txt
Once the above script finishes, I clone micro_ros_zephyr_module under zephyrproject/zephyr, then build using
west build -p always -b disco_l475_iot1 micro_ros_zephyr_module
but building with any other board fails:
west build -p always -b nucleo_h743zi micro_ros_zephyr_module
with alot of redifinition errors(see redefinition.log). There is another issue detailing this, but I'm on v3.1 and sdk 0.14.2. I made sure to checkout v3.1 of zephyr.
redefinition.log
3.In the old method, one could change the transport. We are using udp. How does one do that here and configure microros. Is that required now?
After cloning a fresh copy of micro ROS module for zephyr I was not able to build because problems with posix time implementation for Zephyr. It seems the current humble release is not reflecting the fix that was submitted to the rcutils: ros2/rcutils#390
It shoud build the binary to be flashed to the board using west flash
It fails during the build, pointing error in the posix/time.h path for zephyr.
I try to build add two int service, but i have problem with adding extra package. I don't know how to add example_interfaces
, in CMakeList.txt
Compile
Don't compile
I create service client example from zephyr_apps, but using zephyr_module
I am trying to run the Zephyr emulator tutorial in a VS code's dev container using a ros:humble image.
I cloned the Micro-ROS setup repo and launched the dev container which is running rosdep and building the initial workspace.
Create step is effectively creating the firmware folder.
The create step yields the following error (when running pip install --force-reinstall Sphinx==4.2.0
):
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
sphinx-tabs 3.2.0 requires docutils~=0.16.0, but you have docutils 0.17.1 which is incompatible.
sphinx-rtd-theme 0.5.2 requires docutils<0.17, but you have docutils 0.17.1 which is incompatible.
It looks like the conflicts are coming from firmware/zephyrproject/zephyr/scripts/requirements-doc.txt
where specified sphinx version is 3.*
I reproduce steps like on website https://micro.ros.org/docs/tutorials/core/first_application_rtos/zephyr/
I tried pin_pong app and int32_publisher but I used serial
config
But to run it on my board I added my board name in CMakeList.txt and also changed in microro_tranpsort.h fd:
// Set the UART used for communication. e.g. {.fd = 0} leads to UART_0 being used.
static zephyr_transport_params_t default_params = {.fd = 0};
to .fd=1
.
I flash the board by st-link, but for connection I use UART-USB concerter
ros2 run micro_ros_agent micro_ros_agent serial --dev /dev/serial/by-id/usb-Silicon_Labs_CP2102N_USB_to_UART_Bridge_Controller_c68cb4bd91ecec11be34ac0ead51a8b2-if00-port0
[1612884194.563610] info | TermiosAgentLinux.cpp | init | running... | fd: 3
[1612884194.563954] info | Root.cpp | set_verbose_level | logger setup | verbose_level: 6
I want to have a new publisher ping
in ros2 topics, but for now i only have 2 default. This is what I expect:
user@user:~$ ros2 topic echo /microROS/ping
stamp:
sec: 20
nanosec: 867000000
frame_id: '1344887256_1085377743'
---
stamp:
sec: 25
nanosec: 942000000
frame_id: '730417256_1085377743'
---
Is there anything to add or what should I change?
I think the problem is in connection between board and my pc, I work on ubnutu 22.04.3, but I don't know why it's starts to running because if there wasn't connection it would show waiting for connection
Hi, I'm having a build issue with the rcutils package after doing a clean zephyr workspace setup and then cloning the repo:
I'm on Ubuntu 20.04, with zephyr-sdk 0.14.2
West and cmake versions are shown at the bottom...
Any guidance would be highly appreciated. I've been able to successfully build Zephyr+MicroROS using the micro_ros_setup ROS2 package, but I'd prefer to use the zephyr module since I have a lot of existing zephyr-based applications already.
Starting >>> rcl_logging_interface
--- stderr: rosidl_runtime_c
CMake Warning at /home/chris.granz/zephyrproject/micro_ros_zephyr_module/modules/libmicroros/micro_ros_src/install/share/rcutils/cmake/ament_cmake_export_libraries-extras.cmake:116 (message):
Package 'rcutils' exports library 'dl' which couldn't be found
Call Stack (most recent call first):
/home/chris.granz/zephyrproject/micro_ros_zephyr_module/modules/libmicroros/micro_ros_src/install/share/rcutils/cmake/rcutilsConfig.cmake:41 (include)
CMakeLists.txt:15 (find_package)
CMake Error at /home/chris.granz/zephyrproject/micro_ros_zephyr_module/modules/libmicroros/micro_ros_src/install/share/rcutils/cmake/ament_cmake_export_targets-extras.cmake:18 (message):
Failed to find exported target names in
'/home/chris.granz/zephyrproject/micro_ros_zephyr_module/modules/libmicroros/micro_ros_src/install/share/rcutils/cmake/rcutilsExport.cmake'
Call Stack (most recent call first):
/home/chris.granz/zephyrproject/micro_ros_zephyr_module/modules/libmicroros/micro_ros_src/install/share/rcutils/cmake/rcutilsConfig.cmake:41 (include)
CMakeLists.txt:15 (find_package)
---
Failed <<< rosidl_runtime_c [0.46s, exited with code 1]
Aborted <<< rcl_logging_interface [0.43s]
Aborted <<< tracetools_read [3.54s]
Aborted <<< tracetools_trace [3.66s]
Aborted <<< rosidl_cli [3.81s]
Aborted <<< microxrcedds_client [1.63s]
Summary: 6 packages finished [5.94s]
1 package failed: rosidl_runtime_c
5 packages aborted: microxrcedds_client rcl_logging_interface rosidl_cli tracetools_read tracetools_trace
5 packages had stderr output: microcdr microxrcedds_client rcl_logging_interface rcutils rosidl_runtime_c
50 packages not processed
make: *** [libmicroros.mk:103: /home/chris.granz/zephyrproject/micro_ros_zephyr_module/modules/libmicroros/micro_ros_src/install] Error 1
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: /usr/bin/cmake --build /home/chris.granz/zephyrproject/build
chris.granz@dell-fd6b163:~/zephyrproject$ west --version
West version: v0.13.1
chris.granz@dell-fd6b163:~/zephyrproject$ cmake --version
cmake version 3.24.0
Hello,
Our code base is cpp based and works well with the non-module style of microros on zephyr.
However, with this repo(module based), I get build errors when the following two flags are added to prj.conf:
If the below two flags are removed, the default project compiles ok.
CONFIG_CPLUSPLUS=y
CONFIG_LIB_CPLUSPLUS=y
Build succeeds.
Build failure
/ws/zephyr-sdk-0.14.2/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.3.0/../../../../arm-zephyr-eabi/bin/ld.bfd: ../modules/libmicroros/libmicroros.a(libtest_msgs__rosidl_generator_c-arrays__functions.c.obj): in function `test_msgs__srv__Arrays_Request__init':
/ws/micro_ros_zephyr_module/modules/libmicroros/micro_ros_src/build/test_msgs/rosidl_generator_c/test_msgs/srv/detail/arrays__functions.c:52: undefined reference to `test_msgs__msg__BasicTypes__init
https://gist.github.com/rosterloh/5b66d993c62bc975d5ca6bbe0ade1fa0
ros2 service call /control gardin_interfaces/srv/Control
waiting for service to become available...
requester: making request: gardin_interfaces.srv.Control_Request(module=0, command=0)
[00:00:07.571,000] main: Service request value: 193: 202.
[00:00:15.858,000] main: Service request value: 10: 72.
[00:00:59.142,000] main: Service request value: 36: 203.
[00:01:01.874,000] main: Service request value: 195: 121.
I have written an implementation for CAN-FD transport for Zephyr, since the Agent already supports it.
And it is working very well. Significantly better than USB-CDC and UART for what I have personally tested. I would be happy to submit a PR for it. However, I wrote using Zephyr 3.5, and this module is officially only supported for 2.7.5 and 3.1. The CAN api changed slightly on 3.3, only the frame and filter structs , I think, thus my implementation won't work right away. I don't have problems modifying in to work with 3.1. However, I would like to know from the maintainers, what is the roadmap with respect to Zephyr versions and microROS distros , because 3.1 is quite old now, and EOL. Will rolling be updated to the latest Zephyr version (3.6 at this moment ) ?. That way , I will just submit my current implementation and we can backport it to Humble and Iron. Otherwise, I will submit the PR for 3.1. I would just like to get some feedback about what would the maintainers prefer.
micro-ROS library should build and application should link
micro-ROS library fails to build
[143/159] Performing build step for 'libmicroros_project'
FAILED: libmicroros-prefix/src/libmicroros_project-stamp/libmicroros_project-build /home/rosterloh/zephyrproject/extras/lib/microros/libmicroros.a
cd /home/rosterloh/zephyrproject/extras/lib/microros && make -f libmicroros.mk "X_CFLAGS=-I/home/rosterloh/zephyrproject/zephyr/include -I/home/rosterloh/zephyrproject/build/zephyr/include/generated -I/home/rosterloh/zephyrproject/zephyr/soc/arm/st_stm32/stm32f4 -I/home/rosterloh/zephyrproject/zephyr/lib/libc/newlib/include -I/home/rosterloh/zephyrproject/zephyr/drivers -I/home/rosterloh/zephyrproject/zephyr/soc/arm/st_stm32/common -I/home/rosterloh/zephyrproject/zephyr/subsys/usb -I/home/rosterloh/zephyrproject/modules/hal/cmsis/CMSIS/Core/Include -I/home/rosterloh/zephyrproject/modules/hal/stm32/stm32cube/stm32f4xx/soc -I/home/rosterloh/zephyrproject/modules/hal/stm32/stm32cube/stm32f4xx/drivers/include -I/home/rosterloh/zephyrproject/modules/hal/stm32/stm32cube/stm32f4xx/drivers/include/Legacy -I/home/rosterloh/zephyrproject/modules/hal/stm32/stm32cube/common_ll/include -I/home/rosterloh/zephyrproject/extras/include -DKERNEL -D__ZEPHYR__=1 -D_FORTIFY_SOURCE=2 -DBUILD_VERSION=zephyr-v2.6.0-495-gf5b0f92bb718 -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -DSTM32F405xx -DUSE_HAL_DRIVER -DUSE_FULL_LL_DRIVER -DCORE_CM4 -DHSE_VALUE=12000000 -Os -imacros /home/rosterloh/zephyrproject/build/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m4 -mthumb -mabi=aapcs -imacros /home/rosterloh/zephyrproject/zephyr/include/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-address-of-packed-member -Wno-unused-but-set-variable -Werror=implicit-int -fno-asynchronous-unwind-tables -fno-pie -fno-pic -fno-strict-overflow -fno-reorder-functions -fno-defer-pop -fmacro-prefix-map=/home/rosterloh/zephyrproject/extras/applications/uros=CMAKE_SOURCE_DIR -fmacro-prefix-map=/home/rosterloh/zephyrproject/zephyr=ZEPHYR_BASE -fmacro-prefix-map=/home/rosterloh/zephyrproject=WEST_TOPDIR -ffunction-sections -fdata-sections " "X_CXXFLAGS=-I/home/rosterloh/zephyrproject/zephyr/include -I/home/rosterloh/zephyrproject/build/zephyr/include/generated -I/home/rosterloh/zephyrproject/zephyr/soc/arm/st_stm32/stm32f4 -I/home/rosterloh/zephyrproject/zephyr/lib/libc/newlib/include -I/home/rosterloh/zephyrproject/zephyr/drivers -I/home/rosterloh/zephyrproject/zephyr/soc/arm/st_stm32/common -I/home/rosterloh/zephyrproject/zephyr/subsys/usb -I/home/rosterloh/zephyrproject/modules/hal/cmsis/CMSIS/Core/Include -I/home/rosterloh/zephyrproject/modules/hal/stm32/stm32cube/stm32f4xx/soc -I/home/rosterloh/zephyrproject/modules/hal/stm32/stm32cube/stm32f4xx/drivers/include -I/home/rosterloh/zephyrproject/modules/hal/stm32/stm32cube/stm32f4xx/drivers/include/Legacy -I/home/rosterloh/zephyrproject/modules/hal/stm32/stm32cube/common_ll/include -I/home/rosterloh/zephyrproject/extras/include -DKERNEL -D__ZEPHYR__=1 -D_FORTIFY_SOURCE=2 -DBUILD_VERSION=zephyr-v2.6.0-495-gf5b0f92bb718 -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -DSTM32F405xx -DUSE_HAL_DRIVER -DUSE_FULL_LL_DRIVER -DCORE_CM4 -DHSE_VALUE=12000000 -Os -fcheck-new -fno-exceptions -fno-rtti -imacros /home/rosterloh/zephyrproject/build/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m4 -mthumb -mabi=aapcs -imacros /home/rosterloh/zephyrproject/zephyr/include/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-address-of-packed-member -Wno-unused-but-set-variable -fno-asynchronous-unwind-tables -fno-pie -fno-pic -fno-strict-overflow -fno-reorder-functions -fno-defer-pop -fmacro-prefix-map=/home/rosterloh/zephyrproject/extras/applications/uros=CMAKE_SOURCE_DIR -fmacro-prefix-map=/home/rosterloh/zephyrproject/zephyr=ZEPHYR_BASE -fmacro-prefix-map=/home/rosterloh/zephyrproject=WEST_TOPDIR -ffunction-sections -fdata-sections " X_CC=/home/rosterloh/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc X_AR=/home/rosterloh/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-ar X_RANLIB=/home/rosterloh/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-ranlib X_CXX=/home/rosterloh/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-g++ COMPONENT_PATH=/home/rosterloh/zephyrproject/zephyr/../extras/lib/microros ZEPHYR_BASE=/home/rosterloh/zephyrproject/zephyr PROJECT_BINARY_DIR=/home/rosterloh/zephyrproject/build/zephyr && /usr/bin/cmake -E touch /home/rosterloh/zephyrproject/build/libmicroros-prefix/src/libmicroros_project-stamp/libmicroros_project-build
. /home/rosterloh/zephyrproject/zephyr/../extras/lib/microros/utils.sh; \
cp /home/rosterloh/zephyrproject/zephyr/../extras/lib/microros/colcon.meta /home/rosterloh/zephyrproject/zephyr/../extras/lib/microros/configured_colcon.meta; \
ZEPHYR_CONF_FILE=/home/rosterloh/zephyrproject/build/zephyr/.config; \
update_meta_from_zephyr_config "CONFIG_MICROROS_NODES" "rmw_microxrcedds" "RMW_UXRCE_MAX_NODES"; \
update_meta_from_zephyr_config "CONFIG_MICROROS_PUBLISHERS" "rmw_microxrcedds" "RMW_UXRCE_MAX_PUBLISHERS"; \
update_meta_from_zephyr_config "CONFIG_MICROROS_SUBSCRIBERS" "rmw_microxrcedds" "RMW_UXRCE_MAX_SUBSCRIPTIONS"; \
update_meta_from_zephyr_config "CONFIG_MICROROS_CLIENTS" "rmw_microxrcedds" "RMW_UXRCE_MAX_CLIENTS"; \
update_meta_from_zephyr_config "CONFIG_MICROROS_SERVERS" "rmw_microxrcedds" "RMW_UXRCE_MAX_SERVICES"; \
update_meta_from_zephyr_config "CONFIG_MICROROS_RMW_HISTORIC" "rmw_microxrcedds" "RMW_UXRCE_MAX_HISTORY"; \
update_meta_from_zephyr_config "CONFIG_MICROROS_XRCE_DDS_HISTORIC" "rmw_microxrcedds" "RMW_UXRCE_STREAM_HISTORY"; \
update_meta "microxrcedds_client" "UCLIENT_PROFILE_SERIAL=OFF"; \
update_meta "microxrcedds_client" "UCLIENT_PROFILE_UDP=OFF"; \
update_meta "microxrcedds_client" "UCLIENT_PROFILE_TCP=OFF"; \
update_meta "microxrcedds_client" "UCLIENT_PROFILE_CUSTOM_TRANSPORT=ON"; \
update_meta "microxrcedds_client" "UCLIENT_PROFILE_STREAM_FRAMING=ON"; \
update_meta "rmw_microxrcedds" "RMW_UXRCE_TRANSPORT=custom";
rm -f /home/rosterloh/zephyrproject/zephyr/../extras/lib/microros/zephyr_toolchain.cmake; \
cat /home/rosterloh/zephyrproject/zephyr/../extras/lib/microros/zephyr_toolchain.cmake.in | \
sed "s/@CMAKE_C_COMPILER@/\/home\/rosterloh\/zephyr-sdk\/arm-zephyr-eabi\/bin\/arm-zephyr-eabi-gcc/g" | \
sed "s/@CMAKE_CXX_COMPILER@/\/home\/rosterloh\/zephyr-sdk\/arm-zephyr-eabi\/bin\/arm-zephyr-eabi-g++/g" | \
sed "s/@CMAKE_SYSROOT@/\/home\/rosterloh\/zephyrproject\/zephyr\/..\/extras\/lib\/microros/g" | \
sed "s/@CFLAGS@/-c -I\/home\/rosterloh\/zephyrproject\/zephyr\/include\/posix -I\/home\/rosterloh\/zephyrproject\/build\/zephyr\/include\/generated -I\/home\/rosterloh\/zephyrproject\/zephyr\/include -I\/home\/rosterloh\/zephyrproject\/build\/zephyr\/include\/generated -I\/home\/rosterloh\/zephyrproject\/zephyr\/soc\/arm\/st_stm32\/stm32f4 -I\/home\/rosterloh\/zephyrproject\/zephyr\/lib\/libc\/newlib\/include -I\/home\/rosterloh\/zephyrproject\/zephyr\/drivers -I\/home\/rosterloh\/zephyrproject\/zephyr\/soc\/arm\/st_stm32\/common -I\/home\/rosterloh\/zephyrproject\/zephyr\/subsys\/usb -I\/home\/rosterloh\/zephyrproject\/modules\/hal\/cmsis\/CMSIS\/Core\/Include -I\/home\/rosterloh\/zephyrproject\/modules\/hal\/stm32\/stm32cube\/stm32f4xx\/soc -I\/home\/rosterloh\/zephyrproject\/modules\/hal\/stm32\/stm32cube\/stm32f4xx\/drivers\/include -I\/home\/rosterloh\/zephyrproject\/modules\/hal\/stm32\/stm32cube\/stm32f4xx\/drivers\/include\/Legacy -I\/home\/rosterloh\/zephyrproject\/modules\/hal\/stm32\/stm32cube\/common_ll\/include -I\/home\/rosterloh\/zephyrproject\/extras\/include -DKERNEL -D__ZEPHYR__=1 -D_FORTIFY_SOURCE=2 -DBUILD_VERSION=zephyr-v2.6.0-495-gf5b0f92bb718 -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -DSTM32F405xx -DUSE_HAL_DRIVER -DUSE_FULL_LL_DRIVER -DCORE_CM4 -DHSE_VALUE=12000000 -Os -imacros \/home\/rosterloh\/zephyrproject\/build\/zephyr\/include\/generated\/autoconf.h -ffreestanding -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m4 -mthumb -mabi=aapcs -imacros \/home\/rosterloh\/zephyrproject\/zephyr\/include\/toolchain\/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-address-of-packed-member -Wno-unused-but-set-variable -Werror=implicit-int -fno-asynchronous-unwind-tables -fno-pie -fno-pic -fno-strict-overflow -fno-reorder-functions -fno-defer-pop -fmacro-prefix-map=\/home\/rosterloh\/zephyrproject\/extras\/applications\/uros=CMAKE_SOURCE_DIR -fmacro-prefix-map=\/home\/rosterloh\/zephyrproject\/zephyr=ZEPHYR_BASE -fmacro-prefix-map=\/home\/rosterloh\/zephyrproject=WEST_TOPDIR -ffunction-sections -fdata-sections /g" | \
sed "s/@CXXFLAGS@/-c -I\/home\/rosterloh\/zephyrproject\/zephyr\/include\/posix -I\/home\/rosterloh\/zephyrproject\/build\/zephyr\/include\/generated -I\/home\/rosterloh\/zephyrproject\/zephyr\/include -I\/home\/rosterloh\/zephyrproject\/build\/zephyr\/include\/generated -I\/home\/rosterloh\/zephyrproject\/zephyr\/soc\/arm\/st_stm32\/stm32f4 -I\/home\/rosterloh\/zephyrproject\/zephyr\/lib\/libc\/newlib\/include -I\/home\/rosterloh\/zephyrproject\/zephyr\/drivers -I\/home\/rosterloh\/zephyrproject\/zephyr\/soc\/arm\/st_stm32\/common -I\/home\/rosterloh\/zephyrproject\/zephyr\/subsys\/usb -I\/home\/rosterloh\/zephyrproject\/modules\/hal\/cmsis\/CMSIS\/Core\/Include -I\/home\/rosterloh\/zephyrproject\/modules\/hal\/stm32\/stm32cube\/stm32f4xx\/soc -I\/home\/rosterloh\/zephyrproject\/modules\/hal\/stm32\/stm32cube\/stm32f4xx\/drivers\/include -I\/home\/rosterloh\/zephyrproject\/modules\/hal\/stm32\/stm32cube\/stm32f4xx\/drivers\/include\/Legacy -I\/home\/rosterloh\/zephyrproject\/modules\/hal\/stm32\/stm32cube\/common_ll\/include -I\/home\/rosterloh\/zephyrproject\/extras\/include -DKERNEL -D__ZEPHYR__=1 -D_FORTIFY_SOURCE=2 -DBUILD_VERSION=zephyr-v2.6.0-495-gf5b0f92bb718 -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -DSTM32F405xx -DUSE_HAL_DRIVER -DUSE_FULL_LL_DRIVER -DCORE_CM4 -DHSE_VALUE=12000000 -Os -fcheck-new -fno-exceptions -fno-rtti -imacros \/home\/rosterloh\/zephyrproject\/build\/zephyr\/include\/generated\/autoconf.h -ffreestanding -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m4 -mthumb -mabi=aapcs -imacros \/home\/rosterloh\/zephyrproject\/zephyr\/include\/toolchain\/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-address-of-packed-member -Wno-unused-but-set-variable -fno-asynchronous-unwind-tables -fno-pie -fno-pic -fno-strict-overflow -fno-reorder-functions -fno-defer-pop -fmacro-prefix-map=\/home\/rosterloh\/zephyrproject\/extras\/applications\/uros=CMAKE_SOURCE_DIR -fmacro-prefix-map=\/home\/rosterloh\/zephyrproject\/zephyr=ZEPHYR_BASE -fmacro-prefix-map=\/home\/rosterloh\/zephyrproject=WEST_TOPDIR -ffunction-sections -fdata-sections /g" \
> /home/rosterloh/zephyrproject/zephyr/../extras/lib/microros/zephyr_toolchain.cmake
cd /home/rosterloh/zephyrproject/zephyr/../extras/lib/microros/micro_ros_src; \
. ../micro_ros_dev/install/local_setup.sh; \
colcon build \
--merge-install \
--packages-ignore-regex=.*_cpp \
--metas /home/rosterloh/zephyrproject/zephyr/../extras/lib/microros/configured_colcon.meta \
--cmake-args \
"--no-warn-unused-cli" \
-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=OFF \
-DTHIRDPARTY=ON \
-DBUILD_SHARED_LIBS=OFF \
-DBUILD_TESTING=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE=/home/rosterloh/zephyrproject/zephyr/../extras/lib/microros/zephyr_toolchain.cmake \
-DCMAKE_VERBOSE_MAKEFILE=OFF; \
Starting >>> rcutils
Starting >>> rosidl_cli
Starting >>> rosidl_typesupport_interface
Starting >>> microcdr
Finished <<< rosidl_cli [1.49s]
Starting >>> rosidl_adapter
Finished <<< rosidl_typesupport_interface [1.71s]
Starting >>> rmw_implementation_cmake
--- stderr: microcdr
In file included from /home/rosterloh/zephyrproject/extras/lib/microros/micro_ros_src/src/micro-CDR/include/ucdr/microcdr.h:25,
from /home/rosterloh/zephyrproject/extras/lib/microros/micro_ros_src/src/micro-CDR/src/c/types/../common_internal.h:22,
from /home/rosterloh/zephyrproject/extras/lib/microros/micro_ros_src/src/micro-CDR/src/c/types/basic.c:15:
/home/rosterloh/zephyrproject/zephyr/lib/libc/newlib/include/stdint.h:28:2: warning: #include_next is a GCC extension
28 | #include_next <stdint.h>
| ^~~~~~~~~~~~
In file included from /home/rosterloh/zephyrproject/extras/lib/microros/micro_ros_src/src/micro-CDR/include/ucdr/microcdr.h:25,
from /home/rosterloh/zephyrproject/extras/lib/microros/micro_ros_src/src/micro-CDR/src/c/common_internal.h:22,
from /home/rosterloh/zephyrproject/extras/lib/microros/micro_ros_src/src/micro-CDR/src/c/common.c:15:
/home/rosterloh/zephyrproject/zephyr/lib/libc/newlib/include/stdint.h:28:2: warning: #include_next is a GCC extension
28 | #include_next <stdint.h>
| ^~~~~~~~~~~~
In file included from /home/rosterloh/zephyrproject/extras/lib/microros/micro_ros_src/src/micro-CDR/include/ucdr/microcdr.h:25,
from /home/rosterloh/zephyrproject/extras/lib/microros/micro_ros_src/src/micro-CDR/src/c/types/string.c:16:
/home/rosterloh/zephyrproject/zephyr/lib/libc/newlib/include/stdint.h:28:2: warning: #include_next is a GCC extension
28 | #include_next <stdint.h>
| ^~~~~~~~~~~~
In file included from /home/rosterloh/zephyrproject/extras/lib/microros/micro_ros_src/src/micro-CDR/include/ucdr/microcdr.h:25,
from /home/rosterloh/zephyrproject/extras/lib/microros/micro_ros_src/src/micro-CDR/src/c/types/../common_internal.h:22,
from /home/rosterloh/zephyrproject/extras/lib/microros/micro_ros_src/src/micro-CDR/src/c/types/array.c:15:
/home/rosterloh/zephyrproject/zephyr/lib/libc/newlib/include/stdint.h:28:2: warning: #include_next is a GCC extension
28 | #include_next <stdint.h>
| ^~~~~~~~~~~~
In file included from /home/rosterloh/zephyrproject/extras/lib/microros/micro_ros_src/src/micro-CDR/include/ucdr/microcdr.h:25,
from /home/rosterloh/zephyrproject/extras/lib/microros/micro_ros_src/src/micro-CDR/src/c/types/sequence.c:15:
/home/rosterloh/zephyrproject/zephyr/lib/libc/newlib/include/stdint.h:28:2: warning: #include_next is a GCC extension
28 | #include_next <stdint.h>
| ^~~~~~~~~~~~
---
Finished <<< microcdr [2.17s]
Starting >>> microxrcedds_client
Finished <<< rmw_implementation_cmake [0.90s]
Starting >>> tracetools
--- stderr: rcutils
In file included from /home/rosterloh/zephyrproject/extras/lib/microros/micro_ros_src/src/rcutils/include/rcutils/error_handling.h:31,
from /home/rosterloh/zephyrproject/extras/lib/microros/micro_ros_src/src/rcutils/src/array_list.c:23:
/home/rosterloh/zephyrproject/zephyr/lib/libc/newlib/include/stdint.h:28:2: warning: #include_next is a GCC extension
28 | #include_next <stdint.h>
| ^~~~~~~~~~~~
In file included from /home/rosterloh/zephyrproject/zephyr/include/posix/sys/select.h:9,
from /home/rosterloh/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/sys-include/sys/types.h:50,
from /home/rosterloh/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/sys-include/stdio.h:61,
from /home/rosterloh/zephyrproject/extras/lib/microros/micro_ros_src/src/rcutils/src/allocator.c:16:
/home/rosterloh/zephyrproject/zephyr/include/net/socket_select.h:44:10: error: expected ';' before 'int'
44 | __syscall int zsock_select(int nfds, zsock_fd_set *readfds,
| ^~~~
| ;
In file included from /home/rosterloh/zephyrproject/build/zephyr/include/generated/syscalls/socket_select.h:10,
from /home/rosterloh/zephyrproject/zephyr/include/net/socket_select.h:147,
from /home/rosterloh/zephyrproject/zephyr/include/posix/sys/select.h:9,
from /home/rosterloh/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/sys-include/sys/types.h:50,
from /home/rosterloh/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/sys-include/stdio.h:61,
from /home/rosterloh/zephyrproject/extras/lib/microros/micro_ros_src/src/rcutils/src/allocator.c:16:
/home/rosterloh/zephyrproject/zephyr/include/syscall.h:93:21: error: expected ';' before '_Bool'
93 | static ALWAYS_INLINE bool z_syscall_trap(void)
| ^
| ;
In file included from /home/rosterloh/zephyrproject/zephyr/include/net/socket_select.h:147,
from /home/rosterloh/zephyrproject/zephyr/include/posix/sys/select.h:9,
from /home/rosterloh/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/sys-include/sys/types.h:50,
from /home/rosterloh/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/sys-include/stdio.h:61,
from /home/rosterloh/zephyrproject/extras/lib/microros/micro_ros_src/src/rcutils/src/allocator.c:16:
/home/rosterloh/zephyrproject/build/zephyr/include/generated/syscalls/socket_select.h:26:19: error: static declaration of 'zsock_select' follows non-static declaration
26 | static inline int zsock_select(int nfds, zsock_fd_set * readfds, zsock_fd_set * writefds, zsock_fd_set * exceptfds, struct zsock_timeval * timeout)
| ^~~~~~~~~~~~
In file included from /home/rosterloh/zephyrproject/zephyr/include/posix/sys/select.h:9,
from /home/rosterloh/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/sys-include/sys/types.h:50,
from /home/rosterloh/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/sys-include/stdio.h:61,
from /home/rosterloh/zephyrproject/extras/lib/microros/micro_ros_src/src/rcutils/src/allocator.c:16:
/home/rosterloh/zephyrproject/zephyr/include/net/socket_select.h:44:15: note: previous declaration of 'zsock_select' was here
44 | __syscall int zsock_select(int nfds, zsock_fd_set *readfds,
| ^~~~~~~~~~~~
In file included from /home/rosterloh/zephyrproject/zephyr/include/posix/sys/select.h:9,
from /home/rosterloh/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/sys-include/sys/types.h:50,
from /home/rosterloh/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/sys-include/stdio.h:61,
from /home/rosterloh/zephyrproject/extras/lib/microros/micro_ros_src/src/rcutils/include/rcutils/error_handling.h:32,
from /home/rosterloh/zephyrproject/extras/lib/microros/micro_ros_src/src/rcutils/src/array_list.c:23:
/home/rosterloh/zephyrproject/zephyr/include/net/socket_select.h:44:10: error: expected ';' before 'int'
44 | __syscall int zsock_select(int nfds, zsock_fd_set *readfds,
| ^~~~
| ;
In file included from /home/rosterloh/zephyrproject/build/zephyr/include/generated/syscalls/socket_select.h:10,
from /home/rosterloh/zephyrproject/zephyr/include/net/socket_select.h:147,
from /home/rosterloh/zephyrproject/zephyr/include/posix/sys/select.h:9,
from /home/rosterloh/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/sys-include/sys/types.h:50,
from /home/rosterloh/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/sys-include/stdio.h:61,
from /home/rosterloh/zephyrproject/extras/lib/microros/micro_ros_src/src/rcutils/include/rcutils/error_handling.h:32,
from /home/rosterloh/zephyrproject/extras/lib/microros/micro_ros_src/src/rcutils/src/array_list.c:23:
/home/rosterloh/zephyrproject/zephyr/include/syscall.h:93:21: error: expected ';' before '_Bool'
93 | static ALWAYS_INLINE bool z_syscall_trap(void)
| ^
| ;
In file included from /home/rosterloh/zephyrproject/zephyr/include/net/socket_select.h:147,
from /home/rosterloh/zephyrproject/zephyr/include/posix/sys/select.h:9,
from /home/rosterloh/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/sys-include/sys/types.h:50,
from /home/rosterloh/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/sys-include/stdio.h:61,
from /home/rosterloh/zephyrproject/extras/lib/microros/micro_ros_src/src/rcutils/include/rcutils/error_handling.h:32,
from /home/rosterloh/zephyrproject/extras/lib/microros/micro_ros_src/src/rcutils/src/array_list.c:23:
/home/rosterloh/zephyrproject/build/zephyr/include/generated/syscalls/socket_select.h:26:19: error: static declaration of 'zsock_select' follows non-static declaration
26 | static inline int zsock_select(int nfds, zsock_fd_set * readfds, zsock_fd_set * writefds, zsock_fd_set * exceptfds, struct zsock_timeval * timeout)
| ^~~~~~~~~~~~
In file included from /home/rosterloh/zephyrproject/zephyr/include/posix/sys/select.h:9,
from /home/rosterloh/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/sys-include/sys/types.h:50,
from /home/rosterloh/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/sys-include/stdio.h:61,
from /home/rosterloh/zephyrproject/extras/lib/microros/micro_ros_src/src/rcutils/include/rcutils/error_handling.h:32,
from /home/rosterloh/zephyrproject/extras/lib/microros/micro_ros_src/src/rcutils/src/array_list.c:23:
/home/rosterloh/zephyrproject/zephyr/include/net/socket_select.h:44:15: note: previous declaration of 'zsock_select' was here
44 | __syscall int zsock_select(int nfds, zsock_fd_set *readfds,
| ^~~~~~~~~~~~
In file included from /home/rosterloh/zephyrproject/extras/lib/microros/micro_ros_src/src/rcutils/include/rcutils/error_handling.h:31,
from /home/rosterloh/zephyrproject/extras/lib/microros/micro_ros_src/src/rcutils/src/char_array.c:16:
/home/rosterloh/zephyrproject/zephyr/lib/libc/newlib/include/stdint.h:28:2: warning: #include_next is a GCC extension
28 | #include_next <stdint.h>
| ^~~~~~~~~~~~
In file included from /home/rosterloh/zephyrproject/zephyr/include/posix/sys/select.h:9,
from /home/rosterloh/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/sys-include/sys/types.h:50,
from /home/rosterloh/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/sys-include/stdio.h:61,
from /home/rosterloh/zephyrproject/extras/lib/microros/micro_ros_src/src/rcutils/include/rcutils/error_handling.h:32,
from /home/rosterloh/zephyrproject/extras/lib/microros/micro_ros_src/src/rcutils/src/char_array.c:16:
/home/rosterloh/zephyrproject/zephyr/include/net/socket_select.h:44:10: error: expected ';' before 'int'
44 | __syscall int zsock_select(int nfds, zsock_fd_set *readfds,
| ^~~~
| ;
In file included from /home/rosterloh/zephyrproject/build/zephyr/include/generated/syscalls/socket_select.h:10,
from /home/rosterloh/zephyrproject/zephyr/include/net/socket_select.h:147,
from /home/rosterloh/zephyrproject/zephyr/include/posix/sys/select.h:9,
from /home/rosterloh/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/sys-include/sys/types.h:50,
from /home/rosterloh/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/sys-include/stdio.h:61,
from /home/rosterloh/zephyrproject/extras/lib/microros/micro_ros_src/src/rcutils/include/rcutils/error_handling.h:32,
from /home/rosterloh/zephyrproject/extras/lib/microros/micro_ros_src/src/rcutils/src/char_array.c:16:
/home/rosterloh/zephyrproject/zephyr/include/syscall.h:93:21: error: expected ';' before '_Bool'
93 | static ALWAYS_INLINE bool z_syscall_trap(void)
| ^
| ;
In file included from /home/rosterloh/zephyrproject/zephyr/include/net/socket_select.h:147,
from /home/rosterloh/zephyrproject/zephyr/include/posix/sys/select.h:9,
from /home/rosterloh/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/sys-include/sys/types.h:50,
from /home/rosterloh/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/sys-include/stdio.h:61,
from /home/rosterloh/zephyrproject/extras/lib/microros/micro_ros_src/src/rcutils/include/rcutils/error_handling.h:32,
from /home/rosterloh/zephyrproject/extras/lib/microros/micro_ros_src/src/rcutils/src/char_array.c:16:
/home/rosterloh/zephyrproject/build/zephyr/include/generated/syscalls/socket_select.h:26:19: error: static declaration of 'zsock_select' follows non-static declaration
26 | static inline int zsock_select(int nfds, zsock_fd_set * readfds, zsock_fd_set * writefds, zsock_fd_set * exceptfds, struct zsock_timeval * timeout)
| ^~~~~~~~~~~~
In file included from /home/rosterloh/zephyrproject/zephyr/include/posix/sys/select.h:9,
from /home/rosterloh/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/sys-include/sys/types.h:50,
from /home/rosterloh/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/sys-include/stdio.h:61,
from /home/rosterloh/zephyrproject/extras/lib/microros/micro_ros_src/src/rcutils/include/rcutils/error_handling.h:32,
from /home/rosterloh/zephyrproject/extras/lib/microros/micro_ros_src/src/rcutils/src/char_array.c:16:
/home/rosterloh/zephyrproject/zephyr/include/net/socket_select.h:44:15: note: previous declaration of 'zsock_select' was here
44 | __syscall int zsock_select(int nfds, zsock_fd_set *readfds,
| ^~~~~~~~~~~~
gmake[3]: *** [CMakeFiles/rcutils.dir/build.make:82: CMakeFiles/rcutils.dir/src/allocator.c.obj] Error 1
gmake[3]: *** Waiting for unfinished jobs....
gmake[3]: *** [CMakeFiles/rcutils.dir/build.make:96: CMakeFiles/rcutils.dir/src/array_list.c.obj] Error 1
gmake[3]: *** [CMakeFiles/rcutils.dir/build.make:110: CMakeFiles/rcutils.dir/src/char_array.c.obj] Error 1
gmake[2]: *** [CMakeFiles/Makefile2:166: CMakeFiles/rcutils.dir/all] Error 2
gmake[2]: *** Waiting for unfinished jobs....
gmake[1]: *** [Makefile:146: all] Error 2
---
Failed <<< rcutils [2.80s, exited with code 2]
Aborted <<< microxrcedds_client [0.77s]
Aborted <<< rosidl_adapter [1.60s]
Aborted <<< tracetools [0.51s]
Summary: 4 packages finished [4.53s]
1 package failed: rcutils
3 packages aborted: microxrcedds_client rosidl_adapter tracetools
3 packages had stderr output: microcdr rcutils tracetools
49 packages not processed
make: *** [libmicroros.mk:100: /home/rosterloh/zephyrproject/zephyr/../extras/lib/microros/micro_ros_src/install] Error 2
Is there a way to specify a custom app location, instead of placing our app into the micro_ros_zephyr_module folder?
I'm not sure how to separate the module repo from our app repo, as the app sits within the module under src/
I've first added support for Core429i board to Zephyr and successfully run various samples (blink LED, serial console, USB console). I then cloned this repo and built as:
west build -b core429i micro_ros_zephyr_module -- -DBOARD_ROOT=$(pwd)/firmware
I then started the agent with:
docker run --privileged --net=host -v /dev:/dev microros/micro-ros-agent:foxy serial --dev /dev/ttyACM0
I then start a separate process in running container to inspect the system with:
docker exec -it <container ID> bash
Should see the expected topic of microros publisher. Also, I should be able to see more debug information to see what is wrong (how to do that?)
If I inspect Zephyr console I see:
*** Booting Zephyr OS build zephyr-v2.6.0-4-gdf0c6f08f7fe *** Waiting for agent connection [00:00:00.061,000] usb_cdc_acm: Device suspended [00:00:00.483,000] usb_cdc_acm: Device configured Serial port connected! Failed status on line 58: 1. Aborting.
On the agent output I see:
[1624371746.118977] info | TermiosAgentLinux.cpp | init | running... | fd: 3 [1624371746.119437] info | Root.cpp | set_verbose_level | logger setup | verbose_level: 4 [1624371747.216420] info | Root.cpp | create_client | create | client_key: 0x494F8913, session_id: 0x81 [1624371747.216586] info | SessionManager.hpp | establish_session | session established | client_key: 0x1229949203, address: 0
And if I inspect the system inside the second container process I get:
root@pop-os:/uros_ws# ros2 topic list /parameter_events /rosout root@pop-os:/uros_ws# ros2 node list /esp32_int32_publisher root@pop-os:/uros_ws# ros2 node info /esp32_int32_publisher /esp32_int32_publisher Subscribers: Publishers: Service Servers: Service Clients: Action Servers: Action Clients: root@pop-os:/uros_ws#
During build, this is the output I get: https://gist.github.com/protobits/2d1eebba1c47feda6c03dbd2c895320e
Note that I added: CONFIG_MICROROS_TRANSPORT_SERIAL_USB=y
and removed: CONFIG_NATIVE_POSIX_TIMER=y
since this is not appropriate for real hardware.
https://gist.github.com/rosterloh/5b66d993c62bc975d5ca6bbe0ade1fa0
ros2 param get /gardin_ec laser_pulse_us should return 20
*** Booting Zephyr OS build zephyr-v2.6.0 ***
Waiting for agent connection
Serial port connected!
[00:00:00.000,000] dac_ltc2633: Set internal Vref failed
[00:00:00.000,000] servo.servo_pwm_init: Servo 0 configured for full:12000 min:(705, 0), max:(2309, 12000)
[00:00:00.000,000] servo.servo_pwm_init: Servo 1 configured for full:12000 min:(705, 0), max:(2309, 12000)
[00:00:00.000,000] servo.servo_pwm_init: Servo 2 configured for full:18000 min:(544, 0), max:(2400, 18000)
[00:00:00.004,000] main: uROS Application 1.0.0
[00:00:00.060,000] usb_cdc_acm: Device suspended
[00:00:00.484,000] usb_cdc_acm: Device configured
INFO: rcl_wait timeout 0 ms
[00:00:02.078,000] main: Trigger delayed changed to 750
[00:00:02.084,000] main: Laser pulse width changed to 20
cannot allocate received sequence in ros_message
Hi,
I was wondering if there are already on-going porting for the Nordic family (specifically nRF52840), and if not, are there some references I can look into to add hardware support for it?
Thank you for your time!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.