Skip to content

Commit

Permalink
Move projectState after getPointsInside
Browse files Browse the repository at this point in the history
Signed-off-by: Brice <[email protected]>
  • Loading branch information
BriceRenaudeau committed May 20, 2024
1 parent bf291d7 commit c765674
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions nav2_collision_monitor/src/polygon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,17 +242,17 @@ double Polygon::getCollisionTime(

// Robot movement simulation
for (double time = 0.0; time <= time_before_collision_; time += simulation_time_step_) {
// Shift the robot pose towards to the vel during simulation_time_step_ time interval
// NOTE: vel is changing during the simulation
projectState(simulation_time_step_, pose, vel);
// Transform collision_points to the frame concerned with current robot pose
points_transformed = collision_points;
transformPoints(pose, points_transformed);
// If the collision occurred on this stage, return the actual time before a collision
// If the collision occurred on this stage, return the actual collision time
// as if robot was moved with given velocity
if (getPointsInside(points_transformed) >= min_points_) {
return time;
}
// Shift the robot pose towards to the vel during simulation_time_step_ time interval
// NOTE: vel is changing during the simulation
projectState(simulation_time_step_, pose, vel);
}

// There is no collision
Expand Down

0 comments on commit c765674

Please sign in to comment.