-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
micro-ros + esp32 so slow #1816
Comments
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 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. |
When changing baud rate to 921600 on Arduino IDE, you must also update baud rate in Arduino/libraries/micro_ros_arduino-2.0.5-[DISTRO]/src/default_transport.cpp, |
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_msgs__msg__TFMessage
sensor_msgs__msg__JointState
nav_msgs__msg__Odometry
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?
The text was updated successfully, but these errors were encountered: