Improvements related to models where joint-actuator relationship is not one-to-one:
- Add `joint-actuatorforcerange` for clamping total actuator force at joints. Add `sensor-jointactuatorfrc` for sensing total actuator forces on a single joint. See [documentation](https://mujoco.readthedocs.io/en/latest//modeling.html#actuator-force-clamping) for justification and use cases. - Add simple car model to `model/`. - Move actuation-related test models into `engine/testdata/actuation/`. PiperOrigin-RevId: 549355941 Change-Id: I27f6c1f80426d73a2811ef5ae74684a228b2fbd1
This commit is contained in:
committed by
Copybara-Service
parent
7603b07a20
commit
51aa375af0
@@ -301,6 +301,16 @@ void mj_fwdActuation(const mjModel* m, mjData* d) {
|
||||
// qfrc_actuator = moment' * force
|
||||
mju_mulMatTVec(d->qfrc_actuator, moment, force, nu, nv);
|
||||
|
||||
// clamp qfrc_actuator
|
||||
int njnt = m->njnt;
|
||||
for (int i=0; i < njnt; i++) {
|
||||
if (m->jnt_actfrclimited[i]) {
|
||||
mjtNum *forcerange = m->jnt_actfrcrange + 2*i;
|
||||
mjtNum *qfrc = d->qfrc_actuator + m->jnt_dofadr[i];
|
||||
qfrc[0] = mju_clip(qfrc[0], forcerange[0], forcerange[1]);
|
||||
}
|
||||
}
|
||||
|
||||
// act_dot for stateful actuators
|
||||
for (int i=0; i < nu; i++) {
|
||||
if (m->actuator_plugin[i] >= 0) {
|
||||
|
||||
Reference in New Issue
Block a user