This repository allows to control a robotic arm with 4 AX-12A servos.
If not specified otherwise:
- All angles are in radians.
- All distances are in meters.
The robot is composed of 4 frames following the Denavit-Hartenberg convention.
The frames are defined as follows:
Frame | theta | d | a | alpha |
---|---|---|---|---|
1 | theta_1 | 0.05 | 0 | pi/2 |
2 | theta_2 | 0 | 0.093 | 0 |
3 | theta_3 | 0 | 0.093 | 0 |
4 | theta_4 | 0 | 0.05 | 0 |
The end effector isn't represented in the current version.
Servo.py
: contains the classServo
which allows to control a servo motor.RobotDescription.py
: contains the classRobotDescription
which allows to describe the robot, especially the frames and the reverse kinematics.Robot.py
: contains the classRobot
which allows to control the robot. It uses the classServo
.Simulation.py
: contains the classSimulation
which allows to simulate thePacketHandler
from the dynamixel library.Visualizer.py
: contains the classVisualizer
which allows to visualize the robot in 3D.Camera.py
: contains the classCamera
which allows to calibrate and control the camera.test_reverse_kinematics.py
: contains the tests for the reverse kinematics. Use mpi to run the tests in parallel.
pip install -r requirements.txt
Note: tqdm and mpi4py are only required for the test of the reverse kinematics.
Change the value of sim
in main.py
to False
to use the real robot.
The calibration of the camera requires a chessboard image.
python main.py
Then follow the instructions in the terminal.
mpiexec -n 8 python -m mpi4py test_reverse_kinematics.py