You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/integrate_hardware.mdx
+17-16Lines changed: 17 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ If you're using Feetech or Dynamixel motors, LeRobot provides built-in bus inter
20
20
Please refer to the [`MotorsBus`](https://github.com/huggingface/lerobot/blob/main/lerobot/common/motors/motors_bus.py) abstract class to learn about its API.
21
21
For a good example of how it can be used, you can have a look at our own [SO101 follower implementation](https://github.com/huggingface/lerobot/blob/main/lerobot/common/robots/so101_follower/so101_follower.py)
22
22
23
-
Use these if compatible! Otherwise, you'll need to find or write a Python interface (not covered in this tutorial):
23
+
Use these if compatible. Otherwise, you'll need to find or write a Python interface (not covered in this tutorial):
24
24
- Find an existing SDK in Python (or use bindings to C/C++)
25
25
- Or implement a basic communication wrapper (e.g., via pyserial, socket, or CANopen)
26
26
@@ -32,7 +32,7 @@ For Feetech and Dynamixel, we currently support these servos:
If you are using Feetech or Dynamixel servos that are not in this list, you can add those in the [Feetech table](https://github.com/huggingface/lerobot/blob/main/lerobot/common/motors/feetech/tables.py) or [Dynamixel table](https://github.com/huggingface/lerobot/blob/main/lerobot/common/motors/dynamixel/tables.py). Depending on the model, this will require you to add model-specific information. In most cases though, there should be a lot of additions to do.
35
+
If you are using Feetech or Dynamixel servos that are not in this list, you can add those in the [Feetech table](https://github.com/huggingface/lerobot/blob/main/lerobot/common/motors/feetech/tables.py) or [Dynamixel table](https://github.com/huggingface/lerobot/blob/main/lerobot/common/motors/dynamixel/tables.py). Depending on the model, this will require you to add model-specific information. In most cases though, there shouldn't be a lot of additions to do.
36
36
37
37
In the next sections, we'll use a `FeetechMotorsBus` as the motors interface for the examples. Replace it and adapt to your motors if necessary.
This method should establish communication with the hardware. Moreover, if your robot needs calibration is not calibrated, it should start a calibration procedure by default. If your robot needs some specific configuration, this should also be called here.
161
+
This method should establish communication with the hardware. Moreover, if your robot needs calibration and is not calibrated, it should start a calibration procedure by default. If your robot needs some specific configuration, this should also be called here.
162
162
163
163
```python
164
164
defconnect(self, calibrate: bool=True) -> None:
@@ -272,30 +272,31 @@ Returns a dictionary of sensor values from the robot. These typically include mo
obs_dict={f"{motor}.pos": val for motor, val in obs_dict.items()}
280
280
281
-
return {
282
-
"joint_positions": joint_pos,
283
-
"gripper_open": gripper,
284
-
"camera_image": image,
285
-
}
281
+
# Capture images from cameras
282
+
for cam_key, cam inself.cameras.items():
283
+
obs_dict[cam_key] = cam.async_read()
284
+
285
+
return obs_dict
286
286
```
287
287
288
288
### `send_action()`
289
289
290
290
Takes a dictionary that matches `action_features`, and sends it to your hardware. You can add safety limits (clipping, smoothing) and return what was actually sent.
291
291
292
+
For simplicity, we won't be adding any modification of the actions in our example here.
0 commit comments