The trajectory_server module is an optimization-based trajectory planner able to process an unlimited number of waypoints, each of which specified as:
- wi the plane position of the waypoint,
- Ci a vector of constraints.
The implemented optimization procedure allows to generate optimal polynomial trajectories by weighting the overall travel time and the trajectory smoothness. The flexibility of our implementation allows to specify a variable number of derivative constraints for each waypoints letting the remaining quantities, needed to completely define the polynomial curve, to be free. These degrees of freedom are used by the trajectory optimization procedure to minimize a fixed trajectory cost.
- Lorenzo Gentilini - PhD Student
- Email: [email protected]
- Simone Rossi - PhD Student
- Email: [email protected]
- Dario Mengoli - PhD Student
- Email: [email protected]
- Andrea Eusebi - Research Fellow
- Email: [email protected]
- Lorenzo Marconi - Full Professor
- Email: [email protected]
If you make use of this code, please cite:
- L. Gentilini, S. Rossi, D. Mengoli, A. Eusebi, L. Marconi. Trajectory Planning ROS Service for an Autonomous Agricultural Robot. IEEE MetroAgriFor 2021.
In order to run this example, please runs the following commands:
- Set-up your ROS environment
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
catkin_init_workspace
- Clone the trajectory_server repository and build the project
git clone [email protected]:swgmone/trajectory_server.git
cd ~/catkin_ws
catkin_make
- Launch the trajectory_server module
roslaunch trajectory_server trajectory_server_node
- Run the client
rosrun trajectory_server trajectory_test_node
The provided example generate an optimal polynomial trajectory passing through nine waypoints:
x1 = -11.0, y1 = 10.0
x2 = -4.0, y2 = 10.0
x3 = -4.0, y3 = -10.0
x4 = 3.0, y4 = -10.0
x5 = 3.0, y5 = 10.0
x6 = 10.0, y6 = 10.0
x7 = 10.0, y7 = -10.0
x8 = 17.0, y8 = -10.0
x9 = 17.0, y9 = 10.0
The trajectory_test_node.cpp file provides an example of the full interface to our planner. If you would like to change these waypoints, please check the trajectory_test_node.cpp file.
The provided example generate an optimal polynomial trajectory on the basis of the following parameters:
- Polynomial order = 7,
- Derivative to optimize = 3,
- Maximum velocity = 0.6,
- Maximum acceleration = 0.8,
- Time cost gain = 0.01,
- Effort cost gain = 1.0,
- Soft Constraint Gain = 0.1,
- Soft Constraint Epsilon = 1.0.
If you would like to test the trajectory optimization procedure with different parameters please check the trajectory_server.launch file.