39 updateNetWrench(robot);
40 updateNetZMP(contact);
43 void NetWrenchObserver::updateNetWrench(
const mc_rbdyn::Robot & robot)
45 netWrench_ = sva::ForceVecd::Zero();
46 for(std::string sensorName : sensorNames_)
48 const auto & sensor = robot.forceSensor(sensorName);
49 if(sensor.force().z() > 1.)
51 netWrench_ += sensor.worldWrench(robot);
56 void NetWrenchObserver::updateNetZMP(
const Contact & contact)
58 const Eigen::Vector3d & force = netWrench_.force();
59 const Eigen::Vector3d & moment_0 = netWrench_.couple();
60 Eigen::Vector3d moment_p = moment_0 - contact.
p().cross(force);
61 if(force.dot(force) > 42.)
63 netZMP_ = contact.
p() + contact.
normal().cross(moment_p) / contact.
normal().dot(force);
void update(const mc_rbdyn::Robot &robot, const Contact &contact)
Update estimates based on the sensed net contact wrench.
EIGEN_MAKE_ALIGNED_OPERATOR_NEW NetWrenchObserver()
Empty constructor.
Main controller namespace.