top of page

Project:

Position and Velocity Controller on  RRP Robot

​

Skills Involved:

ROS2

C++

​

Code

Description

Part1:

Objective: To evaluate the forward and inverse kinematics of an RRP robot in gazebo

​

Steps Involved:

  1. Subscriber joint_state_sub subscribes to the "/joint_states" topic and gets the joint parameters/values.

  2. Transformation Matrix is then calculated based on these joint values.

  3. The final pose of the end effector is extracted from the transformation matrix and published on the topic "/forward_kinematics".

​

How to run the code:

  • Launch the RRP bot in gazebo using the command : 

  • to launch the forward kinematics node, run: ros2 run kinematics kinematics

  • To get the pose of the end effector, run : ros2 topic echo /forward_kinematics.

​

​

​

​

​

​

​

​

​

​

​

​

 

 

 

Forward Kinematics: SCARA Robot with position reference q1 = 1, q2 = 0.8, d = 0.6

​

​

​

Part2:

Objective: To make the robot move to the position provided by the user as input.

​

Steps Involved:

  1. Actual Joint position values are read from the Gazebo Simulator using the joint_states
    topic.

  2. Desired Joint position values are received through the service /input_angles using the
    custom srv file created.

  3. Position and Velocity values for the three joints are received from the position controller.

  4. The publisher node publishes the effort using the /forward_effort_controller/command topic.

  5. Controllers are designed for each of the three joints using, u = Kpe + (-Kd) eË™ tuning thgains such that the error between the actual and desired position is minimum.

  6. A csv file is generated to record the reference and actual joint positions for a period of time and is plotted using Matplotlib.

​

How to run the code:

  • ros2 launch rrbot_gazebo rrbot_world.launch.py

  • ros2 run rrbot_gazebo switch

  • ros2 service call /input_angles force_srv_file/srv/AddForceVectors ”v1:[desired joint positions]”

  • ros2 run robot_controller robot_controller

  • python3 f_plot.py.

​

​

​

​

​

​

​

​

​

​

​

​

​

​

​

 

 

 

Joint position from the Gazebo for the revolute joint1 position reference, 4.8

​

​

Part 3: To make the end-effector move with a constant velocity provided by the user.

​

Steps Involved:

  1. Calculating the Jacobian and its inverse.

  2. Creating the node.

  3. Tuning and controller.

  4. Plotting

  5. Considering Singularities:

​

How to run the code:

  • To spawn the robot 

ros2 launch rrbot_gazebo rrbot_world.launch.py

  • To remove the robot from singularity

 ros2 run rrbot_gazebo publisher
 

  • To activate the effort controller

 ros2 run rrbot_gazebo switch
 

  •  To start the node

 ros2 run velocity_kinematics controller_main
 

  •  To input the desired end effector velocities

 ros2 service call /input_velocities force_srv_file/srv/AddForceVectors "{v1:[0.0, 0.1, 0.0]}"
 

  •  To get the current end-effector velocities

 ros2 service call /joint_vel srv_file/srv/FoundationsThree "{i1:[0.0, 0.0, 0.0]}"

​

​

​

​

​

​

​

​

​

X, Y and Z velocities of the end effector with respect to time

Screenshot (314).png
Screenshot (316).png
Screenshot (317).png
bottom of page