12#include "rbdl/rbdl_config.h"
21#ifdef RBDL_USE_CASADI_MATH
33 return __sincos(x, sinp, cosp);
51 unsigned int joint_id,
56 assert (joint_id > 0);
58 if (model.mJoints[joint_id].mJointType == JointTypeRevoluteX) {
60 sincosp (q[model.mJoints[joint_id].q_index], &s, &c);
62 model.X_lambda[joint_id].E =
Matrix3d (
63 model.X_T[joint_id].E(0, 0),
64 model.X_T[joint_id].E(0, 1),
65 model.X_T[joint_id].E(0, 2),
67 c * model.X_T[joint_id].E(1, 0) + s * model.X_T[joint_id].E(2, 0),
68 c * model.X_T[joint_id].E(1, 1) + s * model.X_T[joint_id].E(2, 1),
69 c * model.X_T[joint_id].E(1, 2) + s * model.X_T[joint_id].E(2, 2),
71 -s * model.X_T[joint_id].E(1, 0) + c * model.X_T[joint_id].E(2, 0),
72 -s * model.X_T[joint_id].E(1, 1) + c * model.X_T[joint_id].E(2, 1),
73 -s * model.X_T[joint_id].E(1, 2) + c * model.X_T[joint_id].E(2, 2));
75 model.X_lambda[joint_id].r = model.X_T[joint_id].r;
77 model.v_J[joint_id][0] = qdot[model.mJoints[joint_id].q_index];
78 }
else if (model.mJoints[joint_id].mJointType == JointTypeRevoluteY) {
80 sincosp (q[model.mJoints[joint_id].q_index], &s, &c);
82 model.X_lambda[joint_id].E =
Matrix3d (
83 c * model.X_T[joint_id].E(0, 0) + -s * model.X_T[joint_id].E(2, 0),
84 c * model.X_T[joint_id].E(0, 1) + -s * model.X_T[joint_id].E(2, 1),
85 c * model.X_T[joint_id].E(0, 2) + -s * model.X_T[joint_id].E(2, 2),
87 model.X_T[joint_id].E(1, 0),
88 model.X_T[joint_id].E(1, 1),
89 model.X_T[joint_id].E(1, 2),
91 s * model.X_T[joint_id].E(0, 0) + c * model.X_T[joint_id].E(2, 0),
92 s * model.X_T[joint_id].E(0, 1) + c * model.X_T[joint_id].E(2, 1),
93 s * model.X_T[joint_id].E(0, 2) + c * model.X_T[joint_id].E(2, 2));
95 model.X_lambda[joint_id].r = model.X_T[joint_id].r;
97 model.v_J[joint_id][1] = qdot[model.mJoints[joint_id].q_index];
98 }
else if (model.mJoints[joint_id].mJointType == JointTypeRevoluteZ) {
100 sincosp (q[model.mJoints[joint_id].q_index], &s, &c);
102 model.X_lambda[joint_id].E =
Matrix3d (
103 c * model.X_T[joint_id].E(0, 0) + s * model.X_T[joint_id].E(1, 0),
104 c * model.X_T[joint_id].E(0, 1) + s * model.X_T[joint_id].E(1, 1),
105 c * model.X_T[joint_id].E(0, 2) + s * model.X_T[joint_id].E(1, 2),
107 -s * model.X_T[joint_id].E(0, 0) + c * model.X_T[joint_id].E(1, 0),
108 -s * model.X_T[joint_id].E(0, 1) + c * model.X_T[joint_id].E(1, 1),
109 -s * model.X_T[joint_id].E(0, 2) + c * model.X_T[joint_id].E(1, 2),
111 model.X_T[joint_id].E(2, 0),
112 model.X_T[joint_id].E(2, 1),
113 model.X_T[joint_id].E(2, 2));
115 model.X_lambda[joint_id].r = model.X_T[joint_id].r;
117 model.v_J[joint_id][2] = qdot[model.mJoints[joint_id].q_index];
118 }
else if (model.mJoints[joint_id].mJointType == JointTypeHelical) {
121 Scalar Jqd = qdot[model.mJoints[joint_id].q_index];
122 model.v_J[joint_id] = model.S[joint_id] * Jqd;
124 Vector3d St = model.S[joint_id].block(0,0,3,1);
125 Vector3d c = X_J.
E * model.mJoints[joint_id].mJointAxes[0].block(3,0,3,1);
129 model.X_lambda[joint_id] = X_J * model.X_T[joint_id];
130 }
else if (model.mJoints[joint_id].mDoFCount == 1 &&
131 model.mJoints[joint_id].mJointType != JointTypeCustom) {
133 model.v_J[joint_id] =
134 model.S[joint_id] * qdot[model.mJoints[joint_id].q_index];
135 model.X_lambda[joint_id] = X_J * model.X_T[joint_id];
136 }
else if (model.mJoints[joint_id].mJointType == JointTypeSpherical) {
140 model.multdof3_S[joint_id](0,0) = 1.;
141 model.multdof3_S[joint_id](1,1) = 1.;
142 model.multdof3_S[joint_id](2,2) = 1.;
144 Vector3d omega (qdot[model.mJoints[joint_id].q_index],
145 qdot[model.mJoints[joint_id].q_index+1],
146 qdot[model.mJoints[joint_id].q_index+2]);
149 omega[0], omega[1], omega[2],
151 model.X_lambda[joint_id] = X_J * model.X_T[joint_id];
152 }
else if (model.mJoints[joint_id].mJointType == JointTypeEulerZYX) {
153 Scalar q0 = q[model.mJoints[joint_id].q_index];
154 Scalar q1 = q[model.mJoints[joint_id].q_index + 1];
155 Scalar q2 = q[model.mJoints[joint_id].q_index + 2];
165 c0 * c1, s0 * c1, -s1,
166 c0 * s1 * s2 - s0 * c2, s0 * s1 * s2 + c0 * c2, c1 * s2,
167 c0 * s1 * c2 + s0 * s2, s0 * s1 * c2 - c0 * s2, c1 * c2
171 model.multdof3_S[joint_id](0,0) = -s1;
172 model.multdof3_S[joint_id](0,2) = 1.;
174 model.multdof3_S[joint_id](1,0) = c1 * s2;
175 model.multdof3_S[joint_id](1,1) = c2;
177 model.multdof3_S[joint_id](2,0) = c1 * c2;
178 model.multdof3_S[joint_id](2,1) = - s2;
180 Scalar qdot0 = qdot[model.mJoints[joint_id].q_index];
181 Scalar qdot1 = qdot[model.mJoints[joint_id].q_index + 1];
182 Scalar qdot2 = qdot[model.mJoints[joint_id].q_index + 2];
184 model.v_J[joint_id] =
185 model.multdof3_S[joint_id] *
Vector3d (qdot0, qdot1, qdot2);
187 model.c_J[joint_id].set(
189 -s1*s2*qdot0*qdot1 + c1*c2*qdot0*qdot2 - s2*qdot1*qdot2,
190 -s1*c2*qdot0*qdot1 - c1*s2*qdot0*qdot2 - c2*qdot1*qdot2,
192 model.X_lambda[joint_id] = X_J * model.X_T[joint_id];
193 }
else if (model.mJoints[joint_id].mJointType == JointTypeEulerXYZ) {
194 Scalar q0 = q[model.mJoints[joint_id].q_index];
195 Scalar q1 = q[model.mJoints[joint_id].q_index + 1];
196 Scalar q2 = q[model.mJoints[joint_id].q_index + 2];
206 c2 * c1, s2 * c0 + c2 * s1 * s0, s2 * s0 - c2 * s1 * c0,
207 -s2 * c1, c2 * c0 - s2 * s1 * s0, c2 * s0 + s2 * s1 * c0,
208 s1, -c1 * s0, c1 * c0
212 model.multdof3_S[joint_id](0,0) = c2 * c1;
213 model.multdof3_S[joint_id](0,1) = s2;
215 model.multdof3_S[joint_id](1,0) = -s2 * c1;
216 model.multdof3_S[joint_id](1,1) = c2;
218 model.multdof3_S[joint_id](2,0) = s1;
219 model.multdof3_S[joint_id](2,2) = 1.;
221 Scalar qdot0 = qdot[model.mJoints[joint_id].q_index];
222 Scalar qdot1 = qdot[model.mJoints[joint_id].q_index + 1];
223 Scalar qdot2 = qdot[model.mJoints[joint_id].q_index + 2];
225 model.v_J[joint_id] =
226 model.multdof3_S[joint_id] *
Vector3d (qdot0, qdot1, qdot2);
228 model.c_J[joint_id].set(
229 -s2*c1*qdot2*qdot0 - c2*s1*qdot1*qdot0 + c2*qdot2*qdot1,
230 -c2*c1*qdot2*qdot0 + s2*s1*qdot1*qdot0 - s2*qdot2*qdot1,
234 model.X_lambda[joint_id] = X_J * model.X_T[joint_id];
235 }
else if (model.mJoints[joint_id].mJointType == JointTypeEulerYXZ) {
236 Scalar q0 = q[model.mJoints[joint_id].q_index];
237 Scalar q1 = q[model.mJoints[joint_id].q_index + 1];
238 Scalar q2 = q[model.mJoints[joint_id].q_index + 2];
248 c2 * c0 + s2 * s1 * s0, s2 * c1, -c2 * s0 + s2 * s1 * c0,
249 -s2 * c0 + c2 * s1 * s0, c2 * c1, s2 * s0 + c2 * s1 * c0,
250 c1 * s0, - s1, c1 * c0),
253 model.multdof3_S[joint_id](0,0) = s2 * c1;
254 model.multdof3_S[joint_id](0,1) = c2;
256 model.multdof3_S[joint_id](1,0) = c2 * c1;
257 model.multdof3_S[joint_id](1,1) = -s2;
259 model.multdof3_S[joint_id](2,0) = -s1;
260 model.multdof3_S[joint_id](2,2) = 1.;
262 Scalar qdot0 = qdot[model.mJoints[joint_id].q_index];
263 Scalar qdot1 = qdot[model.mJoints[joint_id].q_index + 1];
264 Scalar qdot2 = qdot[model.mJoints[joint_id].q_index + 2];
266 model.v_J[joint_id] =
267 model.multdof3_S[joint_id] *
Vector3d (qdot0, qdot1, qdot2);
269 model.c_J[joint_id].set(
270 c2*c1*qdot2*qdot0 - s2*s1*qdot1*qdot0 - s2*qdot2*qdot1,
271 -s2*c1*qdot2*qdot0 - c2*s1*qdot1*qdot0 - c2*qdot2*qdot1,
275 model.X_lambda[joint_id] = X_J * model.X_T[joint_id];
276 }
else if (model.mJoints[joint_id].mJointType == JointTypeEulerZXY) {
277 Scalar q0 = q[model.mJoints[joint_id].q_index];
278 Scalar q1 = q[model.mJoints[joint_id].q_index + 1];
279 Scalar q2 = q[model.mJoints[joint_id].q_index + 2];
290 -s0 * s1 * s2 + c0 * c2, s0 * c2 + s1 * s2 * c0, -s2 * c1,
291 -s0 * c1, c0 * c1, s1,
292 s0 * s1 * c2 + s2 * c0, s0 * s2 - s1 * c0 * c2, c1 * c2
295 * model.X_T[joint_id];
297 model.multdof3_S[joint_id](0,0) = -s2 * c1;
298 model.multdof3_S[joint_id](0,1) = c2;
300 model.multdof3_S[joint_id](1,0) = s1;
301 model.multdof3_S[joint_id](1,2) = 1;
303 model.multdof3_S[joint_id](2,0) = c1 * c2;
304 model.multdof3_S[joint_id](2,1) = s2;
306 Scalar qdot0 = qdot[model.mJoints[joint_id].q_index];
307 Scalar qdot1 = qdot[model.mJoints[joint_id].q_index + 1];
308 Scalar qdot2 = qdot[model.mJoints[joint_id].q_index + 2];
310 model.v_J[joint_id] =
311 model.multdof3_S[joint_id] *
Vector3d (qdot0, qdot1, qdot2);
313 model.c_J[joint_id].set(
314 (-c1 * c2 * qdot2 + s1 * s2 * qdot1) * qdot0 - s2 * qdot1 * qdot2,
316 (-s1 * c2 * qdot1 - c1 * s2 * qdot2) * qdot0 + c2 * qdot2 * qdot1,
319 }
else if(model.mJoints[joint_id].mJointType == JointTypeTranslationXYZ){
320 Scalar q0 = q[model.mJoints[joint_id].q_index];
321 Scalar q1 = q[model.mJoints[joint_id].q_index + 1];
322 Scalar q2 = q[model.mJoints[joint_id].q_index + 2];
324 model.multdof3_S[joint_id](3,0) = 1.;
325 model.multdof3_S[joint_id](4,1) = 1.;
326 model.multdof3_S[joint_id](5,2) = 1.;
328 Scalar qdot0 = qdot[model.mJoints[joint_id].q_index];
329 Scalar qdot1 = qdot[model.mJoints[joint_id].q_index + 1];
330 Scalar qdot2 = qdot[model.mJoints[joint_id].q_index + 2];
332 model.v_J[joint_id] =
333 model.multdof3_S[joint_id] *
Vector3d (qdot0, qdot1, qdot2);
335 model.c_J[joint_id].set(0., 0., 0., 0., 0., 0.);
336 model.X_lambda[joint_id].E = model.X_T[joint_id].E;
337 model.X_lambda[joint_id].r = model.X_T[joint_id].r + model.X_T[joint_id].E.transpose() *
Vector3d (q0, q1, q2);
338 }
else if (model.mJoints[joint_id].mJointType == JointTypeCustom) {
339 const Joint &joint = model.mJoints[joint_id];
340 CustomJoint *custom_joint =
341 model.mCustomJoints[joint.custom_joint_index];
342 custom_joint->jcalc (model, joint_id, q, qdot);
344 std::ostringstream errormsg;
345 errormsg <<
"Error: invalid joint type " << model.mJoints[joint_id].mJointType <<
" at id " << joint_id << std::endl;
352 unsigned int joint_id,
355 assert (joint_id > 0);
357 if (model.mJoints[joint_id].mDoFCount == 1
358 && model.mJoints[joint_id].mJointType != JointTypeCustom) {
359 if (model.mJoints[joint_id].mJointType == JointTypeRevolute) {
360 return Xrot (q[model.mJoints[joint_id].q_index],
Vector3d (
361 model.mJoints[joint_id].mJointAxes[0][0],
362 model.mJoints[joint_id].mJointAxes[0][1],
363 model.mJoints[joint_id].mJointAxes[0][2]
365 }
else if (model.mJoints[joint_id].mJointType == JointTypePrismatic) {
367 model.mJoints[joint_id].mJointAxes[0][3]
368 * q[model.mJoints[joint_id].q_index],
369 model.mJoints[joint_id].mJointAxes[0][4]
370 * q[model.mJoints[joint_id].q_index],
371 model.mJoints[joint_id].mJointAxes[0][5]
372 * q[model.mJoints[joint_id].q_index]
375 }
else if (model.mJoints[joint_id].mJointType == JointTypeHelical) {
377 q[model.mJoints[joint_id].q_index],
Vector3d (
378 model.mJoints[joint_id].mJointAxes[0][0],
379 model.mJoints[joint_id].mJointAxes[0][1],
380 model.mJoints[joint_id].mJointAxes[0][2]
383 model.mJoints[joint_id].mJointAxes[0][3]
384 * q[model.mJoints[joint_id].q_index],
385 model.mJoints[joint_id].mJointAxes[0][4]
386 * q[model.mJoints[joint_id].q_index],
387 model.mJoints[joint_id].mJointAxes[0][5]
388 * q[model.mJoints[joint_id].q_index]
395 std::ostringstream errormsg;
396 errormsg <<
"Error: invalid joint type: " << model.mJoints[joint_id].mJointType << std::endl;
405 unsigned int joint_id,
409 assert (joint_id > 0);
411 if (model.mJoints[joint_id].mJointType == JointTypeRevoluteX) {
413 sincosp (q[model.mJoints[joint_id].q_index], &s, &c);
415 model.X_lambda[joint_id].E =
Matrix3d (
416 model.X_T[joint_id].E(0, 0),
417 model.X_T[joint_id].E(0, 1),
418 model.X_T[joint_id].E(0, 2),
420 c * model.X_T[joint_id].E(1, 0) + s * model.X_T[joint_id].E(2, 0),
421 c * model.X_T[joint_id].E(1, 1) + s * model.X_T[joint_id].E(2, 1),
422 c * model.X_T[joint_id].E(1, 2) + s * model.X_T[joint_id].E(2, 2),
424 -s * model.X_T[joint_id].E(1, 0) + c * model.X_T[joint_id].E(2, 0),
425 -s * model.X_T[joint_id].E(1, 1) + c * model.X_T[joint_id].E(2, 1),
426 -s * model.X_T[joint_id].E(1, 2) + c * model.X_T[joint_id].E(2, 2));
428 model.X_lambda[joint_id].r = model.X_T[joint_id].r;
430 model.S[joint_id][0] = 1.0;
431 }
else if (model.mJoints[joint_id].mJointType == JointTypeRevoluteY) {
433 sincosp (q[model.mJoints[joint_id].q_index], &s, &c);
435 model.X_lambda[joint_id].E =
Matrix3d (
436 c * model.X_T[joint_id].E(0, 0) + -s * model.X_T[joint_id].E(2, 0),
437 c * model.X_T[joint_id].E(0, 1) + -s * model.X_T[joint_id].E(2, 1),
438 c * model.X_T[joint_id].E(0, 2) + -s * model.X_T[joint_id].E(2, 2),
440 model.X_T[joint_id].E(1, 0),
441 model.X_T[joint_id].E(1, 1),
442 model.X_T[joint_id].E(1, 2),
444 s * model.X_T[joint_id].E(0, 0) + c * model.X_T[joint_id].E(2, 0),
445 s * model.X_T[joint_id].E(0, 1) + c * model.X_T[joint_id].E(2, 1),
446 s * model.X_T[joint_id].E(0, 2) + c * model.X_T[joint_id].E(2, 2));
448 model.X_lambda[joint_id].r = model.X_T[joint_id].r;
450 model.S[joint_id][1] = 1.;
451 }
else if (model.mJoints[joint_id].mJointType == JointTypeRevoluteZ) {
453 sincosp (q[model.mJoints[joint_id].q_index], &s, &c);
455 model.X_lambda[joint_id].E =
Matrix3d (
456 c * model.X_T[joint_id].E(0, 0) + s * model.X_T[joint_id].E(1, 0),
457 c * model.X_T[joint_id].E(0, 1) + s * model.X_T[joint_id].E(1, 1),
458 c * model.X_T[joint_id].E(0, 2) + s * model.X_T[joint_id].E(1, 2),
460 -s * model.X_T[joint_id].E(0, 0) + c * model.X_T[joint_id].E(1, 0),
461 -s * model.X_T[joint_id].E(0, 1) + c * model.X_T[joint_id].E(1, 1),
462 -s * model.X_T[joint_id].E(0, 2) + c * model.X_T[joint_id].E(1, 2),
464 model.X_T[joint_id].E(2, 0),
465 model.X_T[joint_id].E(2, 1),
466 model.X_T[joint_id].E(2, 2));
468 model.X_lambda[joint_id].r = model.X_T[joint_id].r;
470 model.S[joint_id][2] = 1.;
471 }
else if (model.mJoints[joint_id].mJointType == JointTypeHelical){
473 model.X_lambda[joint_id] = XJ * model.X_T[joint_id];
475 Vector3d trans = XJ.
E * model.mJoints[joint_id].mJointAxes[0].block(3,0,3,1);
477 model.S[joint_id] =
SpatialVector(model.mJoints[joint_id].mJointAxes[0][0],
478 model.mJoints[joint_id].mJointAxes[0][1],
479 model.mJoints[joint_id].mJointAxes[0][2],
480 trans[0], trans[1], trans[2]);
481 }
else if (model.mJoints[joint_id].mDoFCount == 1
482 && model.mJoints[joint_id].mJointType != JointTypeCustom){
483 model.X_lambda[joint_id] =
484 jcalc_XJ (model, joint_id, q) * model.X_T[joint_id];
485 model.S[joint_id] = model.mJoints[joint_id].mJointAxes[0];
486 }
else if (model.mJoints[joint_id].mJointType == JointTypeSpherical) {
488 model.GetQuaternion (joint_id, q).toMatrix(),
490 * model.X_T[joint_id];
492 model.multdof3_S[joint_id](0,0) = 1.;
493 model.multdof3_S[joint_id](1,1) = 1.;
494 model.multdof3_S[joint_id](2,2) = 1.;
495 }
else if (model.mJoints[joint_id].mJointType == JointTypeEulerZYX) {
496 Scalar q0 = q[model.mJoints[joint_id].q_index];
497 Scalar q1 = q[model.mJoints[joint_id].q_index + 1];
498 Scalar q2 = q[model.mJoints[joint_id].q_index + 2];
509 c0 * c1, s0 * c1, -s1,
510 c0 * s1 * s2 - s0 * c2, s0 * s1 * s2 + c0 * c2, c1 * s2,
511 c0 * s1 * c2 + s0 * s2, s0 * s1 * c2 - c0 * s2, c1 * c2
514 * model.X_T[joint_id];
516 model.multdof3_S[joint_id](0,0) = -s1;
517 model.multdof3_S[joint_id](0,2) = 1.;
519 model.multdof3_S[joint_id](1,0) = c1 * s2;
520 model.multdof3_S[joint_id](1,1) = c2;
522 model.multdof3_S[joint_id](2,0) = c1 * c2;
523 model.multdof3_S[joint_id](2,1) = - s2;
524 }
else if (model.mJoints[joint_id].mJointType == JointTypeEulerXYZ) {
525 Scalar q0 = q[model.mJoints[joint_id].q_index];
526 Scalar q1 = q[model.mJoints[joint_id].q_index + 1];
527 Scalar q2 = q[model.mJoints[joint_id].q_index + 2];
538 c2 * c1, s2 * c0 + c2 * s1 * s0, s2 * s0 - c2 * s1 * c0,
539 -s2 * c1, c2 * c0 - s2 * s1 * s0, c2 * s0 + s2 * s1 * c0,
540 s1, -c1 * s0, c1 * c0
543 * model.X_T[joint_id];
545 model.multdof3_S[joint_id](0,0) = c2 * c1;
546 model.multdof3_S[joint_id](0,1) = s2;
548 model.multdof3_S[joint_id](1,0) = -s2 * c1;
549 model.multdof3_S[joint_id](1,1) = c2;
551 model.multdof3_S[joint_id](2,0) = s1;
552 model.multdof3_S[joint_id](2,2) = 1.;
553 }
else if (model.mJoints[joint_id].mJointType == JointTypeEulerYXZ ) {
554 Scalar q0 = q[model.mJoints[joint_id].q_index];
555 Scalar q1 = q[model.mJoints[joint_id].q_index + 1];
556 Scalar q2 = q[model.mJoints[joint_id].q_index + 2];
567 c2 * c0 + s2 * s1 * s0, s2 * c1, -c2 * s0 + s2 * s1 * c0,
568 -s2 * c0 + c2 * s1 * s0, c2 * c1, s2 * s0 + c2 * s1 * c0,
569 c1 * s0, - s1, c1 * c0
572 * model.X_T[joint_id];
574 model.multdof3_S[joint_id](0,0) = s2 * c1;
575 model.multdof3_S[joint_id](0,1) = c2;
577 model.multdof3_S[joint_id](1,0) = c2 * c1;
578 model.multdof3_S[joint_id](1,1) = -s2;
580 model.multdof3_S[joint_id](2,0) = -s1;
581 model.multdof3_S[joint_id](2,2) = 1.;
582 }
else if (model.mJoints[joint_id].mJointType == JointTypeEulerZXY ) {
583 Scalar q0 = q[model.mJoints[joint_id].q_index];
584 Scalar q1 = q[model.mJoints[joint_id].q_index + 1];
585 Scalar q2 = q[model.mJoints[joint_id].q_index + 2];
596 -s0 * s1 * s2 + c0 * c2, s0 * c2 + s1 * s2 * c0, -s2 * c1,
597 -s0 * c1, c0 * c1, s1,
598 s0 * s1 * c2 + s2 * c0, s0 * s2 - s1 * c0 * c2, c1 * c2
601 * model.X_T[joint_id];
603 model.multdof3_S[joint_id](0,0) = -s2 * c1;
604 model.multdof3_S[joint_id](0,1) = c2;
606 model.multdof3_S[joint_id](1,0) = s1;
607 model.multdof3_S[joint_id](1,2) = 1;
609 model.multdof3_S[joint_id](2,0) = c1 * c2;
610 model.multdof3_S[joint_id](2,1) = s2;
611 }
else if (model.mJoints[joint_id].mJointType == JointTypeTranslationXYZ) {
612 Scalar q0 = q[model.mJoints[joint_id].q_index];
613 Scalar q1 = q[model.mJoints[joint_id].q_index + 1];
614 Scalar q2 = q[model.mJoints[joint_id].q_index + 2];
617 Matrix3d::Identity (),
619 * model.X_T[joint_id];
621 model.multdof3_S[joint_id](3,0) = 1.;
622 model.multdof3_S[joint_id](4,1) = 1.;
623 model.multdof3_S[joint_id](5,2) = 1.;
624 }
else if (model.mJoints[joint_id].mJointType == JointTypeCustom) {
625 const Joint &joint = model.mJoints[joint_id];
626 CustomJoint *custom_joint
627 = model.mCustomJoints[joint.custom_joint_index];
629 custom_joint->jcalc_X_lambda_S (model, joint_id, q);
void sincosp(RBDLCasadiMath::MX_Xd_scalar x, RBDLCasadiMath::MX_Xd_scalar *sinp, RBDLCasadiMath::MX_Xd_scalar *cosp)
Base class for all RBDL exceptions.
SpatialVector_t SpatialVector
SpatialTransform Xtrans(const Vector3d &r)
SpatialTransform Xrot(Scalar angle_rad, const Vector3d &axis)
RBDL_DLLAPI void jcalc(Model &model, unsigned int joint_id, const VectorNd &q, const VectorNd &qdot)
RBDL_DLLAPI Math::SpatialTransform jcalc_XJ(Model &model, unsigned int joint_id, const Math::VectorNd &q)
RBDL_DLLAPI void jcalc_X_lambda_S(Model &model, unsigned int joint_id, const VectorNd &q)
MX_Xd_scalar cos(const MX_Xd_scalar &x)
MX_Xd_scalar sin(const MX_Xd_scalar &x)
Compact representation of spatial transformations.