Correct DC motor derivative calculation and enforce actearly.

PiperOrigin-RevId: 898983657
Change-Id: I008529eacf3e400696d26bd3a52a4cf4c1c12225
This commit is contained in:
Yuval Tassa
2026-04-13 07:18:28 -07:00
committed by Copybara-Service
parent bc83c24a4d
commit c004d144d1
6 changed files with 181 additions and 9 deletions
+6
View File
@@ -7238,6 +7238,12 @@ void mjCActuator::Compile(void) {
actdim = (dyntype != mjDYN_NONE && dyntype != mjDYN_DCMOTOR);
}
// DC motor always uses actearly
if (dyntype == mjDYN_DCMOTOR && !actearly) {
throw mjCError(this, "actearly cannot be false for DC motor actuator '%s' (id = %d)",
name.c_str(), id);
}
// check muscle parameters
for (int i=0; i < 2; i++) {
// select gain or bias