Skip to content

Commit

Permalink
Do not update sensors if it a triggered sensor (gazebosim#2443)
Browse files Browse the repository at this point in the history
Signed-off-by: Ian Chen <[email protected]>
  • Loading branch information
iche033 authored Jun 14, 2024
1 parent f024ea8 commit 2297be7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ set(GZ_PHYSICS_VER ${gz-physics7_VERSION_MAJOR})

#--------------------------------------
# Find gz-sensors
gz_find_package(gz-sensors8 REQUIRED
gz_find_package(gz-sensors8 REQUIRED VERSION 8.2.0
# component order is important
COMPONENTS
# non-rendering
Expand Down
5 changes: 5 additions & 0 deletions src/systems/sensors/Sensors.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1034,6 +1034,11 @@ std::chrono::steady_clock::duration SensorsPrivate::NextUpdateTime(
continue;
}

if (rs->IsTriggered())
{
continue;
}

std::chrono::steady_clock::duration time;
// if sensor's next update tims is less or equal to current sim time then
// it's in the process of being updated by the render loop
Expand Down

0 comments on commit 2297be7

Please sign in to comment.