Unverified Commit b6e3eb30 authored by Mayank Mittal's avatar Mayank Mittal Committed by GitHub

Fixes bug in RobotBase and GripperActuatorGroup (#52)

* fixes the feet air time in `LeggedRobot` class
* fixes set joint efforts on reset in `RobotBase` class
* fix gripper mimic duplication in `GripperActuatorGroup` class
* updates version and changelog
parent 8d5d0218
[package]
# Note: Semantic Versioning is used: https://semver.org/
version = "0.2.6"
version = "0.2.7"
# Description
title = "ORBIT framework for Robot Learning"
......
Changelog
---------
0.2.7 (2023-04-07)
Fixed
^^^^^
* Fixed repetition in applying mimic multiplier for "p_abs" in the :class:`GripperActuatorGroup` class.
* Fixed bugs in :meth:`reset_buffers` in the :class:`RobotBase` and :class:`LeggedRobot` classes.
0.2.6 (2023-03-16)
~~~~~~~~~~~~~~~~~~
......
......@@ -144,7 +144,6 @@ class GripperActuatorGroup(ActuatorGroup):
else:
# compute new command
dof_pos_targets = torch.where(command >= 0, self._open_dof_pos, self._close_dof_pos)
dof_pos_targets = dof_pos_targets * self._mimic_multiplier
# store new command
self._previous_dof_targets[:] = dof_pos_targets
# return command
......
......@@ -100,9 +100,12 @@ class LeggedRobot(RobotBase):
def reset_buffers(self, env_ids: Optional[Sequence[int]] = None):
# reset parent buffers
super().reset_buffers(env_ids)
# use ellipses object to skip initial indices.
if env_ids is None:
env_ids = ...
# reset timers
self._ongoing_feet_air_time[:] = 0.0
self._data.feet_air_time[:] = 0.0
self._ongoing_feet_air_time[env_ids] = 0.0
self._data.feet_air_time[env_ids] = 0.0
def update_buffers(self, dt: float):
# update parent buffers
......
......@@ -192,7 +192,7 @@ class RobotBase:
# reset history
self._previous_dof_vel[env_ids] = 0
# TODO: Reset other cached variables.
self.articulations.set_joint_efforts(self._ZERO_JOINT_EFFORT, indices=self._ALL_INDICES)
self.articulations.set_joint_efforts(self._ZERO_JOINT_EFFORT[env_ids], indices=env_ids)
# reset actuators
for group in self.actuator_groups.values():
group.reset(env_ids)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment