22 res[0] = -2.0f * (xz - yw);
23 res[1] = -2.0f * (yz + xw);
24 res[2] = -1.0f + 2.0f * (xx + yy);
34 "Use hebi::robot_model::RobotModel::getGravCompEfforts or hebi::Arm GravCompEfforts plug-in " 35 "instead.")]]
static Eigen::VectorXd
40 auto base_accel = feedback[0].imu().accelerometer().get();
41 Vector3d gravity(-base_accel.getX(), -base_accel.getY(), -base_accel.getZ());
44 Eigen::Vector3d normed_gravity = gravity;
45 normed_gravity /= normed_gravity.norm();
46 normed_gravity *= 9.81;
49 Eigen::VectorXd comp_torque(num_dof);
50 comp_torque.setZero();
Eigen::Vector3d gravityFromQuaternion(const hebi::Quaternionf &q)
Definition: grav_comp.hpp:13
A list of Feedback objects that can be received from a Group of modules; the size() must match the nu...
Definition: group_feedback.hpp:18
float getY() const
Returns the Y component of the quaternion.
Definition: quaternion_f.hpp:25
float getW() const
Returns the W component of the quaternion.
Definition: quaternion_f.hpp:21
static Eigen::VectorXd getGravCompEfforts(const hebi::robot_model::RobotModel &model, const Eigen::VectorXd &masses, const hebi::GroupFeedback &feedback)
Definition: grav_comp.hpp:36
float getZ() const
Returns the Z component of the quaternion.
Definition: quaternion_f.hpp:27
Eigen::VectorXd getPosition() const
Convenience function for returning feedback position values.
Definition: group_feedback.cpp:150
void getGravCompEfforts(const Eigen::VectorXd &angles, const Eigen::Vector3d &gravity, Eigen::VectorXd &comp_torque) const
Definition: robot_model.cpp:389
Structure to hold a floating point quaternion (i.e., w/x/y/z components)
Definition: quaternion_f.hpp:8
Represents a chain or tree of robot elements (rigid bodies and joints).
Definition: robot_model.hpp:412
size_t getDoFCount() const
Returns the number of settable degrees of freedom in the kinematic tree. (This is equal to the number...
Definition: robot_model.cpp:168
float getX() const
Returns the X component of the quaternion.
Definition: quaternion_f.hpp:23