This repository implements a multi purpose controller for manipulators using the ros2-control framework and Gazebo for simulation.
The controller exploits KDL and urdf parsing to resize its variables accordingly to the DOFs of the manipulator and implements the following control techniques:
- PD with gravity compensation
- Computed torque
- Backstepping
- Adaptive Backstepping
The robots_description package implements a modified franka panda URDF description where the joints have been modified to be without limits, while controller_error_msgs contains the messages used to monitor the controller error, send the desired pose and twist, and set desired gains.
For the adaptive controllers, a regressor formulation is needed, so it requires a symbolic formulation of the robot. The files panda_gen.cpp, thunder_panda.cpp and all the headers int he panda_generated folder are, as the name suggests, generated by the thunder_dinamycs library.
To launch the Gazebo simulation, after compiling and sourcing the environment, run ros2 launch robots_description panda_gazebo.launch.py. This will launch both the controller (and the robot_state_publisher) and the simulation.
The configuration of the controller can be done by modifying panda_multi_controller.yaml file inside the robots_description package. The parameters are the following:
- joints: list of all the joints offering the selected command/state interfaces
- description_topic: the name of the topic where the robot's description is being published
- base_link: name of the link acting as the base of the manipulator
- ee_link: name of the link considered the end effector; this can be any link along the cinematic chain (different from
base_link) - controller_type: selects type of control to use:
PD- PD with Gravity compensationCT- Computed TorqueB- BacksteppingA- Adaptive Backstepping
- Kp_p/Kv_p: position gains for proportional/derivative gain matrices
- Kp_o/Kv_o: orientation gains for proportional/derivative gain matrices
- Kv: only present if the derivative gain matrix is in joint space;
- r: (Adaptive only) regressor gain
