38 n_joints_per_leg_ = n_joints_per_leg;
39 n_joints_ = n_ee * n_joints_per_leg;
41 SetAll(VectorXd::Constant(n_joints_per_leg, value));
44 Joints::Joints (
const std::vector<VectorXd>& q_vec)
45 : Joints(q_vec.size(), q_vec.front().rows())
47 for (
auto ee : GetEEsOrdered())
48 at(ee) = q_vec.at(ee);
52 Joints::GetNumJoints ()
const
58 Joints::GetNumJointsPerEE ()
const
60 return n_joints_per_leg_;
64 Joints::ToVec (
const EEOrder& ee_order)
const
69 for (
auto ee : ee_order) {
70 q_combined.middleRows(j, n_joints_per_leg_) = at(ee);
71 j += n_joints_per_leg_;
78 Joints::SetFromVec (
const VectorXd&
xpp,
const EEOrder& ee_order)
82 for (
auto ee : ee_order) {
83 at(ee) =
xpp.middleRows(j, n_joints_per_leg_);
84 j += n_joints_per_leg_;
89 Joints::ToVec ()
const
91 return ToVec(GetEEsOrdered());
95 Joints::SetFromVec (
const VectorXd& q)
97 SetFromVec(q, GetEEsOrdered());
101 Joints::GetJoint (JointID joint)
103 div_t result = std::div(joint, n_joints_per_leg_);
105 return at(ee)[result.rem];
109 Joints::GetJoint (JointID joint)
const
111 return ToVec()[joint];