Skip to content

Commit

Permalink
fix(cws): Trigger warning only for occupied cells
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashuh committed Feb 5, 2022
1 parent ca7989b commit 6c81281
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion collision_warning_system/src/collision_warning_system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <vector>

#include "costmap_generator/collision_checker.h"
#include "costmap_generator/costmap_value.h"
#include "f1tenth_utils/tf2_wrapper.h"

CollisionWarningSystem::CollisionWarningSystem()
Expand Down Expand Up @@ -61,7 +62,8 @@ void CollisionWarningSystem::timerCallback(const ros::TimerEvent& timer_event)

for (int i = 0; i < projected_trajectory.poses.size(); ++i)
{
if (collision_checker_->checkCollision(projected_trajectory.poses.at(i)))
if (collision_checker_->checkCollision(projected_trajectory.poses.at(i)) ==
static_cast<int>(CostmapValue::OCCUPIED))
{
ttc.data = i * delta_t_;
break;
Expand Down

0 comments on commit 6c81281

Please sign in to comment.