ros-drivers / rosserial

A ROS client library for small, embedded devices, such as Arduino. See: http://wiki.ros.org/rosserial
517 stars 525 forks source link

serial_node.py with use_sim_time issue #488

Closed daisukes closed 4 years ago

daisukes commented 4 years ago

The main loop of serial_node.py waits 1 millisecond with rospy.sleep(0.001) after receiving a message from serial here.

This is okay without simulation, but gazebo_ros publishes clock in 100 Hz and let serial_noe.py wait 10 milliseconds after each message.

My Arduino publishes 4 different messages in 50 Hz (total 200 Hz) and got sync error when I run it with gazebo (use_sim_time=true).

Is it possible to change it to time.sleep(0.001)?

mikepurvis commented 4 years ago

That sounds reasonable— Gazebo would have no control over whatever is on the other end of a rosserial connection, so there'd be no reason to alter its view of time. Please send a PR.