Skip to content

Navigation Menu

Sign in
Sign up

How to create velocity control action models from pinocchio model #1131

BolunDai0216 started this conversation in General
Discussion options

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!

You must be logged in to vote

Replies: 1 comment 2 replies

Comment options

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:

  1. https://arxiv.org/pdf/1909.04947.pdf (forward dynamics)
  2. 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 $\mathbf{x} = [\mathbf{q}, \mathbf{v}]$. You can get them by

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.

You must be logged in to vote
2 replies
Comment options

@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?

Comment options

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /