-
Notifications
You must be signed in to change notification settings - Fork 7
ROS2 and Gazebo
- Open a terminal and move to the RBT1001 folder; e.g.:
cd ~/RBT1001
git checkout tiago-gazebo
- Now open the folder in VSCode and launch the webcontainer as usual.
- Open a terminal and launch
ros2 launch tiago_gazebo tiago_gazebo.launch.py
- 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.
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
You have to work on the week7/reach_configuration.py
script and add your code where you see #TODO
.
- assume that all the joints move with speed equal to the lowest maximum speed of all joints,
- find the joint with the maximum distance from the current,
- compute the trapezoidal trajectory as a sequence of points, so that all the joints finish execution at the same time.
- 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}'
Parts for the workshops are extracted, edited from and/or inspired by the following sources.
- Official ROS humble tutorials: https://docs.ros.org/en/humble/Tutorials.html
- Elephant Robotics docs: https://docs.elephantrobotics.com/docs/gitbook-en/