| 42 | namespace python { |
| 43 | |
| 44 | void SdfParser(py::module& m) |
| 45 | { |
| 46 | auto sm = m.def_submodule("SdfParser"); |
| 47 | |
| 48 | ::py::enum_<utils::SdfParser::RootJointType>(sm, "RootJointType") |
| 49 | .value("FLOATING", utils::SdfParser::RootJointType::FLOATING) |
| 50 | .value("FIXED", utils::SdfParser::RootJointType::FIXED); |
| 51 | |
| 52 | ::py::class_<utils::SdfParser::Options>(sm, "Options") |
| 53 | .def( |
| 54 | ::py::init< |
| 55 | common::ResourceRetrieverPtr, |
| 56 | utils::SdfParser::RootJointType>(), |
| 57 | ::py::arg("resourceRetriever") = nullptr, |
| 58 | ::py::arg("defaultRootJointType") |
| 59 | = utils::SdfParser::RootJointType::FLOATING) |
| 60 | .def_readwrite( |
| 61 | "mResourceRetriever", &utils::SdfParser::Options::mResourceRetriever) |
| 62 | .def_readwrite( |
| 63 | "mDefaultRootJointType", |
| 64 | &utils::SdfParser::Options::mDefaultRootJointType); |
| 65 | |
| 66 | sm.def( |
| 67 | "readWorld", |
| 68 | +[](const common::Uri& uri, const common::ResourceRetrieverPtr& retriever) |
| 69 | -> simulation::WorldPtr { |
| 70 | DART_SUPPRESS_DEPRECATED_BEGIN |
| 71 | return utils::SdfParser::readWorld(uri, retriever); |
| 72 | DART_SUPPRESS_DEPRECATED_END |
| 73 | }, |
| 74 | ::py::arg("uri"), |
| 75 | ::py::arg("retriever")); |
| 76 | sm.def( |
| 77 | "readWorld", |
| 78 | ::py::overload_cast<const common::Uri&, const utils::SdfParser::Options&>( |
| 79 | &utils::SdfParser::readWorld), |
| 80 | ::py::arg("uri"), |
| 81 | ::py::arg("options") = utils::SdfParser::Options()); |
| 82 | sm.def( |
| 83 | "readSkeleton", |
| 84 | +[](const common::Uri& uri, const common::ResourceRetrieverPtr& retriever) |
| 85 | -> dynamics::SkeletonPtr { |
| 86 | DART_SUPPRESS_DEPRECATED_BEGIN |
| 87 | return utils::SdfParser::readSkeleton(uri, retriever); |
| 88 | DART_SUPPRESS_DEPRECATED_END |
| 89 | }, |
| 90 | ::py::arg("uri"), |
| 91 | ::py::arg("retriever")); |
| 92 | sm.def( |
| 93 | "readSkeleton", |
| 94 | ::py::overload_cast<const common::Uri&, const utils::SdfParser::Options&>( |
| 95 | &utils::SdfParser::readSkeleton), |
| 96 | ::py::arg("uri"), |
| 97 | ::py::arg("options") = utils::SdfParser::Options()); |
| 98 | } |
| 99 | |
| 100 | } // namespace python |
| 101 | } // namespace dart |