diff --git a/bindings/pybind11/idyntree_model.cpp b/bindings/pybind11/idyntree_model.cpp index 87ee7511e1..3f4f586e45 100644 --- a/bindings/pybind11/idyntree_model.cpp +++ b/bindings/pybind11/idyntree_model.cpp @@ -121,11 +121,12 @@ void traversalClassDefinition(py::class_& traversal) { module .def("get_random_model", iDynTree::getRandomModel, - py::arg("nr_of_joints"), py::arg("nr_of_additional_frames") = 10) + py::arg("nr_of_joints"), py::arg("nr_of_additional_frames") = 10, + py::arg("only_revolute_joints") = false) .def("get_random_chain", iDynTree::getRandomChain, py::arg("nr_of_joints"), py::arg("nr_of_additional_frames") = 10, - py::arg("nr_fixed") = false); + py::arg("only_revolute_joints") = false); } } // namespace diff --git a/src/model/include/iDynTree/ModelTestUtils.h b/src/model/include/iDynTree/ModelTestUtils.h index c1e092accf..d6782672ea 100644 --- a/src/model/include/iDynTree/ModelTestUtils.h +++ b/src/model/include/iDynTree/ModelTestUtils.h @@ -120,7 +120,7 @@ inline std::string int2string(int i) return ss.str(); } -inline Model getRandomModel(unsigned int nrOfJoints, size_t nrOfAdditionalFrames = 10) +inline Model getRandomModel(unsigned int nrOfJoints, size_t nrOfAdditionalFrames = 10, bool onlyRevoluteJoints=false) { Model model; @@ -130,7 +130,7 @@ inline Model getRandomModel(unsigned int nrOfJoints, size_t nrOfAdditionalFrames { std::string parentLink = getRandomLinkOfModel(model); std::string linkName = "link" + int2string(i); - addRandomLinkToModel(model,parentLink,linkName); + addRandomLinkToModel(model,parentLink,linkName,onlyRevoluteJoints); } for(unsigned int i=0; i < nrOfAdditionalFrames; i++)