Skip to content

Commit

Permalink
fixed 1d force derivatives
Browse files Browse the repository at this point in the history
  • Loading branch information
skleff1994 committed Oct 25, 2023
1 parent b0d40e7 commit 75240e2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions bindings/python/crocoddyl/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1183,8 +1183,8 @@ def createData(self, data):
def updateForce(self, data, force):
assert force.shape[0] == 1
nv = self.state.nv
data.f.linear[0] = force[0]
data.f.linear[1:] = np.zeros(2)
data.f.linear[2] = force[0]
data.f.linear[:2] = np.zeros(2)
data.f.angular = np.zeros(3)
if self.type == pinocchio.LOCAL:
data.fext.linear = data.jMf.rotation[:,2] * force[0]
Expand Down
4 changes: 2 additions & 2 deletions include/crocoddyl/multibody/contacts/contact-1d.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ void ContactModel1DTpl<Scalar>::updateForce(
}
Data* d = static_cast<Data*>(data.get());
const Eigen::Ref<const Matrix3s> R = d->jMf.rotation();
data->f.linear()[0] = force[0];
data->f.linear().template tail<2>().setZero();
data->f.linear()[2] = force[0];
data->f.linear().template head<2>().setZero();
data->f.angular().setZero();
switch (type_) {
case pinocchio::ReferenceFrame::LOCAL:
Expand Down

0 comments on commit 75240e2

Please sign in to comment.