@@ -444,8 +444,7 @@ biorbd::rigidbody::GeneralizedCoordinates & {
444444 }
445445 }
446446};
447- %typemap(typecheck, precedence=2101)
448- biorbd::rigidbody::GeneralizedCoordinates * {
447+ %typemap(typecheck, precedence=2101) biorbd::rigidbody::GeneralizedCoordinates * {
449448 void *argp1 = 0;
450449#ifdef BIORBD_USE_CASADI_MATH
451450 if (SWIG_IsOK(SWIG_ConvertPtr($input, &argp1, SWIGTYPE_p_casadi__MX, 0 | 0)) && argp1) {
@@ -465,7 +464,10 @@ biorbd::rigidbody::GeneralizedCoordinates * {
465464 // test if it is a numpy array
466465 $1 = true;
467466 }
468- else {
467+ else if ($input == Py_None){
468+ $1 = true;
469+ }
470+ else{
469471 $1 = false;
470472 }
471473}
@@ -506,6 +508,9 @@ biorbd::rigidbody::GeneralizedCoordinates * {
506508 (*$1)[q] = *(double*)PyArray_GETPTR1((PyArrayObject*)data, q);
507509 }
508510 }
511+ else if ($input == Py_None) {
512+ $1 = nullptr;
513+ }
509514};
510515
511516// --- GeneralizedVelocity --- //
@@ -594,6 +599,9 @@ biorbd::rigidbody::GeneralizedVelocity * {
594599 // test if it is a numpy array
595600 $1 = true;
596601 }
602+ else if ($input == Py_None){
603+ $1 = true;
604+ }
597605 else {
598606 $1 = false;
599607 }
@@ -635,6 +643,9 @@ biorbd::rigidbody::GeneralizedVelocity * {
635643 (*$1)[qdot] = *(double*)PyArray_GETPTR1((PyArrayObject*)data, qdot);
636644 }
637645 }
646+ else if ($input == Py_None){
647+ $1 = nullptr;
648+ }
638649};
639650
640651// --- GeneralizedAcceleration --- //
@@ -723,6 +734,9 @@ biorbd::rigidbody::GeneralizedAcceleration * {
723734 // test if it is a numpy array
724735 $1 = true;
725736 }
737+ else if ($input == Py_None){
738+ $1 = true;
739+ }
726740 else {
727741 $1 = false;
728742 }
@@ -764,6 +778,9 @@ biorbd::rigidbody::GeneralizedAcceleration * {
764778 (*$1)[qddot] = *(double*)PyArray_GETPTR1((PyArrayObject*)data, qddot);
765779 }
766780 }
781+ else if ($input == Py_None){
782+ $1 = nullptr;
783+ }
767784};
768785
769786// --- GeneralizedTorque --- //
0 commit comments