micro-ROS / micro_ros_espidf_component

micro-ROS ESP32 IDF component and sample code
Apache License 2.0
229 stars 53 forks source link

Communication between Micro-ROS Agent (@RPi 4B) and Client (@esp32-s3) is not established #228

Closed sweidling closed 5 months ago

sweidling commented 5 months ago

Hi again,

I was able to build micro-ROS client for esp32-s3 using custom transport / UART (int32_publisher_custom_transport).

And I was able to build ROS2 humble and micro-ROS agent (https://github.com/micro-ROS/micro_ros_setup?tab=readme-ov-file#building-micro-ros-agent) on a RaspberryPi 4B. My ROS2 setup and micro-ROS agent are working as expected together with a micro-ROS client running on a STM32. Now I am trying to get this to work with an esp32-s3.

There seems to be a problem establishing the connection. RCCHECK(rclc_support_init(&support, 0, NULL, &allocator));

I am sure the correct UART port has been selected. When I monitor the UART port on the other side on the RPi, I see that the client is trying to establish a connection. The client sends data (31 bytes) 10 times.

My settings in colcon.meta are as follows: "microxrcedds_client": { "cmake-args": [ "-DUCLIENT_PIC=OFF", "-DUCLIENT_PROFILE_DISCOVERY=OFF", "-DUCLIENT_PROFILE_UDP=OFF", "-DUCLIENT_PROFILE_CUSTOM_TRANSPORT=ON", "-DUCLIENT_PROFILE_SERIAL=OFF", "-DUCLIENT_PROFILE_TCP=OFF", "-DUCLIENT_MIN_HEARTBEAT_TIME_INTERVAL=1" ] }, "rmw_microxrcedds": { "cmake-args": [ "-DRMW_UXRCE_XML_BUFFER_LENGTH=400", "-DRMW_UXRCE_TRANSPORT=custom", "-DRMW_UXRCE_MAX_NODES=1", "-DRMW_UXRCE_MAX_PUBLISHERS=2", "-DRMW_UXRCE_MAX_SUBSCRIPTIONS=2", "-DRMW_UXRCE_MAX_SERVICES=1", "-DRMW_UXRCE_MAX_CLIENTS=1", "-DRMW_UXRCE_MAX_HISTORY=1" ] },

Any help is welcome.

sweidling commented 5 months ago

When I use while(rmw_uros_ping_agent(timeout_ms, attemps) != RMW_RET_OK) { printf("Please, start your micro-ROS Agent first\n"); } the client is sending the following frames: image

The micro-ROS agent is running but nothing happens. The agent is not detected by the client.

sweidling commented 5 months ago

problem solved. I changed UART source_clk to UART_SCLK_XTAL.