Skip to content
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

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

Merged
merged 1 commit into from Dec 22, 2014

Conversation

@cmansley
Copy link
Contributor

@cmansley cmansley commented Nov 13, 2014

No description provided.

@ros-pull-request-builder
Copy link
Member

@ros-pull-request-builder ros-pull-request-builder commented Nov 13, 2014

Can one of the admins verify this patch?

@cmansley
Copy link
Contributor Author

@cmansley 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
Copy link
Member

@dirk-thomas 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
Copy link
Contributor Author

@cmansley 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
Copy link
Member

@dirk-thomas dirk-thomas commented Dec 22, 2014

@ros-pull-request-builder
Copy link
Member

@ros-pull-request-builder ros-pull-request-builder commented Dec 22, 2014

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

@dirk-thomas
Copy link
Member

@dirk-thomas 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
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
1 check passed
default Merged build finished.
Details
rsinnet pushed a commit to MisoRobotics/ros_comm that referenced this pull request Jun 19, 2017
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
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.