Add a number of missing struct fields to Python bindings.

It is quite possible that there are a few other fields still missing since we currently do not yet have automated testing of struct field existence.

Fixes #747.

PiperOrigin-RevId: 517189048
Change-Id: I7c1d95e700eaea05aaa3cde1fd05e1a259553117
This commit is contained in:
Saran Tunyasuvunakool
2023-03-16 12:05:03 -07:00
committed by Copybara-Service
parent a04c4314fd
commit e20ab6c96f
3 changed files with 10 additions and 1 deletions
+7
View File
@@ -983,6 +983,7 @@ MjvPerturbWrapper::MjWrapper()
}()),
X(refpos),
X(refquat),
X(refselpos),
X(localpos) {}
#undef X
@@ -1299,8 +1300,11 @@ PYBIND11_MODULE(_structs, m) {
#define X(var) mjVisualGlobal.def_readwrite(#var, &raw::MjVisualGlobal::var)
X(fovy);
X(ipd);
X(azimuth);
X(elevation);
X(linewidth);
X(glow);
X(realtime);
X(offwidth);
X(offheight);
#undef X
@@ -1966,11 +1970,14 @@ This is useful for example when the MJB is not available as a file on disk.)"));
X(skinselect);
X(active);
X(active2);
X(localmass);
X(scale);
#undef X
#define X(var) DefinePyArray(mjvPerturb, #var, &MjvPerturbWrapper::var)
X(refpos);
X(refquat);
X(refselpos);
X(localpos);
#undef X
+1
View File
@@ -611,6 +611,7 @@ class MjWrapper<raw::MjvPerturb> : public WrapperBase<raw::MjvPerturb> {
#define X(var) py_array_or_tuple_t<mjtNum> var
X(refpos);
X(refquat);
X(refselpos);
X(localpos);
#undef X
};