Changes to dcmotor:

- Remove `lugre:viscous`, should now be added directly to actuator `damping`. Trying to do this for the user was incompatible with default inheritance (compounding instead of overriding).
- Move voltage limiting from the `saturation` to the `controller` attribute.
- Fix indexing issues in default inheritance.

PiperOrigin-RevId: 897087642
Change-Id: I5388c2633e15c7e223992e7eb5d6a28db75a6438
This commit is contained in:
Yuval Tassa
2026-04-09 06:51:57 -07:00
committed by Copybara-Service
parent 26fb65c7a7
commit 81720071b8
14 changed files with 335 additions and 85 deletions
+3 -3
View File
@@ -10823,7 +10823,7 @@ FUNCTIONS: Mapping[str, FunctionDecl] = dict([
name='saturation',
type=ArrayType(
inner_type=ValueType(name='double'),
extents=(4,),
extents=(3,),
),
nullable=True,
),
@@ -10847,7 +10847,7 @@ FUNCTIONS: Mapping[str, FunctionDecl] = dict([
name='controller',
type=ArrayType(
inner_type=ValueType(name='double'),
extents=(5,),
extents=(6,),
),
nullable=True,
),
@@ -10863,7 +10863,7 @@ FUNCTIONS: Mapping[str, FunctionDecl] = dict([
name='lugre',
type=ArrayType(
inner_type=ValueType(name='double'),
extents=(6,),
extents=(5,),
),
nullable=True,
),
+6 -6
View File
@@ -1307,10 +1307,10 @@ PYBIND11_MODULE(_specs, m) {
"set_to_dcmotor",
[](raw::MjsActuator* self, std::array<double, 2> motorconst,
double resistance,
std::array<double, 3> nominal, std::array<double, 4> saturation,
std::array<double, 3> nominal, std::array<double, 3> saturation,
std::array<double, 2> inductance, std::array<double, 3> cogging,
std::array<double, 5> controller, std::array<double, 6> thermal,
std::array<double, 6> lugre, int input_mode) {
std::array<double, 6> controller, std::array<double, 6> thermal,
std::array<double, 5> lugre, int input_mode) {
std::string err = mjs_setToDCMotor(
self, motorconst.data(), resistance, nominal.data(),
saturation.data(), inductance.data(), cogging.data(),
@@ -1321,12 +1321,12 @@ PYBIND11_MODULE(_specs, m) {
},
py::arg("motorconst"), py::arg("resistance"),
py::arg("nominal") = std::array<double, 3>{0, 0, 0},
py::arg("saturation") = std::array<double, 4>{0, 0, 0, 0},
py::arg("saturation") = std::array<double, 3>{0, 0, 0},
py::arg("inductance") = std::array<double, 2>{0, 0},
py::arg("cogging") = std::array<double, 3>{0, 0, 0},
py::arg("controller") = std::array<double, 5>{0, 0, 0, 0, 0},
py::arg("controller") = std::array<double, 6>{0, 0, 0, 0, 0, 0},
py::arg("thermal") = std::array<double, 6>{0, 0, 0, 0, 0, 0},
py::arg("lugre") = std::array<double, 6>{0, 0, 0, 0, 0, 0},
py::arg("lugre") = std::array<double, 5>{0, 0, 0, 0, 0},
py::arg("input_mode") = 0);
// ============================= MJSTENDONPATH ===============================