Add mjd_quatIntegrate, expose mjd_subQuat.
PiperOrigin-RevId: 546252926 Change-Id: I7d6b2bd6536e7e8afc368f3c46037c20f6a1cb5e
This commit is contained in:
committed by
Copybara-Service
parent
7401d6786a
commit
5cfbb6ac8b
@@ -1113,6 +1113,21 @@ Euler integrator, semi-implicit in velocity.
|
||||
self.assertGreater(np.linalg.norm(ds_dv), eps)
|
||||
self.assertGreater(np.linalg.norm(ds_da), eps)
|
||||
|
||||
def test_mjd_sub_quat(self):
|
||||
quat1 = np.array((0.2, 0.3, 0.3, 0.4))
|
||||
quat2 = np.array((0.2, 0.3, 0.3, 0.4))
|
||||
d1 = np.empty(9, np.float64)
|
||||
d2 = np.empty(9, np.float64)
|
||||
mujoco.mjd_subQuat(quat1, quat2, d1, d2)
|
||||
|
||||
def test_mjd_quat_intergrate(self):
|
||||
scale = 0.1
|
||||
vel = np.array((0.2, 0.3, 0.3))
|
||||
d_quat = np.empty(9, np.float64)
|
||||
d_vel = np.empty(9, np.float64)
|
||||
d_h = np.empty(3, np.float64)
|
||||
mujoco.mjd_quatIntegrate(vel, scale, d_quat, d_vel, d_h)
|
||||
|
||||
def test_banded(self):
|
||||
n_total = 4
|
||||
n_band = 1
|
||||
|
||||
@@ -1239,6 +1239,11 @@ PYBIND11_MODULE(_functions, pymodule) {
|
||||
return InterceptMjErrors(::mju_insertionSortInt)(
|
||||
res.data(), res.size());
|
||||
});
|
||||
Def<traits::mju_Halton>(pymodule);
|
||||
// Skipped: mju_strncpy (doesn't make sense in Python)
|
||||
Def<traits::mju_sigmoid>(pymodule);
|
||||
|
||||
// Derivatives
|
||||
Def<traits::mjd_transitionFD>(
|
||||
pymodule,
|
||||
[](const raw::MjModel* m, raw::MjData* d,
|
||||
@@ -1319,9 +1324,8 @@ PYBIND11_MODULE(_functions, pymodule) {
|
||||
DsDa.has_value() ? DsDa->data() : nullptr,
|
||||
DmDq.has_value() ? DmDq->data() : nullptr);
|
||||
});
|
||||
Def<traits::mju_Halton>(pymodule);
|
||||
// Skipped: mju_strncpy (doesn't make sense in Python)
|
||||
Def<traits::mju_sigmoid>(pymodule);
|
||||
Def<traits::mjd_subQuat>(pymodule);
|
||||
Def<traits::mjd_quatIntegrate>(pymodule);
|
||||
} // PYBIND11_MODULE NOLINT(readability/fn_size)
|
||||
} // namespace
|
||||
} // namespace mujoco::python
|
||||
|
||||
Reference in New Issue
Block a user