-
Notifications
You must be signed in to change notification settings - Fork 214
How to create velocity control action models from pinocchio model #1131
Hi,
I see that when creating an action model using a Pinocchio model, the examples were doing something like this:
state = crocoddyl.StateMultibody(env.robot.model) actuation = crocoddyl.ActuationModelFull(state)
Then the action model is created using
DAM = crocoddyl.DifferentialActionModelFreeFwdDynamics(state, actuation, runningCostModel) Model = crocoddyl.IntegratedActionModelEuler(DAM, dt)
I believe, in this case, the action model's control is at the torque level. If I want to solve for the optimal joint velocities, how would I do it?
Thanks in advance!
All reactions
Replies: 1 comment 2 replies
Hi,
I see that when creating an action model using a Pinocchio model, the examples were doing something like this:
state = crocoddyl.StateMultibody(env.robot.model) actuation = crocoddyl.ActuationModelFull(state)Then the action model is created using
DAM = crocoddyl.DifferentialActionModelFreeFwdDynamics(state, actuation, runningCostModel) Model = crocoddyl.IntegratedActionModelEuler(DAM, dt)I believe, in this case, the action model's control is at the torque level. If I want to solve for the optimal joint velocities, how would I do it?
Thanks in advance!
@BolunDai0216 -- To understand Crocoddyl's formulations, it would be helpful if you read our papers before:
- https://arxiv.org/pdf/1909.04947.pdf (forward dynamics)
- https://arxiv.org/pdf/2209.05375.pdf (inverse dynamics)
None of these formulations take the joint velocities as a control input. However, you can extract the optimal generalised velocities from both of them's solutions. The optimal joint velocities are inside the optimal state, which is defined as
x_opt = solver.xs[I] v_opt = x_opt[:state.nv]
Moreover, it doesn't make sense to formulate an OP problem where its inputs are generalised velocities; what makes sense is generalised accelerations. Indeed, this is how the inverse-dynamics formulation works. In our implementation of the inverse-dynamics formulation, you can also disable the RNEA equality constraints, which in practice means "optimising for kinematics only". This seems to be what you need.
All reactions
@cmastalli Thanks for the response!
For the inverse-dynamics formulation, how would I create my action model? Is it possible to provide or point me to an example?
The reason I am using joint velocity control is that, from my experience, you can do it at a lower control frequency.
In your experiments, do you directly use the joint torques computed using Crocoddyl or is there some low-level controller that tracks the generated motion?
All reactions
You don't have to create a new inverse-dynamics action or even use it if you need to use joint velocities as controller commands. We also use joint torque commands as there are many good reasons to do so. If you read our work you can get more details.