micro-ROS / micro_ros_platformio

micro-ROS library for Platform.IO
Apache License 2.0
224 stars 80 forks source link

Same message is received continuously. #128

Closed amalshaji4540 closed 8 months ago

amalshaji4540 commented 9 months ago

Issue template

I am working on a differential drive wheeled robot. teleop_twist_keyboard is used for sending the twist messages. I had created subscriber on topic cmd_vel using micro ros on ESP32. The messege is subscribed successfully. But the issue is when I send messages continuously at high frequency ( I press the key on teleop twist keyboard with out taking my finger ). The message received doesn't changes, same message is received at ESP32 if I send another message from telop twist keyboard.

This issue occur only when I send message at a high rate. Otherwise everything works as expected.

Is there any ways to get last sent message.

pablogs9 commented 9 months ago

Are you subscribing in best effort?

amalshaji4540 commented 9 months ago

No, I am subscribing in default

RCCHECK(rclc_subscription_init_default( &subscriber, &node, ROSIDL_GET_MSG_TYPE_SUPPORT(geometry_msgs, msg, Twist), "cmd_vel"));

pablogs9 commented 9 months ago

It is probably a good idea to move to best effort if you are publishing on a topic with a high rate.

amalshaji4540 commented 9 months ago

Okey, thank you. I will try it out.

amalshaji4540 commented 8 months ago

@pablogs9 Thank you for the advice. Best effort works really well.

pablogs9 commented 8 months ago

Good to hear that!