Update teleop_step for conditional joint state recording
This commit is contained in:
parent
5db796f3ff
commit
ab53095728
|
@ -462,7 +462,7 @@ class ManipulatorRobot:
|
|||
self.follower_arms[name].write("Acceleration", 254)
|
||||
|
||||
def teleop_step(
|
||||
self, record_data=False
|
||||
self, record_data=False, record_joint_angles=True,
|
||||
) -> None | tuple[dict[str, torch.Tensor], dict[str, torch.Tensor]]:
|
||||
if not self.is_connected:
|
||||
raise RobotDeviceNotConnectedError(
|
||||
|
@ -537,6 +537,7 @@ class ManipulatorRobot:
|
|||
|
||||
# Populate output dictionaries
|
||||
obs_dict, action_dict = {}, {}
|
||||
if record_joint_angles:
|
||||
obs_dict["observation.state"] = state
|
||||
action_dict["action"] = action
|
||||
for name in self.cameras:
|
||||
|
|
|
@ -201,7 +201,7 @@ class TrossenAIMobile():
|
|||
}
|
||||
|
||||
def teleop_step(
|
||||
self, record_data=False
|
||||
self, record_data=False, record_joint_angles=True,
|
||||
) -> None | tuple[dict[str, torch.Tensor], dict[str, torch.Tensor]]:
|
||||
|
||||
if not self.is_connected:
|
||||
|
@ -280,6 +280,7 @@ class TrossenAIMobile():
|
|||
|
||||
# Populate output dictionaries
|
||||
obs_dict, action_dict = {}, {}
|
||||
if record_joint_angles:
|
||||
obs_dict["observation.state"] = state
|
||||
action_dict["action"] = action
|
||||
for name in self.cameras:
|
||||
|
|
Loading…
Reference in New Issue