Source Code¶
This library was based on the dynamixel functions and examples avaiable in the Dynamixel SDK , created with the purpose of being used with the Mixcell QT interface, returning specific errors that will be used to alert the user for some commom problems, the complete code can be find at: https://github.com/clebercoutof/mixcell/
-
class
source_code.Dynamixel[source]¶ This class is used to store the Dynamixel,
id,baudrate,protocolandmodel.
-
source_code.factory_reset(id, baudrate)[source]¶ Resets a servo to factory config.
Parameters: - id (int) – Servo
ìd - baudrate – Baudrate of the servo to be configured
Returns: –
PORT_ERRORcase it fails to open the port.–
BAUDRATE_ERRORcase it fails to change baudrate.–
COMM_ERRORcase there is a communication error.–
HARDWARE_COMM_ERRORcase there is a hardware communication error.–
NONEcase the operation succeeds.- id (int) – Servo
-
source_code.reverse_slave(id, reverse_mode_enable, slave_mode_enable, baudrate)[source]¶ Sets the drive mode.
Parameters: Returns: –
PORT_ERRORcase it fails to open the port.–
BAUDRATE_ERRORcase it fails to change baudrate.–
COMM_ERRORcase there is a communication error.–
HARDWARE_COMM_ERRORcase there is a hardware communication error.–
NONEcase the operation succeeds.
-
source_code.search(id_search_min, id_search_max, baudrates_search_list)[source]¶ Search for servos in range of
id_search_minandid_search_maxfor all baudrates inbaudrates_search_list.Parameters: Returns: found_servoslist containing the servos found.Return type: List containing the
Dynamixelobject servos
-
source_code.set_angle_limit(id, cw_angle_limit, ccw_angle_limit, baudrate)[source]¶ Configure the angle limits of a servo.
Parameters: Returns: –
PORT_ERRORcase it fails to open the port.–
BAUDRATE_ERRORcase it fails to change baudrate.–
COMM_ERRORcase there is a communication error.–
HARDWARE_COMM_ERRORcase there is a hardware communication error.–
NONEcase the operation succeeds.
-
source_code.set_baudrate(id, new_baudrate, baudrate)[source]¶ Sets a servo baudrate.
Parameters: Returns: –
PORT_ERRORcase it fails to open the port.–
BAUDRATE_ERRORcase it fails to change baudrate.–
COMM_ERRORcase there is a communication error.–
HARDWARE_COMM_ERRORcase there is a hardware communication error.–
NONEcase the operation succeeds.
-
source_code.set_id(id, new_id, baudrate)[source]¶ Sets a servo ID.
Parameters: Returns: –
PORT_ERRORcase it fails to open the port.–
BAUDRATE_ERRORcase it fails to change baudrate.–
COMM_ERRORcase there is a communication error.–
HARDWARE_COMM_ERRORcase there is a hardware communication error.–
NONEcase the operation succeeds.
-
source_code.set_pid_gain(id, d_gain, i_gain, p_gain, baudrate)[source]¶ Sets the PID Gains.
Parameters: Returns: –
PORT_ERRORcase it fails to open the port.–
BAUDRATE_ERRORcase it fails to change baudrate.–
COMM_ERRORcase there is a communication error.–
HARDWARE_COMM_ERRORcase there is a hardware communication error.–
NONEcase the operation succeeds.
-
source_code.set_torque_max(id, percentage, baudrate)[source]¶ Sets a servo max torque.
Parameters: Returns: –
PORT_ERRORcase it fails to open the port.–
BAUDRATE_ERRORcase it fails to change baudrate.–
COMM_ERRORcase there is a communication error.–
HARDWARE_COMM_ERRORcase there is a hardware communication error.–
NONEcase the operation succeeds.