Comments (14)
My point being: I fail to see the use of the footprint distance checking. Imho would be of great help, but only given that we computed the actual distances.
Its about checking for collisions and less to do with finding the distance. The ObstacleCritic has 2 components: the "critical" collision rejection of samples that collide and the "behavioral" element which scores higher cost, but valid, areas higher to generally incentivize actions that aren't getting into unnecessary high cost areas where there are other options. The collision check is to find the highest cost on the footprint to checking if its valid - then we can use that same information to find then the closest distance to score.
We actually have a different critic now the CostCritic
which is now default that doesn't use distances but rather fully based on costs. It falls into the same trap as the ObstacleCritic
since the 253
cost is still set for all inscribed values, but it does have some nice behavioral advantages for some - if not most - situations (notably: can tune obstacle behavior relative to the inflation exponential function rather than linear on distance).
Does it make sense to try to calculate the actual distances efficiently?
Perhaps, yes. I suppose for the local costmap given its smaller that creating a TSDF or similar wouldn't be too bad. It was just something I was trying very hard to avoid for computational reasons, but maybe I was overblowing it in my mind. Its definitely worth an experiment. Moreover, if we had a generic TDSF utility for costmaps in Nav2, I'm sure it would find utility for planning, control, collision checking, etc even if I can't put my finger on exactly how I'd use it off the top of my head.
An interesting topic indeed!
from navigation2.
The cost critic has some lines that make no sense to me.
Will pose_cost >= 253.0f ever be reached here?
if (pose_cost >= 253.0f /*INSCRIBED_INFLATED_OBSTACLE in float*/) {
traj_cost += critical_cost_;
} else if (!near_goal) { // Generally prefer trajectories further from obstacles
Lets say the trajectory actually collides then we exit the loop here
If the trajectory does not collide, then pose_cost will certainly be less than 253, since pose cost is the cost of the origin using costmap->getCost(getIndex(x_i, y_i))
. If hypothetically it would be >= 253 then we would be in collision and not near-collision.
pose_cost >= circumscribed_cost_
would make more sense to me
from navigation2.
Will pose_cost >= 253.0f ever be reached here?
253 is inflated, so that happens, yes when checking footprints and not circular point checks. 254 no because that's collision and inCollision
will reject it. 255 can happen if tracking unknown space. Its a nice condensation from checking 253
or 255
.
from navigation2.
253 is inscribed_cost
if pose_cost is >= 253, a collision irrespective of footprint orientation is guaranteed.
If this is the case than footprintCostAtPose
in inCollision
will certainly return LethalObstacle because one of the footprint`s polygons will be in >=254.
In this case inCollision
returns true and the loop will break before reaching the point.
from navigation2.
if pose_cost is >= 253, a collision irrespective of footprint orientation is guaranteed.
For center point costs, not edge costs for SE2 footprint checking.
from navigation2.
yes but pose_cost
is always center point cost.
from navigation2.
Ah, I was just looking at that. Throw a log in there and make sure it never triggers, but I agree with you that on a glance I think that is dead code.
from navigation2.
Isn't that the whole point?
skip expensive checking if its >= inscribed because irrespective of orientation you will collide
skip expensive checking if its < possibly because irrespective of orientation you will not collide
from navigation2.
} else if (!near_goal) { // Generally prefer trajectories further from obstacles
traj_cost += pose_cost;
}
This part is what is doing the scoring based on preference
if (inCollision(pose_cost, Tx, Ty, traj_yaw(i, j))) {
traj_cost = collision_cost_;
trajectory_collide = true;
break;
}
This part is what does the scoring based on core collision
if (pose_cost >= 253.0f /*INSCRIBED_INFLATED_OBSTACLE in float*/) {
traj_cost += critical_cost_;
I'm guessing that this part is a legacy of the ObstacleCritic
where the pose cost was not just the center point cost. But, if you're saying that this never triggers, then we should be able to remove it.
from navigation2.
if (pose_cost >= 253.0f /*INSCRIBED_INFLATED_OBSTACLE in float*/) {
traj_cost += critical_cost_;
Once you reach this point and you had a SE2 collision check, you could still just penalize based on > circumscribed_cost_, but it may be a poor indicator if for example you are using a 20m long and 3m wide AGV.
from navigation2.
Or even better: you could return the result of score_cost = static_cast<float>(collision_checker_.footprintCostAtPose(
in the inCollision
function. If this is inside inscribed then you have reason to apply critical_cost
from navigation2.
Once you reach this point and you had a SE2 collision check, you could still just penalize based on > circumscribed_cost_, but it may be a poor indicator if for example you are using a 20m long and 3m wide AGV.
I think like we discussed this can be removed? If you show this isn't called and I generally agree that's probably the case, we can simply remove it.
from navigation2.
@mangoschorle any update? Happy to have these changes made
from navigation2.
@mangoschorle Just pinging again on this!
from navigation2.
Related Issues (20)
- Collision Monitor parameters on ROS2 Humble HOT 4
- loopback_sim: provide realistic scan data
- The default_server_timeout parameter in bt_navigator is always overridden by the server_timeout port in each BT action node. HOT 3
- The callback function of subscriber is not called while navigation is in progress. HOT 1
- Missing nav2_namespaced_view.rviz referenced in launch files HOT 1
- Planner for uneven outdoor surfaces HOT 2
- Do We Still Need `lifecycle_publisher->on_activate()`? HOT 9
- Backport cmake updates from Chris to Jazzy HOT 1
- Building nav2 from source fails, ubuntu 22.04 ROS2 Humble HOT 2
- Keepout filter mask reload on the fly? HOT 2
- Restore exported BT util test files after cmake revamp HOT 1
- Nav2 Voxel Layer Costmap Issue: Path Planner Ignores Obstacles from PointCloud Data HOT 1
- NavfnPlanner randomly fails for a clearly reachable goal saying "Failed to create a plan from potential when a legal .... found" HOT 11
- [MPPI] Rotational Constraint HOT 1
- [Question, DWB Planner] How to use dwb planner only HOT 1
- Backport nav2_graceful_controller to Iron HOT 2
- follow_path action keeps on running after having canceled the goal HOT 4
- I got this error [component_container_isolated-2] [ERROR] [1725418332.608375481] [transformPoseInTargetFrame]: Failed to transform from to base_link HOT 1
- [MPPI] Incorrect Sign Handling for wz Adjustment of Ackermann MotionModel, when vx is Negative in applyConstraints HOT 3
- Custom Global Path Planning Plugin HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from navigation2.