Open markilius508 opened 3 months ago
You should set serial baudrate to 921600. Or , 2000000 if your esp32 serial bridge supports, eg ch340.
You should set serial baudrate to 921600. Or , 2000000 if your esp32 serial bridge supports, eg ch340.
Thank you for your reply. I tried to change baudrate to 2000000 but somehow the maximum achievable rate appeared to be limited to 921600 (second last line in the Terminal Output).
Despite this adjustment, I observed no significant improvement in micro-ROS performance; the time needed for publishing those three messages remained unchanged.
Your timer is 100ms, eq, 10Hz // create timer, const unsigned int timer_timeout = 100;
You can check the rate with "ros2 topic hz /your_topic" .
The maximum topic rate of int32 publisher is around 250Hz on esp32. I use 50Hz for control loop. You should also use low latency kernel on host.
https://github.com/hippo5329/micro_ros_arduino_examples_platformio/wiki
@hippo5329 You are absolutely right, 10Hz is too slow. Increasing the publishing frequency and using a low latency kernel on the host are both on my to-do list. Thank you for your recommendation and sharing your repo - I'll definitely check it out.
I set up a micro-ROS system on an ESP32 to publish three messages simultaneously in a single timer callback with a 20 ms interval.
tf2_msgsmsgTFMessage sensor_msgsmsgJointState nav_msgsmsgOdometry
However, I noticed my motor controller wasn't responding as smoothly as it used to. When I measured the time taken by the timer callback, I was shocked to find it was using up 100 ms just to publish those three messages! For comparison, I tested the same task on my OpenCR board, and it only took 6 ms to complete. Can you help me figure out what's causing this issue?