Thanks for open sourcing your repo. This is extremely helpful to the legged community! When reading the ocs2_centroidal_model, there are some parts that I cannot figure out by myself and hopefully can get some help from you guys. It's briefly discussed in #15 but more information will be helpful.
In CentroidalModelPinocchioMapping.cpp, to create a mapping between the ocs2 state and pinocchio state, we need to get all the partial derivatives, but I'm not quite how you determine some of them. If we write down the centroidal dynamics as:
If we write the centroidal dynamics as an implicit function:
The differential is then:
Then if I understand correctly, ocs2 state $x$ and control $u$, pinocchio position $q$ and velocity $v$ are defined as:
To goal is to find the following jacobians:
By following the implicit differential theorem, some of the terms make sense, for example, if we wish to compute the partial $\frac{\partial{\dot{q}}_b}{\partial{q}_b}$, set $\text{d} {q}_b = {I}$, and all other differentials, except $\text{d} {\dot{q}}_b$, to ${0}$, and solve for $\text{d} {\dot{q}}_b$. The resulting expression is the desired analytical partial derivative.
similarly,
However, if we try to derive this one $\frac{\partial {\dot{q}}_j}{\partial {\bar{h}}_G}$:
It is not clear what the analytical expression for $\frac{\partial {\dot{q}}_j}{\partial {\bar{h}}_G}$ is from the above equation. However, it's clear that $\frac{\partial {\dot{q}}_j}{\partial {\bar{h}}_G} \neq {0}$. Similarly, the entire bottom row block of $\frac{\partial {v}}{\partial {x}}$ shouldn't be ${0}$, but left as ${0}$ here
If we try another partial derivative, $\frac{\partial {q}_b}{\partial {q}_j}$:
Or $\frac{\partial {q}_j}{\partial {q}_b}$:
Again, similar to $\frac{\partial {\dot{q}}_j}{\partial {\bar{h}}_G}$, it's not clear what the analytical expression should be for $\frac{\partial {q}_j}{\partial {q}_b}$ given the relation derived in above equation.
Is there anything I was missing in deriving these partial derivatives?
Hi ocs2 team.
Thanks for open sourcing your repo. This is extremely helpful to the legged community! When reading the ocs2_centroidal_model, there are some parts that I cannot figure out by myself and hopefully can get some help from you guys. It's briefly discussed in #15 but more information will be helpful.
In CentroidalModelPinocchioMapping.cpp, to create a mapping between the ocs2 state and pinocchio state, we need to get all the partial derivatives, but I'm not quite how you determine some of them. If we write down the centroidal dynamics as:
If we write the centroidal dynamics as an implicit function: The differential is then:
Then if I understand correctly, ocs2 state $x$ and control $u$, pinocchio position $q$ and velocity $v$ are defined as: To goal is to find the following jacobians:
By following the implicit differential theorem, some of the terms make sense, for example, if we wish to compute the partial $\frac{\partial{\dot{q}}_b}{\partial{q}_b}$, set $\text{d} {q}_b = {I}$, and all other differentials, except $\text{d} {\dot{q}}_b$, to ${0}$, and solve for $\text{d} {\dot{q}}_b$. The resulting expression is the desired analytical partial derivative. similarly,
However, if we try to derive this one $\frac{\partial {\dot{q}}_j}{\partial {\bar{h}}_G}$: It is not clear what the analytical expression for $\frac{\partial {\dot{q}}_j}{\partial {\bar{h}}_G}$ is from the above equation. However, it's clear that $\frac{\partial {\dot{q}}_j}{\partial {\bar{h}}_G} \neq {0}$. Similarly, the entire bottom row block of $\frac{\partial {v}}{\partial {x}}$ shouldn't be ${0}$, but left as ${0}$ here
If we try another partial derivative, $\frac{\partial {q}_b}{\partial {q}_j}$:
Or $\frac{\partial {q}_j}{\partial {q}_b}$: Again, similar to $\frac{\partial {\dot{q}}_j}{\partial {\bar{h}}_G}$, it's not clear what the analytical expression should be for $\frac{\partial {q}_j}{\partial {q}_b}$ given the relation derived in above equation.
Is there anything I was missing in deriving these partial derivatives?
Thanks a lot in advance.