rayvburn / humap_local_planner

Human-aware robot trajectory planner using a hybrid trajectory candidates generation and spatiotemporal cost functions
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

consider assigning negative TTC cost to trajectories that will cause collision in the first prediction step #111

Open rayvburn opened 1 year ago

rayvburn commented 1 year ago

Conceptually - we should not assign a purely negative cost as we are not certain about the state in the next step.

A preliminary version was prepared as shown below:

diff --git a/src/ttc_cost_function.cpp b/src/ttc_cost_function.cpp
index 12422a6..b5fff1d 100644
--- a/src/ttc_cost_function.cpp
+++ b/src/ttc_cost_function.cpp
@@ -78,6 +78,12 @@ double TTCCostFunction::scoreTrajectory(base_local_planner::Trajectory& traj) {
                        dist_min_static,
                        dist_min_dynamic)
                ) {
+                       // check if collision occurs at the first prediction
+                       if (timestamp == 0.0) {
+                               return -13.0;
+                       }
+
                        // we'll score and stop here
                        // save data for a specific trajectory
                        robot_stat_obj_v_.push_back(state_prediction_static);