-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add ocp exp3 #126
Add ocp exp3 #126
Conversation
I would not use the term "exp3". This OCP is meant to be used for the agimus demo3 . I would use something more meaninfull such as joint_state, so: |
…uced' into ahaffemayer/feature/add-ocp-exp3
…-croco' into ahaffemayer/feature/add-ocp-exp3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some comments but it looks good
agimus_controller/agimus_controller/ocp/ocp_croco_joint_state.py
Outdated
Show resolved
Hide resolved
agimus_controller/agimus_controller/ocp/ocp_croco_joint_state.py
Outdated
Show resolved
Hide resolved
agimus_controller/agimus_controller/ocp/ocp_croco_joint_state.py
Outdated
Show resolved
Hide resolved
agimus_controller/agimus_controller/ocp/ocp_croco_joint_state.py
Outdated
Show resolved
Hide resolved
agimus_controller/agimus_controller/ocp/ocp_croco_joint_state.py
Outdated
Show resolved
Hide resolved
agimus_controller/agimus_controller/ocp/ocp_croco_joint_state.py
Outdated
Show resolved
Hide resolved
agimus_controller/agimus_controller/ocp/ocp_croco_joint_state.py
Outdated
Show resolved
Hide resolved
agimus_controller/agimus_controller/ocp/ocp_croco_joint_state.py
Outdated
Show resolved
Hide resolved
agimus_controller/agimus_controller/ocp/ocp_croco_joint_state.py
Outdated
Show resolved
Hide resolved
agimus_controller/agimus_controller/ocp/ocp_croco_joint_state.py
Outdated
Show resolved
Hide resolved
agimus_controller/agimus_controller/ocp/ocp_croco_joint_state.py
Outdated
Show resolved
Hide resolved
agimus_controller/agimus_controller/ocp/ocp_croco_joint_state.py
Outdated
Show resolved
Hide resolved
agimus_controller/agimus_controller/ocp/ocp_croco_joint_state.py
Outdated
Show resolved
Hide resolved
agimus_controller/agimus_controller/ocp/ocp_croco_joint_state.py
Outdated
Show resolved
Hide resolved
agimus_controller/agimus_controller/ocp/ocp_croco_joint_state.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Naveau <[email protected]>
Co-authored-by: Naveau <[email protected]>
Co-authored-by: Krzysztof Wojciechowski <[email protected]>
Co-authored-by: Krzysztof Wojciechowski <[email protected]>
Co-authored-by: Krzysztof Wojciechowski <[email protected]>
Co-authored-by: Krzysztof Wojciechowski <[email protected]>
Seems like all comments were addressed, I'm in favor of merging this PR. |
agimus_controller/agimus_controller/ocp/ocp_croco_goal_reaching.py
Outdated
Show resolved
Hide resolved
ee_cost.cost.residual.reference = reference_weighted_trajectory[ | ||
-1 | ||
].point.end_effector_poses["panda_hand_tcp"] | ||
ee_cost.cost.activation.weights = reference_weighted_trajectory[ | ||
i | ||
].weight.w_end_effector_poses["panda_hand_tcp"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think panda_hand_tcp
should be hardcoded?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes because if you don't want to use this ocp you just recreate one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would still have it as a parameter, maybe set in init, default to panda_hand_tcp (and maybe a check that robot model actually has this one)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should avoid hardcoding things such as weights or names as much as it can be. This ocp implementation respects this principle quite well already, except for panda_hand_tcp
.
ResidualModelFramePlacement() does require a frame_id as an input to its constructor function but
I think I would put a dummy value, like the rest of the weights/references:
framePlacementResidual = crocoddyl.ResidualModelFramePlacement(
self._state,
0,
pin.SE3.Identity(),
)
and then update it in set_reference_weighted_trajectory
using sth like:
# setting running model goal tracking reference, weight and frame id
# assuming exactly one end-effector tracking reference was passed to the trajectory
ee_name = reference_weighted_trajectory[i].weight.w_end_effector_poses.keys()[0]
ee_id = self._robot_models.robot_model.getFrameId("panda_hand_tcp")
ee_cost = self._solver.problem.runningModels[i].differential.costs.costs["goalTracking"]
ee_cost.set_id(ee_id)
ee_cost.cost.activation.weights = reference_weighted_trajectory[i].weight.w_end_effector_poses[ee_name]
ee_cost.cost.residual.reference = reference_weighted_trajectory[i].point.end_effector_poses[ee_name]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough, i'm committing the changes
agimus_controller/agimus_controller/ocp/ocp_croco_goal_reaching.py
Outdated
Show resolved
Hide resolved
…g.py Co-authored-by: Krzysztof Wojciechowski <[email protected]>
…g.py Co-authored-by: Krzysztof Wojciechowski <[email protected]>
Done. Should be ready to merge now. |
a8dac7c
into
agimus-project:topic/humble-devel/refactor
Thanks for the work! |
This is the OCP for exp3.
It hasn't been tested yet but that's the gist of it.