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 #683

Merged

Conversation

jkooij
Copy link

@jkooij jkooij commented Mar 6, 2018

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
Copy link
Contributor

j-rivero commented Apr 5, 2018

@osrf-jenkins run tests please

1 similar comment
@j-rivero
Copy link
Contributor

j-rivero commented Apr 7, 2018

@osrf-jenkins run tests please

@j-rivero j-rivero merged commit 5a718da into ros-simulation:kinetic-devel Apr 9, 2018
Roboterbastler pushed a commit to Roboterbastler/gazebo_ros_pkgs that referenced this pull request Jul 6, 2018
* 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