Skip to content

Commit

Permalink
big gello
Browse files Browse the repository at this point in the history
  • Loading branch information
yuwei-will-xia committed Dec 18, 2024
1 parent a14465a commit bb5eaaf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
18 changes: 10 additions & 8 deletions gello/agents/gello_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,19 @@ def make_robot(self,
"/dev/serial/by-id/usb-FTDI_USB__-__Serial_Converter_FT94VP8U-if00-port0":
DynamixelRobotConfig(
joint_ids=(1, 2, 3, 4, 5, 6, 7),
# 7*np.pi/4, 4*np.pi/4, 2*np.pi/4, 0*np.pi/4, 4*np.pi/4, 4*np.pi/4, 10*np.pi/4
# 3*np.pi/4, 4*np.pi/4, 6*np.pi/4, -1*np.pi/4, 4*np.pi/4, 4*np.pi/4, 2*np.pi/4
joint_offsets=(
1 * np.pi / 2,
3 * np.pi / 2,
2 * np.pi / 2,
1 * np.pi / 2,
1 * np.pi / 2,
1 * np.pi / 2,
2 * np.pi / 2,
3 * np.pi / 4,
4 * np.pi / 4,
6 * np.pi / 4,
0 * np.pi / 4,
4 * np.pi / 4,
4 * np.pi / 4,
2 * np.pi / 4,
),
joint_signs=(1, -1, 1, 1, 1, 1, 1),
gripper_config=(8, 115.024609375, 73.224609375),
gripper_config=(8, 330.79609375, 288.99609375),
),
# panda
# "/dev/cu.usbserial-FT3M9NVB": DynamixelRobotConfig(
Expand Down
4 changes: 2 additions & 2 deletions scripts/gello_get_offset.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def get_error(offset: float, index: int, joint_state: np.ndarray) -> float:
best_offset = 0
best_error = 1e6
for offset in np.linspace(
-8 * np.pi, 8 * np.pi, 8 * 4 + 1
-8 * np.pi, 8 * np.pi, 8 * 8 + 1
): # intervals of pi/2
error = get_error(offset, i, curr_joints)
if error < best_error:
Expand All @@ -76,7 +76,7 @@ def get_error(offset: float, index: int, joint_state: np.ndarray) -> float:
print("best offsets : ", [f"{x:.3f}" for x in best_offsets])
print(
"best offsets function of pi: ["
+ ", ".join([f"{int(np.round(x/(np.pi/2)))}*np.pi/2" for x in best_offsets])
+ ", ".join([f"{int(np.round(x/(np.pi/4)))}*np.pi/4" for x in best_offsets])
+ " ]",
)
if args.gripper:
Expand Down

0 comments on commit bb5eaaf

Please sign in to comment.