loco-3d / crocoddyl

Crocoddyl is an optimal control library for robot control under contact sequence. Its solver is based on various efficient Differential Dynamic Programming (DDP)-like algorithms
BSD 3-Clause "New" or "Revised" License
845 stars 173 forks source link

Adding mass or losing mass #875

Closed ddliu365 closed 4 years ago

ddliu365 commented 4 years ago

I try to work on a problem with adding or losing mass from a humanoid.

For example, we may give humanoid a book and or it can throw a ball.

With TSID, it is easier to do this task, but I am wondering if we can do it with crocoddyl.

My initial idea is to add force on the end effector but I realize the force between the object and the end effector is varying according to object's acceleration. It seems nontrivial to solve this problem.

Is it possible to consider this problem under Crocoddyl framework?

cmastalli commented 4 years ago

Hi @ddliu365,

A workaround is to define a new URDF model that includes the extra weight in the body that carries it out. You will need to define a phase of events: e.g. carrying an object and then throwing it, where each phase will have different URDF models (or precisely multibody states).

Your initial idea is not yet clear for me. In any case, in Crocoddyl, there are no theoretical limitations if you wish to incorporate the object dynamics into the optimal control problem. However, it requires development and research from your side.

Does this answer clarify your doubts? If so, could you close this issue?

jcarpent commented 4 years ago

Be simple. Just append an inertia to the inertia of the end effector which is holding the weight. No need at all to define a new URDF.

ddliu365 commented 4 years ago

Hi @ddliu365,

A workaround is to define a new URDF model that includes the extra weight in the body that carries it out. You will need to define a phase of events: e.g. carrying an object and then throwing it, where each phase will have different URDF models (or precisely multibody states).

Your initial idea is not yet clear for me. In any case, in Crocoddyl, there are no theoretical limitations if you wish to incorporate the object dynamics into the optimal control problem. However, it requires development and research from your side.

Does this answer clarify your doubts? If so, could you close this issue?

@cmastalli

That's the exact thing I want to do. My initial idea is like force control method which doesn't fit to ddp approach.

ddliu365 commented 4 years ago

Be simple. Just append an inertia to the inertia of the end effector which is holding the weight. No need at all to define a new URDF.

@jcarpent I think adding inertia is more efficient compared with updating Urdf. However I am not familiar to the library(Pinocchio or Crocoddyl). Which method or function should I use for adding inertia without updating the Urdf?

jcarpent commented 4 years ago

Model::appendInertia is your solution.

cmastalli commented 4 years ago

Yes, It is better to append the inertia. Indeed, I was referring to that but somehow I said "new URDF".

What you really need is a new Pinocchio model ;)

ddliu365 commented 4 years ago

Thanks. I see the point and will implement that.