Is it possible to plan_pose() or plan_grasp() with some target frame pose while adding a constraint or cost term on another link's pose(origin x and z axis)? #691
Replies: 1 comment
|
No, that quote is not correct, on both halves. On the gradient claim. On extending via the Python config API. You do not need to extend a kernel. The kernel already accepts a per-link, per-axis weight vector: from curobo.types import ToolPoseCriteriaIts Mapping your torso case. Multi-link goals with different criteria per link are already used in-repo. tool_pose_criteria={
"pelvis": ToolPoseCriteria.track_position_and_orientation(
xyz=[1.0, 1.0, 1.0], rpy=[0.5, 0.5, 0.5],
),
"left_hand": ToolPoseCriteria.track_position_and_orientation(
xyz=[1.0, 1.0, 1.0], rpy=[0.3, 0.3, 0.3],
),
}For "arm reaches the target, torso stays upright", you want full weight on the arm frame and a weight vector on the torso frame that is nonzero only on the axes you care about. Your stated axes are torso origin x, and torso z axis pointing up, which is roll and pitch (yaw left free): tool_pose_criteria={
"arm_ee_link": ToolPoseCriteria.track_position_and_orientation(
xyz=[1.0, 1.0, 1.0], rpy=[1.0, 1.0, 1.0],
),
"torso_link": ToolPoseCriteria.track_position_and_orientation(
xyz=[1.0, 0.0, 0.0], # x only
rpy=[1.0, 1.0, 0.0], # roll and pitch only, yaw free
),
}
Two things to be aware of, because they change how you set this up:
If you are on a pre-restructure release (v0.7.x). The same capability exists under older names: pass the extra link goal through Caveat on my end: I verified the above by reading current |
Uh oh!
There was an error while loading. Please reload this page.
Is it possible to plan_pose() or plan_grasp() with some target frame pose while adding a constraint or cost term on another link's pose(origin x and z axis)?
An example case is: planning torso+arm joints together, the arm end-effector should be guaranteed to reach the target, and I hope the torso won't lean forward or backward too much by adding a cost on the torso end effector's origin x (close to 0) and z axis(close to (0,0,1)).
But it seems it's not possible to let the optimizer be aware of this cost:
"cuRobo's ToolPoseCost (in both cost and constraint managers) is evaluated via Python compute_costs() which feeds into metric reporting — not the optimization gradient. The actual optimization gradient comes from compiled Warp kernels that the Python config API cannot extend."
Is this true?
All reactions