6 #include "pinocchio/algorithm/joint-configuration.hpp" 32 Eigen::MatrixXd J0(Eigen::MatrixXd::Zero(model.
nv,model.
nv));
33 Eigen::MatrixXd J1(Eigen::MatrixXd::Zero(model.
nv,model.
nv));
38 return bp::make_tuple(J0,J1);
46 Eigen::MatrixXd
J(Eigen::MatrixXd::Zero(model.
nv,model.
nv));
56 const Eigen::MatrixXd & Jin,
59 int ncols = Jin.cols();
60 Eigen::MatrixXd Jout(Eigen::MatrixXd::Zero(model.
nv,ncols));
69 Eigen::MatrixXd J0(Eigen::MatrixXd::Zero(model.
nv,model.
nv));
70 Eigen::MatrixXd J1(Eigen::MatrixXd::Zero(model.
nv,model.
nv));
75 return bp::make_tuple(J0,J1);
83 Eigen::MatrixXd
J(Eigen::MatrixXd::Zero(model.
nv,model.
nv));
92 using namespace Eigen;
95 &integrate<double,0,JointCollectionDefaultTpl,VectorXd,VectorXd>,
96 bp::args(
"model",
"q",
"v"),
97 "Integrate the joint configuration vector q with a tangent vector v during one unit time.\n" 98 "This is the canonical integrator of a Configuration Space composed of Lie groups, such as most robots.\n\n" 100 "\tmodel: model of the kinematic tree\n" 101 "\tq: the joint configuration vector (size model.nq)\n" 102 "\tv: the joint velocity vector (size model.nv)\n");
104 bp::def(
"dIntegrate",
106 bp::args(
"model",
"q",
"v"),
107 "Computes the partial derivatives of the integrate function with respect to the first " 108 "and the second argument, and returns the two Jacobians as a tuple.\n\n" 110 "\tmodel: model of the kinematic tree\n" 111 "\tq: the joint configuration vector (size model.nq)\n" 112 "\tv: the joint velocity vector (size model.nv)\n");
114 bp::def(
"dIntegrate",
116 bp::args(
"model",
"q",
"v",
"argument_position"),
117 "Computes the partial derivatives of the integrate function with respect to the first (arg == ARG0) " 118 "or the second argument (arg == ARG1).\n\n" 120 "\tmodel: model of the kinematic tree\n" 121 "\tq: the joint configuration vector (size model.nq)\n" 122 "\tv: the joint velocity vector (size model.nv)\n" 123 "\targument_position: either pinocchio.ArgumentPosition.ARG0 or pinocchio.ArgumentPosition.ARG1, depending on the desired Jacobian value.\n");
125 bp::def(
"dIntegrateTransport",
127 bp::args(
"model",
"q",
"v",
"Jin",
"argument_position"),
128 "Takes a matrix expressed at q (+) v and uses parallel transport to express it in the tangent space at q." 129 "\tThis operation does the product of the matrix by the Jacobian of the integration operation, but more efficiently." 131 "\tmodel: model of the kinematic tree\n" 132 "\tq: the joint configuration vector (size model.nq)\n" 133 "\tv: the joint velocity vector (size model.nv)\n" 134 "\tJin: the input matrix (row size model.nv)" 135 "\targument_position: either pinocchio.ArgumentPosition.ARG0 (q) or pinocchio.ArgumentPosition.ARG1 (v), depending on the desired Jacobian value.\n");
137 bp::def(
"interpolate",
138 &interpolate<double,0,JointCollectionDefaultTpl,VectorXd,VectorXd>,
139 bp::args(
"model",
"q1",
"q2",
"alpha"),
140 "Interpolate between two given joint configuration vectors q1 and q2.\n\n" 142 "\tmodel: model of the kinematic tree\n" 143 "\tq1: the initial joint configuration vector (size model.nq)\n" 144 "\tq2: the terminal joint configuration vector (size model.nq)\n" 145 "\talpha: the interpolation coefficient in [0,1]\n");
147 bp::def(
"difference",
148 &difference<double,0,JointCollectionDefaultTpl,VectorXd,VectorXd>,
149 bp::args(
"model",
"q1",
"q2"),
150 "Difference between two joint configuration vectors, i.e. the tangent vector that must be integrated during one unit time" 151 "to go from q1 to q2.\n\n" 153 "\tmodel: model of the kinematic tree\n" 154 "\tq1: the initial joint configuration vector (size model.nq)\n" 155 "\tq2: the terminal joint configuration vector (size model.nq)\n");
157 bp::def(
"squaredDistance",
158 &squaredDistance<double,0,JointCollectionDefaultTpl,VectorXd,VectorXd>,
159 bp::args(
"model",
"q1",
"q2"),
160 "Squared distance vector between two joint configuration vectors.\n\n" 162 "\tmodel: model of the kinematic tree\n" 163 "\tq1: the initial joint configuration vector (size model.nq)\n" 164 "\tq2: the terminal joint configuration vector (size model.nq)\n");
167 &distance<double,0,JointCollectionDefaultTpl,VectorXd,VectorXd>,
168 bp::args(
"model",
"q1",
"q2"),
169 "Distance between two joint configuration vectors.\n\n" 171 "\tmodel: model of the kinematic tree\n" 172 "\tq1: the initial joint configuration vector (size model.nq)\n" 173 "\tq2: the terminal joint configuration vector (size model.nq)\n");
175 bp::def(
"dDifference",
177 bp::args(
"model",
"q1",
"q2"),
178 "Computes the partial derivatives of the difference function with respect to the first " 179 "and the second argument, and returns the two Jacobians as a tuple.\n\n" 181 "\tmodel: model of the kinematic tree\n" 182 "\tq1: the initial joint configuration vector (size model.nq)\n" 183 "\tq2: the terminal joint configuration vector (size model.nq)\n");
185 bp::def(
"dDifference",
187 bp::args(
"model",
"q1",
"q2",
"argument_position"),
188 "Computes the partial derivatives of the difference function with respect to the first (arg == ARG0) " 189 "or the second argument (arg == ARG1).\n\n" 191 "\tmodel: model of the kinematic tree\n" 192 "\tq1: the initial joint configuration vector (size model.nq)\n" 193 "\tq2: the terminal joint configuration vector (size model.nq)\n" 194 "\targument_position: either pinocchio.ArgumentPosition.ARG0 or pinocchio.ArgumentPosition.ARG1, depending on the desired Jacobian value.\n");
196 bp::def(
"randomConfiguration",
199 "Generate a random configuration in the bounds given by the lower and upper limits contained in model.\n\n" 201 "\tmodel: model of the kinematic tree\n");
203 bp::def(
"randomConfiguration",
204 &randomConfiguration<double,0,JointCollectionDefaultTpl,VectorXd,VectorXd>,
205 bp::args(
"model",
"lower_bound",
"upper_bound"),
206 "Generate a random configuration in the bounds given by the Joint lower and upper limits arguments.\n\n" 208 "\tmodel: model of the kinematic tree\n" 209 "\tlower_bound: the lower bound on the joint configuration vectors (size model.nq)\n" 210 "\tupper_bound: the upper bound on the joint configuration vectors (size model.nq)\n");
213 &neutral<double,0,JointCollectionDefaultTpl>,
215 "Returns the neutral configuration vector associated to the model.\n\n" 217 "\tmodel: model of the kinematic tree\n");
220 bp::args(
"model",
"q"),
221 "Returns the configuration normalized.\n" 222 "For instance, when the configuration vectors contains some quaternion values, it must be required to renormalize these components to keep orthonormal rotation values.\n\n" 224 "\tmodel: model of the kinematic tree\n" 225 "\tq: a joint configuration vector to normalize (size model.nq)\n");
227 bp::def(
"isSameConfiguration",
228 &isSameConfiguration<double,0,JointCollectionDefaultTpl,VectorXd,VectorXd>,
229 bp::args(
"model",
"q1",
"q2",
"prec"),
230 "Return true if two configurations are equivalent within the given precision provided by prec.\n\n" 232 "\tmodel: model of the kinematic tree\n" 233 "\tq1: a joint configuration vector (size model.nq)\n" 234 "\tq2: a joint configuration vector (size model.nq)\n" 235 "\tprec: requested accuracy for the comparison\n");
237 bp::def(
"isNormalized",
238 &isNormalized<double,0,JointCollectionDefaultTpl,VectorXd>,
239 isNormalized_overload(
240 bp::args(
"model",
"q",
"prec"),
241 "Check whether a configuration vector is normalized within the given precision provided by prec.\n\n" 243 "\tmodel: model of the kinematic tree\n" 244 "\tq: a joint configuration vector (size model.nq)\n" 245 "\tprec: requested accuracy for the check\n"
ArgumentPosition
Argument position. Used as template parameter to refer to an argument.
bp::tuple dDifference_proxy(const Model &model, const Eigen::VectorXd &q1, const Eigen::VectorXd &q2)
void dDifference(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const Eigen::MatrixBase< ConfigVector1 > &q0, const Eigen::MatrixBase< ConfigVector2 > &q1, const Eigen::MatrixBase< JacobianMatrix > &J, const ArgumentPosition arg)
Computes the Jacobian of a small variation of the configuration vector into the tangent space at iden...
bool isNormalized(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const Eigen::MatrixBase< ConfigVectorType > &q, const Scalar &prec=Eigen::NumTraits< Scalar >::dummy_precision())
Check whether a configuration vector is normalized within the given precision provided by prec...
BOOST_PYTHON_FUNCTION_OVERLOADS(computeKKTContactDynamicMatrixInverse_overload, computeKKTContactDynamicMatrixInverse_proxy, 4, 5) static const Eigen
void randomConfiguration(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const Eigen::MatrixBase< ConfigVectorIn1 > &lowerLimits, const Eigen::MatrixBase< ConfigVectorIn2 > &upperLimits, const Eigen::MatrixBase< ReturnType > &qout)
Generate a configuration vector uniformly sampled among provided limits.
JointCollectionTpl const Eigen::MatrixBase< ConfigVectorType > & q
void dIntegrateTransport(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const Eigen::MatrixBase< ConfigVectorType > &q, const Eigen::MatrixBase< TangentVectorType > &v, const Eigen::MatrixBase< JacobianMatrixType1 > &Jin, const Eigen::MatrixBase< JacobianMatrixType2 > &Jout, const ArgumentPosition arg)
Transport a matrix from the terminal to the originate tangent space of the integrate operation...
void dIntegrate(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const Eigen::MatrixBase< ConfigVectorType > &q, const Eigen::MatrixBase< TangentVectorType > &v, const Eigen::MatrixBase< JacobianMatrixType > &J, const ArgumentPosition arg, const AssignmentOperatorType op=SETTO)
Computes the Jacobian of a small variation of the configuration vector or the tangent vector into the...
static Eigen::VectorXd randomConfiguration_proxy(const Model &model)
JointCollectionTpl const Eigen::MatrixBase< ConfigVectorIn1 > const Eigen::MatrixBase< ConfigVectorIn2 > & q1
static Eigen::VectorXd normalize_proxy(const Model &model, const Eigen::VectorXd &config)
Eigen::MatrixXd dIntegrateTransport_proxy(const Model &model, const Eigen::VectorXd &q, const Eigen::VectorXd &v, const Eigen::MatrixXd &Jin, const ArgumentPosition arg)
Eigen::MatrixXd dDifference_arg_proxy(const Model &model, const Eigen::VectorXd &q1, const Eigen::VectorXd &q2, const ArgumentPosition arg)
Main pinocchio namespace.
int nv
Dimension of the velocity vector space.
bp::tuple dIntegrate_proxy(const Model &model, const Eigen::VectorXd &q, const Eigen::VectorXd &v)
void normalize(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const Eigen::MatrixBase< ConfigVectorType > &qout)
Normalize a configuration vector.
Eigen::MatrixXd dIntegrate_arg_proxy(const Model &model, const Eigen::VectorXd &q, const Eigen::VectorXd &v, const ArgumentPosition arg)
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > VectorXd
JointCollectionTpl & model