Fix delay on detecting a running rosmaster with use_sim_time set #532

Merged
merged 1 commit into from Dec 22, 2014

Conversation

Projects
None yet
3 participants
@cmansley
Contributor

cmansley commented Nov 13, 2014

No description provided.

@ros-pull-request-builder

This comment has been minimized.

Show comment
Hide comment
@ros-pull-request-builder

ros-pull-request-builder Nov 13, 2014

Member

Can one of the admins verify this patch?

Can one of the admins verify this patch?

@cmansley

This comment has been minimized.

Show comment
Hide comment
@cmansley

cmansley Nov 13, 2014

Contributor

rosbag record will wait for a full second before recording data if the use_sim_time is true. Since, the timer uses rostime, it will not begin executing until a clock is detected, then a full second will pass until the timer fires and checks for the master. This is an issue for scripts that run rosbag record. By checking first for the rosmaster, we can avoid the one second startup delay.

Contributor

cmansley commented Nov 13, 2014

rosbag record will wait for a full second before recording data if the use_sim_time is true. Since, the timer uses rostime, it will not begin executing until a clock is detected, then a full second will pass until the timer fires and checks for the master. This is an issue for scripts that run rosbag record. By checking first for the rosmaster, we can avoid the one second startup delay.

@dirk-thomas

This comment has been minimized.

Show comment
Hide comment
@dirk-thomas

dirk-thomas Dec 10, 2014

Member

Can you please provide a minimal example which I can run to reproduce the behavior before and after this patch?

Member

dirk-thomas commented Dec 10, 2014

Can you please provide a minimal example which I can run to reproduce the behavior before and after this patch?

@cmansley

This comment has been minimized.

Show comment
Hide comment
@cmansley

cmansley Dec 16, 2014

Contributor

Yes. Here is the setup.

You can generate a bag file like this, running each command in a separate terminal:

roscore
rostopic pub /message std_msgs/String "Hello" -r 10
rosbag record --all -O temp

You can tear down the setup and create a new setup, running each in a terminal in sequence:

roscore
rosparam set use_sim_time true
rosbag record --all -O delayed

rosbag record is waiting for a clock signal.

Then, we can

rosbag play --clock temp.bag

A rosbag info on delayed.bag will show that approximately 1 second of /message is missing (10 msgs)

With the patch, the 10 messages are not missing.

Contributor

cmansley commented Dec 16, 2014

Yes. Here is the setup.

You can generate a bag file like this, running each command in a separate terminal:

roscore
rostopic pub /message std_msgs/String "Hello" -r 10
rosbag record --all -O temp

You can tear down the setup and create a new setup, running each in a terminal in sequence:

roscore
rosparam set use_sim_time true
rosbag record --all -O delayed

rosbag record is waiting for a clock signal.

Then, we can

rosbag play --clock temp.bag

A rosbag info on delayed.bag will show that approximately 1 second of /message is missing (10 msgs)

With the patch, the 10 messages are not missing.

@dirk-thomas

This comment has been minimized.

Show comment
Hide comment
@ros-pull-request-builder

This comment has been minimized.

Show comment
Hide comment

Test passed.
Refer to this link for build results: http://jenkins.ros.org/job/_pull_request-indigo-ros_comm/152/

@dirk-thomas

This comment has been minimized.

Show comment
Hide comment
@dirk-thomas

dirk-thomas Dec 22, 2014

Member

I also tried it locally and it works as advertized. Thank you.

Member

dirk-thomas commented Dec 22, 2014

I also tried it locally and it works as advertized. Thank you.

dirk-thomas added a commit that referenced this pull request Dec 22, 2014

Merge pull request #532 from cmansley/fix-rosbag-startup-delay
Fix delay on detecting a running rosmaster with use_sim_time set

@dirk-thomas dirk-thomas merged commit 1a1dea4 into ros:indigo-devel Dec 22, 2014

1 check passed

default Merged build finished.
Details

rsinnet pushed a commit to MisoRobotics/ros_comm that referenced this pull request Jun 19, 2017

Merge pull request #532 from cmansley/fix-rosbag-startup-delay
Fix delay on detecting a running rosmaster with use_sim_time set
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment