micro-ROS / micro_ros_platformio

micro-ROS library for Platform.IO
Apache License 2.0
197 stars 67 forks source link

Why use "-DRMW_UXRCE_TRANSPORT=custom" in metas? rmw_microros discovery.c won't build. #142

Open hippo5329 opened 5 days ago

hippo5329 commented 5 days ago

I'm trying to port micro_ros_demos to platformio. But "-DRMW_UXRCE_TRANSPORT=custom" in metas caused autodiscover_agent compilation failed. I tested with wifi transport, and "RMW_UXRCE_TRANSPORT" should be "udp" instead of "custom".

https://github.com/hippo5329/micro-ROS-demos-platformio/wiki

git clone https://github.com/hippo5329/micro-ROS-demos-platformio.git cd micro-ros-demos-platformio/rclc/autodiscover_agent pio run -e esp32_wifi

In file included from src/main.cpp:2: src/../main.c: In function 'int rmain(int, const char const)': src/../main.c:41:5: error: 'rmw_uros_discover_agent' was not declared in this scope if(rmw_uros_discover_agent(rmw_options) != RCL_RET_OK){ ^~~~~~~ src/../main.c:41:5: note: suggested alternative: 'rmw_uros_ping_agent' if(rmw_uros_discover_agent(rmw_options) != RCL_RET_OK){ ^~~~~~~ rmw_uros_ping_agent

rmw_microros discovery.h not included, discovery.c not built.

[env:esp32_wifi] platform = espressif32 board = nodemcu-32s board_microros_transport = wifi lib_ldf_mode = chain+

It seems "custom" is hard-coded in many places.

hippo5329 commented 4 days ago

I know set_microros_wifi_transports() set the agent_ip already. Is there a way to use auto discovery?