Open markilius508 opened 1 month 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.
Im also running through a similar issue. Im publishing 2 int64 messages of a custom data type and im trying to send them at 20Hz with a timer callback period of 20ms
When i do ros2 topic echo /topic_name, the data is being published at around 1-1.5Hz
Could it be that Int64 generally takes that long to publish?
I also tried uploading an example micro ros publisher and changed the timer callback to 20ms and removed the 100ms delay in the main loop. still no change. the data is being displayed like this:
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?