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

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

Open
rayvburn opened this issue Sep 6, 2023 · 0 comments
Labels
backlog Issue to be done question Further information is requested

Comments

@rayvburn
Copy link
Owner

rayvburn commented Sep 6, 2023

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);
@rayvburn rayvburn added question Further information is requested backlog Issue to be done labels Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Issue to be done question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant