This script is used to control a Dynamixel motor using the Dynamixel SDK library. It allows the user to set the motor's goal position and read the current position.
- Python 3.12
- Dynamixel SDK library
To install the required libraries, follow these steps:
- Clone the repository: git clone https://github.com/BrudneDupsko/PythonDynamixelReadWrite
- Navigate to the project directory: cd project_name
- Install the Dynamixel SDK library: pip install dynamixel-sdk
To run the script, follow these steps:
- Ensure that the Dynamixel motor is connected to the computer on port COM3 (or modify the DEVICENAME variable in the code if you are using a different port).
- Run the script: python script_name.py
- Follow the instructions displayed in the terminal to enter the motor's goal position.
The script performs the following operations:
- Opens the communication port.
- Sets the communication speed (baud rate).
- Enables the motor's torque.
- Allows the user to enter the motor's goal position.
- Sends the goal position to the motor.
- Reads and displays the current motor position.
- Disables the motor's torque after operation.
- Closes the communication port.
Tymon Stankiewicz
Academic Free License