Replies: 4 comments 1 reply
-
The safety_margin is used to calculate error for cost or constraint. The safety_margin_buffer is used when calculating the jacobian and error used for the quadratic function. This allows it to even though you may not be violating a constraint to still add a quadratic function to the problem so it understand the direction that will cause it to move closer to the violation. Ideally you would want to set the contact distance to infinite but this would come at a computation cost so this allows to you set the contact distance threshold used which is safety_margin + safety_margin_buffer. Adding it as a constraint for convoluted scenarios can be problematic because it is a local optimal planner and at least for the open source solvers it does not allow it move away increasing the constraint violation and then come back to new local minimum. Though when adding them as a cost the solvers allows it to do this. We solve this two ways. The first is to leverage another planner to create a better seed like descartes or ompl. The second is to run a two stage trajopt but running the collision with cost and then after it finish solving running it using constraints. I have thought about update trajopt solver to support this. Also the commercial solver seem to handle these condition better. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the clarification. If you don't mind I have a couple of follow-up questions:
Thanks for the precisions on the margin & constraint, it's really clear now! I suppose the filtering step in the SQP step rejection is a little too strict. |
Beta Was this translation helpful? Give feedback.
-
Sure. In the context of Bullet Continuous collision checking it accomplishes this by taking the collision geometry at the start state and the same collision geometry at the end state and creates essential a new convex hull and then performs collision checking. Now it does not actually create the convex hull it just exploits the fact that Bullet only operates on the vertices so it create simple wrapper collision object so to Bullet it only sees on collision geometry. Because it is creating a casted collision object the longest valid segment length is a critical component. If this is large then the casted collision object does not accurately represent the path the object takes.
Your understanding is correct.
Yep, that is typically what I set it to.
Yea, though to be honest I have not dug into the OSQP to see if there are some option to relax this so that may be something to explore if you have time. |
Beta Was this translation helpful? Give feedback.
-
I've run into some similar issues as described here where planning with collision avoidance as a constraint fails but collision avoidance as a cost succeeds (and is still collision-free)
My understanding of this statement is that both the collision avoidance cost and constraint compute non-zero gradients when any contact is detected with distance < If this is true, then the collision constraint and the collision cost should have the same behavior w.r.t. the gradients produced during the optimization for any given problem. The only difference is that the collision avoidance constraint will make the optimization return failure if it's violated, whereas the cost would not.
How is this true? If the cost and constraint versions produce the same gradient, then they should produce the same result on the optimization. Are the gradients of constraints somehow weighted or prioritized over the gradients of costs in the solvers we are using? |
Beta Was this translation helpful? Give feedback.
-
Hello,
I have a few questions regarding the correct use of collision terms within Trajopt. If they have been answered elsewhere, I apologize...
DISCRETE_CONTINUOUS
because I think it considers both discrete points (based on max_segment_length) and continuous collision in-between those points. Is this correct? In that case isSINGLE_TIMESTEP
discrete collision only at the knots, andCAST_CONTINUOUS
continuous checking over every segment?safety_margin
andsafety_margin_buffer
? I seem to understand that basically any contact with distance smaller thansafety_margin
will contribute a cost that's proportional (?) to the penetration distance. But I am not sure howsafety_margin_buffer
works. Is it only used to compute continuous gradients aroundsafety_margin
?safety_margin
of 0.0, but that seemed to lead to numerous solver failures. Is there an example somewhere on how to do this properly?Thanks a lot.
Beta Was this translation helpful? Give feedback.
All reactions