Open jarunyawat opened 2 weeks ago
You will need to change the serial baudrate to 921600.
You may follow my wiki,
https://github.com/hippo5329/micro_ros_arduino_examples_platformio/wiki
Thank you for your answer, but I changed the serial baud rate to 921600, and with rclc_publisher_init_best_effort, it still isn't working. I also included --baudrate 921600 in my micro-ROS agent terminal. So, I switched back to rclc_publisher_init_default, and the topic frequency increased to 90 Hz. In both cases, whether using rclc_publisher_init_best_effort or rclc_publisher_init_default, my micro-ROS agent outputs the same.
[1724552517.485593] info | TermiosAgentLinux.cpp | init | running... | fd: 3
[1724552517.485749] info | Root.cpp | set_verbose_level | logger setup | verbose_level: 4
[1724552517.723667] info | Root.cpp | create_client | create | client_key: 0x6DEC8AE8, session_id: 0x81
[1724552517.723783] info | SessionManager.hpp | establish_session | session established | client_key: 0x6DEC8AE8, address: 0
[1724552517.738640] info | ProxyClient.cpp | create_participant | participant created | client_key: 0x6DEC8AE8, participant_id: 0x000(1)
[1724552517.742239] info | ProxyClient.cpp | create_topic | topic created | client_key: 0x6DEC8AE8, topic_id: 0x000(2), participant_id: 0x000(1)
[1724552517.744275] info | ProxyClient.cpp | create_publisher | publisher created | client_key: 0x6DEC8AE8, publisher_id: 0x000(3), participant_id: 0x000(1)
[1724552518.073726] info | ProxyClient.cpp | create_datawriter | datawriter created | client_key: 0x6DEC8AE8, datawriter_id: 0x000(5), publisher_id: 0x000(3)
But I noticed that my red built-in LED (which I think indicates serial transmission) flashes very quickly when using rclc_publisher_init_default; it almost appears to be always on. However, when using rclc_publisher_init_best_effort, it flashes very slowly, around 3 Hz.
Please start over with the int32 publisher and re-connection examples in my first wiki. You should try to change the timer to 100Hz in these examples. You may check the publishing rate with "ros2 topic hz /topic".
You should always start from the basic. Learning step by step.
Then you should try out the second wiki, the linorobot2_hardware. 50Hz control loop is good enough for beginner's mobile robots.
Issue template
I am trying to read the motor encoder, calculate odometry, and send the data back to my PC at 100 Hz. Using rclc_publisher_init_default, it can publish data, but only at 13 Hz. So, I tried using rclc_publisher_init_best_effort to increase the frequency, but it didn't publish anything.
Steps to reproduce the issue
Here my esp32 code
And here my test subscriber code in my PC.
Expected behavior
It should receive messages with the 'best effort' setting.
Actual behavior
Subscriber node does not receive data with the 'best effort' setting on the ESP32.