Welcome to DOFBOT Pro repository
2. Calibrate the Robotic Arm
Calibrate the Robotic Arm
I. API Introduction
- Turn on or off the bus servo torque.
Arm_serial_set_torque(enable)
Parameter explanation:
- enable: enable=0 to turn off torque, the robotic arm can be manually moved to adjust the servo angle, and will not receive level signals; enable=1 to turn on torque, the servo receives level signals to maintain the current angle, and commands must be sent to change the angle.
- Return value: None.
- Confirm the calibration offset of the robotic arm servo.
xxxxxxxxxxArm_serial_servo_write_offset_switch(id)
Parameter explanation:
- id: When id=0, clear all servo calibration values and restore defaults; id=1~6 corresponds to the six servo ID numbers. After receiving this command, the underlying microcontroller will read the angle data of the corresponding ID servo. If it's within a reasonable range, it will be saved; if it exceeds the range or the servo ID cannot be found, it will not be saved.
- Return value: None.
- Read the calibration status of the servo offset.
xxxxxxxxxxArm_serial_servo_write_offset_state()
Parameter explanation:
- Return value: Returns the state of setting the neutral position deviation, state=0 means the servo was not detected; state=1 means the neutral position was set successfully; state=2 means the neutral position value exceeds the allowed range.
II. Code Content
Note: This program should only be used when servo calibration is required. Do not use it arbitrarily, as it may cause inaccurate servo control and affect grasping performance.
Code path:
xxxxxxxxxx/home/jetson/dofbot_pro/dofbot_ctrl/scripts/Dofbot_Calibration.ipynb
This code must be executed step by step. Ensure that after starting calibration, you correctly adjust the angles of each servo before confirming the calibration.
The adjustment result should keep the robotic arm in an upright position and tighten the gripper.
