micro_ros_platformio icon indicating copy to clipboard operation
micro_ros_platformio copied to clipboard

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

Open hippo5329 opened this issue 1 year ago • 1 comments

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 avatar Jun 30 '24 06:06 hippo5329

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

hippo5329 avatar Jun 30 '24 15:06 hippo5329