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 sensors after time reset (lunar-devel) #705

Merged
merged 3 commits into from Apr 9, 2018

Conversation

j-rivero
Copy link
Contributor

@j-rivero j-rivero commented Apr 9, 2018

{ port of pull request #683 }
Fixes various gazebo sensor plugins not publishing ROS messages after resetting the Gazebo world (CTRL+R).

Tested on gazebo9. Currently includes:

  • block laser
  • camera
  • joint_state_publisher
  • p3d
  • range
    These are the sensors on the prius vehicle in github.com/osrf/car_demo .

In all these plugins, resetting the time in Gazebo results in negative time difference between the current time and last update time, which prevents any new messages being send. The fix explicitly detects such negative time differences. With it, the simulation in osrf/car_demo can be reset without affecting ROS.

By the way, this seems related to #532, though kennysharm'a pull request, nor #540 fixes this.

World resets result in a negative time differences between current world
time and the last recorded sensor update time, preventing the plugin
from publishing new frames. This commit detects such events and resets
the internal sensor update timestamp.
@j-rivero j-rivero merged commit 7899edc into lunar-devel Apr 9, 2018
@scpeters scpeters deleted the lunar-devel-transplant-683 branch May 29, 2018 20:03
cohen39 pushed a commit to cohen39/gazebo_ros_pkgs that referenced this pull request Nov 15, 2021
* camera plugin keeps publishing after negative sensor update interval

World resets result in a negative time differences between current world
time and the last recorded sensor update time, preventing the plugin
from publishing new frames. This commit detects such events and resets
the internal sensor update timestamp.

* block_laser, range, and joint_state_publisher keep publishing after clock reset

* p3d keeps publishing after clock reset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants