Skip to content

Commit 5e40918

Browse files
committed
fix(sim): confusion of joint and actuator values
1 parent 4c2d693 commit 5e40918

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/sim/SimGripper.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ double SimGripper::get_normalized_width() {
9494
// TODO: maybe we should use the mujoco sensors? Not sure what the difference
9595
// is between reading out from qpos and reading from the sensors.
9696
double width =
97-
(this->sim->d->qpos[this->joint_id] - this->cfg.min_actuator_width) /
98-
(this->cfg.max_joint_width - this->cfg.min_actuator_width);
97+
(this->sim->d->qpos[this->joint_id] - this->cfg.min_joint_width) /
98+
(this->cfg.max_joint_width - this->cfg.min_joint_width);
9999
// sometimes the joint is slightly outside of the bounds
100100
if (width < 0) {
101101
width = 0;
@@ -159,7 +159,7 @@ void SimGripper::m_reset() {
159159
this->state = SimGripperState();
160160
// reset state hard
161161
this->sim->d->qpos[this->joint_id] = this->cfg.max_joint_width;
162-
this->sim->d->ctrl[this->actuator_id] = this->cfg.max_joint_width;
162+
this->sim->d->ctrl[this->actuator_id] = this->cfg.max_actuator_width;
163163
}
164164

165165
void SimGripper::reset() { this->m_reset(); }

0 commit comments

Comments
 (0)