66 :
public bp::def_visitor<BinaryKinematicsConstraintModelBasePythonVisitor<T>>
68 typedef typename T::ConstraintData ConstraintData;
69 typedef typename T::MatrixSize6 MatrixSize6;
70 typedef typename T::SE3 SE3;
71 typedef context::Model Model;
74 template<
class PyClass>
75 void visit(PyClass & cl)
const 78 bp::init<const Model &, JointIndex, const SE3 &, JointIndex, const SE3 &>(
79 (bp::arg(
"self"), bp::arg(
"model"), bp::arg(
"joint1_id"), bp::arg(
"joint1_placement"),
80 bp::arg(
"joint2_id"), bp::arg(
"joint2_placement")),
81 "Constructor from given joint index and placement for the two joints " 82 "implied in the constraint."))
84 bp::init<const Model &, JointIndex>(
85 (bp::arg(
"self"), bp::arg(
"model"), bp::arg(
"joint1_id")),
86 "Constructor from given joint index of the first joint " 87 "implied in the constraint."))
89 bp::init<const Model &, JointIndex, const SE3 &>(
90 (bp::arg(
"self"), bp::arg(
"model"), bp::arg(
"joint1_id"),
91 bp::arg(
"joint1_placement")),
92 "Constructor from given joint index and placement of the first joint " 93 "implied in the constraint."))
95 bp::init<const Model &, JointIndex, JointIndex>(
96 (bp::arg(
"self"), bp::arg(
"model"), bp::arg(
"joint1_id"), bp::arg(
"joint2_id")),
97 "Constructor from given joint index for the two joints " 98 "implied in the constraint."))
100 bp::init<const Model &>(
101 (bp::arg(
"self"), bp::arg(
"model")),
"Constructor from the model only."))
103 "getA1", &getA1, bp::args(
"self",
"constraint_data",
"reference_frame"),
104 "Returns the constraint projector associated with joint 1. " 105 "This matrix transforms a spatial velocity expressed in a reference frame " 106 "to the first component of the constraint associated with joint 1.")
108 "getA2", &getA2, bp::args(
"self",
"constraint_data",
"reference_frame"),
109 "Returns the constraint projector associated with joint 2. " 110 "This matrix transforms a spatial velocity expressed in a reference frame " 111 "to the first component of the constraint associated with joint 2.")
112 .PINOCCHIO_ADD_PROPERTY(T, joint1_id,
"Index of the first joint in the model tree.")
113 .PINOCCHIO_ADD_PROPERTY(T, joint2_id,
"Index of the second joint in the model tree.")
114 .PINOCCHIO_ADD_PROPERTY(
115 T, joint1_placement,
"Position of attached point with respect to the frame of joint1.")
116 .PINOCCHIO_ADD_PROPERTY(
117 T, joint2_placement,
"Position of attached point with respect to the frame of joint2.")
118 .PINOCCHIO_ADD_PROPERTY(
119 T, desired_constraint_offset,
"Desired constraint shift at position level.")
120 .PINOCCHIO_ADD_PROPERTY(
121 T, desired_constraint_velocity,
"Desired constraint velocity at velocity level.")
122 .PINOCCHIO_ADD_PROPERTY(
123 T, desired_constraint_acceleration,
124 "Desired constraint velocity at acceleration level.")
125 .PINOCCHIO_ADD_PROPERTY(T, nv,
"Dimension of the model velocity.")
126 .PINOCCHIO_ADD_PROPERTY(T, depth_joint1,
"Depth of the kinematic tree for joint1.")
127 .PINOCCHIO_ADD_PROPERTY(T, depth_joint2,
"Depth of the kinematic tree for joint2.");
131 getA1(
const T & self,
const ConstraintData & constraint_data, ReferenceFrame rf)
137 res = self.getA1(constraint_data, WorldFrameTag());
140 res = self.getA1(constraint_data, LocalFrameTag());
142 case LOCAL_WORLD_ALIGNED:
143 res = self.getA1(constraint_data, LocalWorldAlignedFrameTag());
150 getA2(
const T & self,
const ConstraintData & constraint_data, ReferenceFrame rf)
156 res = self.getA2(constraint_data, WorldFrameTag());
159 res = self.getA2(constraint_data, LocalFrameTag());
161 case LOCAL_WORLD_ALIGNED:
162 res = self.getA2(constraint_data, LocalWorldAlignedFrameTag());
182 :
public bp::def_visitor<PointConstraintModelBasePythonVisitor<T>>
185 template<
class PyClass>
186 void visit(PyClass & cl)
const 189 "computeConstraintSpatialInertia", &computeConstraintSpatialInertia,
190 bp::args(
"self",
"placement",
"diagonal_constraint_inertia"),
191 "This function computes the spatial inertia associated with the constraint.");
195 static context::Matrix6s computeConstraintSpatialInertia(
197 const context::SE3 & placement,
198 const context::Vector3s & diagonal_constraint_inertia)
200 return self.computeConstraintSpatialInertia(
201 placement, diagonal_constraint_inertia.asDiagonal());