Bugfixes.

This commit is contained in:
Kevin Zakka 2024-04-04 16:27:32 -07:00
parent e6a660da6d
commit 7001842e7a
7 changed files with 18 additions and 17 deletions

View file

@ -90,7 +90,7 @@ PORT_CONFIG_MAP: Dict[str, DynamixelRobotConfig] = {
gripper_config=(7, 20, -22),
),
# Right UR
"/dev/serial/by-id/usb-FTDI_USB__-__Serial_Converter_FT7WBG6A-if00-port0": DynamixelRobotConfig(
"/dev/cu.usbserial-FT7WBG6A": DynamixelRobotConfig(
joint_ids=(1, 2, 3, 4, 5, 6),
joint_offsets=(
np.pi + 0 * np.pi,

View file

@ -225,5 +225,5 @@ class ArmObservables(composer.Observables):
self.flange_position,
# self.flange_orientation,
# self.flange_velocity,
self.flange_angular_velocity,
# self.flange_angular_velocity,
] + self._collect_from_attachments("proprioception")

View file

@ -237,8 +237,8 @@ class DynamixelDriver(DynamixelDriverProtocol):
# Return a copy of the joint_angles array to avoid race conditions
while self._joint_angles is None:
time.sleep(0.1)
with self._lock:
_j = self._joint_angles.copy()
# with self._lock:
_j = self._joint_angles.copy()
return _j / 2048.0 * np.pi
def close(self):

View file

@ -86,11 +86,11 @@ class DynamixelRobot(Robot):
if gripper_config is not None:
current_joints = current_joints[:-1]
start_joints = start_joints[:-1]
for c_joint, s_joint, joint_offset in zip(
for idx, (c_joint, s_joint, joint_offset) in enumerate(zip(
current_joints, start_joints, self._joint_offsets
):
)):
new_joint_offsets.append(
np.pi * 2 * np.round((s_joint - c_joint) / (2 * np.pi))
np.pi * 2 * np.round((-s_joint + c_joint) / (2 * np.pi)) * self._joint_signs[idx]
+ joint_offset
)
if gripper_config is not None: