16 const Eigen::VectorXd& masses,
20 auto base_accel = feedback[0].imu().accelerometer().get();
21 Vector3d gravity(-base_accel.getX(),
26 Eigen::Vector3d normed_gravity = gravity;
27 normed_gravity /= normed_gravity.norm();
28 normed_gravity *= 9.81;
39 Eigen::VectorXd comp_torque(num_dof);
40 comp_torque.setZero();
43 Eigen::VectorXd wrench_vec(6);
45 for (
size_t i = 0; i < num_frames; ++i)
48 for (
size_t j = 0; j < 3; ++j)
50 wrench_vec[j] = -normed_gravity[j] * masses[i];
54 comp_torque += jacobians[i].transpose() * wrench_vec;
A list of Feedback objects that can be received from a Group of modules; the size() must match the nu...
static Eigen::VectorXd getGravCompEfforts(const hebi::robot_model::RobotModel &model, const Eigen::VectorXd &masses, const hebi::GroupFeedback &feedback)
Eigen::VectorXd getPosition() const
Convenience function for returning feedback position values.
Represents a chain or tree of robot elements (rigid bodies and joints).
size_t getDoFCount() const
Returns the number of settable degrees of freedom in the kinematic tree. (This is equal to the number...
void getJ(FrameType, const Eigen::VectorXd &positions, MatrixXdVector &jacobians) const
Generates the Jacobian for each frame in the given kinematic tree.
size_t getFrameCount(FrameType frame_type) const
Return the number of frames in the forward kinematics.
std::vector< MatrixXd, Eigen::aligned_allocator< Eigen::MatrixXd > > MatrixXdVector