Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

maximum range of [-10, 110] % to account for some imprecision during calibration, but present value is inf % #607

Open
2 tasks
mbauer599 opened this issue Dec 31, 2024 · 0 comments

Comments

@mbauer599
Copy link

System Info

- `lerobot` version: 0.1.0
- Platform: Linux-5.15.0-122-generic-x86_64-with-glibc2.35
- Python version: 3.10.12
- Huggingface_hub version: 0.27.0
- Dataset version: 3.2.0
- Numpy version: 2.0.2
- PyTorch version (GPU?): 2.5.1+cu124 (False)
- Cuda version: 12040

I'm using a SO-100 arm that is almost 100% stock, with the exception that they sent me 12v motors which works just fine for me (or should).

Information

  • One of the scripts in the examples/ folder of LeRobot
  • My own task or dataset (give details below)

Reproduction

~/lerobot$ python3.10 lerobot/scripts/control_robot.py teleoperate --robot-path lerobot/configs/robot/so100.yaml
Connecting main follower arm.
Connecting main leader arm.
Activating torque on main follower arm.
/home/mbauer/lerobot/lerobot/common/robot_devices/motors/feetech.py:471: RuntimeWarning: divide by zero encountered in scalar divide
  values[i] = (values[i] - start_pos) / (end_pos - start_pos) * 100
Wrong motor position range detected for gripper. Expected to be in nominal range of [0, 100] % (a full linear translation), with a maximum range of [-10, 110] % to account for some imprecision during calibration, but present value is inf %. This might be due to a cable connection issue creating an artificial jump in motor values. You need to recalibrate by running: `python lerobot/scripts/control_robot.py calibrate`
/home/mbauer/lerobot/lerobot/common/robot_devices/motors/feetech.py:543: RuntimeWarning: divide by zero encountered in scalar divide
  calib_val = (values[i] - start_pos) / (end_pos - start_pos) * 100
Traceback (most recent call last):
  File "/home/mbauer/lerobot/lerobot/common/robot_devices/motors/feetech.py", line 404, in apply_calibration_autocorrect
    values = self.apply_calibration(values, motor_names)
  File "/home/mbauer/lerobot/lerobot/common/robot_devices/motors/feetech.py", line 474, in apply_calibration
    raise JointOutOfRangeError(
lerobot.common.robot_devices.motors.feetech.JointOutOfRangeError: Wrong motor position range detected for gripper. Expected to be in nominal range of [0, 100] % (a full linear translation), with a maximum range of [-10, 110] % to account for some imprecision during calibration, but present value is inf %. This might be due to a cable connection issue creating an artificial jump in motor values. You need to recalibrate by running: `python lerobot/scripts/control_robot.py calibrate`

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/mbauer/lerobot/lerobot/scripts/control_robot.py", line 564, in <module>
    teleoperate(robot, **kwargs)
  File "/home/mbauer/lerobot/lerobot/common/robot_devices/utils.py", line 28, in wrapper
    raise e
  File "/home/mbauer/lerobot/lerobot/common/robot_devices/utils.py", line 24, in wrapper
    return func(robot, *args, **kwargs)
  File "/home/mbauer/lerobot/lerobot/scripts/control_robot.py", line 177, in teleoperate
    control_loop(
  File "/home/mbauer/lerobot/lerobot/common/datasets/image_writer.py", line 36, in wrapper
    raise e
  File "/home/mbauer/lerobot/lerobot/common/datasets/image_writer.py", line 29, in wrapper
    return func(*args, **kwargs)
  File "/home/mbauer/lerobot/lerobot/common/robot_devices/control_utils.py", line 242, in control_loop
    robot.connect()
  File "/home/mbauer/lerobot/lerobot/common/robot_devices/robots/manipulator.py", line 343, in connect
    self.follower_arms[name].read("Present_Position")
  File "/home/mbauer/lerobot/lerobot/common/robot_devices/motors/feetech.py", line 760, in read
    values = self.apply_calibration_autocorrect(values, motor_names)
  File "/home/mbauer/lerobot/lerobot/common/robot_devices/motors/feetech.py", line 407, in apply_calibration_autocorrect
    self.autocorrect_calibration(values, motor_names)
  File "/home/mbauer/lerobot/lerobot/common/robot_devices/motors/feetech.py", line 565, in autocorrect_calibration
    raise ValueError(f"No integer found between bounds [{low_factor=}, {upp_factor=}]")
ValueError: No integer found between bounds [low_factor=np.float32(-0.0007324219), upp_factor=np.float32(-0.0007324219)]

It looks like all the calibration data is generated without issue.

~/lerobot$ cat .cache/calibration/so100/main_follower.json 
{"homing_offset": [4658, -2773, 645, -2757, -2358, -3022], "drive_mode": [1, 0, 0, 0, 0, 0], "start_pos": [3635, 3797, 379, 3781, 3382, 4046], "end_pos": [-3634, 3797, 379, 3781, 3382, 4046], "calib_mode": ["DEGREE", "DEGREE", "DEGREE", "DEGREE", "DEGREE", "LINEAR"], "motor_names": ["shoulder_pan", "shoulder_lift", "elbow_flex", "wrist_flex", "wrist_roll", "gripper"]}
~/lerobot$ cat .cache/calibration/so100/main_leader.json 
{"homing_offset": [-2555, 628, 205, 655, -878, 977], "drive_mode": [0, 0, 0, 0, 0, 0], "start_pos": [3579, 396, 819, 369, 1902, 46], "end_pos": [3579, 396, 819, 369, 1902, 47], "calib_mode": ["DEGREE", "DEGREE", "DEGREE", "DEGREE", "DEGREE", "LINEAR"], "motor_names": ["shoulder_pan", "shoulder_lift", "elbow_flex", "wrist_flex", "wrist_roll", "gripper"]}

This also occurs when attempting to execute teleoperate or any other control mode.

Expected behavior

Execution without error.

If this is a 'me' issue, then apologies in advanced for not just throwing this on discord, but any help or guidance is appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant