generated from LCAS/ros2-teaching-ws
-
Notifications
You must be signed in to change notification settings - Fork 7
Implement Trajectories with ROS
francescodelduchetto edited this page Mar 7, 2024
·
3 revisions
Let's start from the specifics of the robots, i.e. looking at the max velocity for each joint:
Here are taken from the lecture slides:

This will generate the position and velocity trajectories to move from point A to point B, so that the position is smooth during trajectory.
- open the script
src/week5/scripts/trajectory.py
in the editor. - Implement the Trapezoidal trajectory as described in the lecture. The code takes in input the initial and final joint position
$q_0$ and$q_f$ , the total time$t_f$ , the maximum velocity$qd_max$ and the number of interpolation points we want to use. - Once you have finished, you can run the code by executing:
python3 src/week5/scripts/trajectory.py
. This will plot the joint values and velocities of your trajectory. - If you are satisfied, you can test it on the real robot by
a. resetting the
arm_7_joint
position equal to 0.0 from the robot web interface. b. running:python3 src/week5/scripts/trajectory.py exec
. - Compare the trajectory you have defined with the one that is actually executed by the controller.
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/