Implemented a forward kinematics node that
- Subscribes to the joint values topic and reads them from the gazebo simulator
- Calculate the end effector pose
- publishes the pose as a ROS topic
Implemented an inverse kinematics node (a separate node) that has a service client that takes a (desired) pose of the end effector from the user and returns joint positions as a response.
Implemented PD controller which would read the joint values, receive reference joint values through service and publish joint efforts back to the SCARA robot.For the joint efforts, Derivative gain (Kd) and Proportional gain(Kp) have been tuned to get optimal control function with fast convergence and minimal overshoot. Control input : U= -Kpe - Kde_dot where, Kp=Proportional Gain Kd= Derivative Gain e=(Xref-X) e_dot=e(current_time) - e(previous_time) / (current_time - previous_time)
- Calculating the end effector velocities and joint velocities using Jacobian matrix.
- Created two services, one requests joint velocities and converts them to end effector velocities, and the second one takes end effector velocities and converts them to joint velocities.
- In order to add a velocity controller, added a reference velocity which was compared with the desired velocity and the cumulative error was found.
- For tuning, kept increasing the value of Kp (proportional gain) while keeping one of the joints constant.
- In this video, the velocity in the x and y direction is 0, whereas in the z direction, the velocity given is 1 unit.
x0y0z1.mp4
- In this video the velocity in the x direction is 0, whereas in the y and z directions the velocity given is 1 unit.
x0y1z1.mp4
- In this video the velocity in all the directions is 1 unit.