2025-03-18 11:46 PM
Hi everyone,
I am trying to implement Micro-ROS over UDP transport on an STM32F7, with custom msg type According to this article,
https://micro.ros.org/docs/tutorials/advanced/create_new_type/
but when building the firmware using ros2 run micro_ros_setup build_firmware.sh script, microxrcedds_client package fails to build.
/microros_ws/firmware/mcu_ws/eProsima/Micro-XRCE-DDS-Client/src/c/profile/transport/ip/ip_posix.c:18:10: fatal error: lwip/inet.h: No such file or directory #include <arpa/inet.h> ^~~~~~~~~~~~~ compilation terminated. gmake[3]: *** [CMakeFiles/microxrcedds_client.dir/build.make:429: CMakeFiles/microxrcedds_client.dir/src/c/profile/transport/ip/ip_posix.c.obj] Error 1 gmake[3]: *** Waiting for unfinished jobs.... /microros_ws/firmware/mcu_ws/eProsima/Micro-XRCE-DDS-Client/src/c/profile/transport/ip/udp/udp_transport_posix_nopoll.c:5:10: fatal error: sys/socket.h: No such file or directory #include <sys/socket.h> ^~~~~~~~~~~~~~ compilation terminated. gmake[3]: *** [CMakeFiles/microxrcedds_client.dir/build.make:415: CMakeFiles/microxrcedds_client.dir/src/c/profile/transport/ip/udp/udp_transport_posix_nopoll.c.obj] Error 1 gmake[2]: *** [CMakeFiles/Makefile2:86: CMakeFiles/microxrcedds_client.dir/all] Error 2 gmake[1]: *** [Makefile:139: all] Error 2
The errors indicate that Micro-XRCE-DDS-Client is missing POSIX networking headers (arpa/inet.h, sys/socket.h), which are required for UDP/IP communication. This happens when building for an embedded target (STM32) that lacks a full POSIX environment.
Any insights to avoid this error would be greatly appreciated!
Thanks in advance!