What does "include" do? #2844
Unanswered
LH-and-FPGA
asked this question in
Asking for Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Intro
Hi!
I am an undergrad student at Imperial College London, I use MuJoCo for my research on robot arm. While going through the Python API, I found that in specs.cc, the member function
from_fileofMjSpechas anincludeparameter, but I’m not sure how to use it. Thanks.mjSpec.def_static( "from_file", [](std::string& filename, std::optional<std::unordered_map<std::string, py::bytes>>& include, std::optional<py::dict>& assets) -> MjSpec { const auto files = _impl::ConvertAssetsDict(include); raw::MjSpec* spec; { py::gil_scoped_release no_gil; char error[1024]; spec = LoadSpecFileImpl( filename, files, [&error](const char* filename, const mjVFS* vfs) { return InterceptMjErrors(mj_parseXML)( filename, vfs, error, sizeof(error)); }); if (!spec) { throw py::value_error(error); } } if (assets.has_value()) { return MjSpec(spec, assets.value()); } return MjSpec(spec); }, py::arg("filename"), py::arg("include") = py::none(), py::arg("assets") = py::none(), R"mydelimiter( Creates a spec from an XML file. Parameters ---------- filename : str Path to the XML file. include : dict, optional A dictionary of xml files included by the model. The keys are file names and the values are file contents. assets : dict, optional A dictionary of assets to be used by the spec. The keys are asset names and the values are asset contents. )mydelimiter", py::return_value_policy::move);My setup
MuJoCo Python
My question
No response
Minimal model and/or code that explain my question
No response
Confirmations
Beta Was this translation helpful? Give feedback.
All reactions