Allow more than 1 activation state per actuator, but only for dyntype user.
Fixes #305. PiperOrigin-RevId: 486597273 Change-Id: I3eb806f60949e68ebe6cbe35a6e66218a167ed45
This commit is contained in:
committed by
Copybara-Service
parent
0514010928
commit
36b30e4500
@@ -3390,6 +3390,7 @@ mjCActuator::mjCActuator(mjCModel* _model, mjCDef* _def) {
|
||||
ctrllimited = 2;
|
||||
forcelimited = 2;
|
||||
actlimited = 2;
|
||||
actdim = -1;
|
||||
trntype = mjTRN_UNDEFINED;
|
||||
dyntype = mjDYN_NONE;
|
||||
gaintype = mjGAIN_FIXED;
|
||||
@@ -3474,6 +3475,23 @@ void mjCActuator::Compile(void) {
|
||||
name.c_str(), id);
|
||||
}
|
||||
|
||||
// check and set actdim
|
||||
if (actdim > 1 && dyntype != mjDYN_USER) {
|
||||
throw mjCError(this, "actdim > 1 is only allowed for dyntype 'user' in actuator '%s' (id = %d)",
|
||||
name.c_str(), id);
|
||||
}
|
||||
if (actdim == 1 && dyntype == mjDYN_NONE) {
|
||||
throw mjCError(this, "invalid actdim 1 in stateless actuator '%s' (id = %d)", name.c_str(), id);
|
||||
}
|
||||
if (actdim == 0 && dyntype != mjDYN_NONE) {
|
||||
throw mjCError(this, "invalid actdim 0 in stateful actuator '%s' (id = %d)", name.c_str(), id);
|
||||
}
|
||||
|
||||
// set actdim
|
||||
if (actdim < 0) {
|
||||
actdim = (dyntype != mjDYN_NONE);
|
||||
}
|
||||
|
||||
// check muscle parameters
|
||||
for (int i=0; i<2; i++) {
|
||||
// select gain or bias
|
||||
|
||||
Reference in New Issue
Block a user