ROS2 and Gazebo - LCAS/RBT1001 GitHub Wiki

Setup

  1. Open a terminal and move to the RBT1001 folder; e.g.: cd ~/RBT1001
  2. git checkout tiago-gazebo
  3. Now open the folder in VSCode and launch the webcontainer as usual.

Starting the simulation

  1. Open a terminal and launch ros2 launch tiago_gazebo tiago_gazebo.launch.py
  2. Open the noVNC window with your browser.

The above command launches an simulation of the entire robot system, including its kinematics, dynamics and collisions. From the gazebo window you can see a rendering of the robot, the world and the lidar sensor. Screenshot from 2024-04-11 09-13-11

On the left bar, you can see all the elements that are simulated in the current world. Elements include the robot, but also physical characteristics of the world such as gravity, the magnetic field, wind and the sun light. Gazebo allows you to modify these elements and to add more as you wish.

You can try executing the scripts from the previous week and see that they move the robot arm as expected, for example:

python3 src/week7/scripts/joint_command.py

Implement a complete joint trajectory planner for the arm

You have to work on the week7/reach_configuration.py script and add your code where you see #TODO.

  1. assume that all the joints move with speed equal to the lowest maximum speed of all joints,
  2. find the joint with the maximum distance from the current,
  3. compute the trapezoidal trajectory as a sequence of points, so that all the joints finish execution at the same time.
  4. pay attention to whether a trapezoidal trajectory can be found for each joint and change the trajectory time and number of points accordingly for that specific joint.

After every trajectory execution, you can reset the robot arm position by moving it to a pre-defined position such as home or unfold_arm by (example to send to home configuration):

ros2 action send_goal /play_motion2 play_motion2_msgs/action/PlayMotion2 '{motion_name: home}'