#include <simple_trajectory_generator.h>
Public Member Functions | |
bool | generateTrajectory (Eigen::Vector3f pos, Eigen::Vector3f vel, Eigen::Vector3f sample_target_vel, base_local_planner::Trajectory &traj) |
bool | hasMoreTrajectories () |
void | initialise (const Eigen::Vector3f &pos, const Eigen::Vector3f &vel, const Eigen::Vector3f &goal, base_local_planner::LocalPlannerLimits *limits, const Eigen::Vector3f &vsamples, std::vector< Eigen::Vector3f > additional_samples, bool discretize_by_time=false) |
void | initialise (const Eigen::Vector3f &pos, const Eigen::Vector3f &vel, const Eigen::Vector3f &goal, base_local_planner::LocalPlannerLimits *limits, const Eigen::Vector3f &vsamples, bool discretize_by_time=false) |
bool | nextTrajectory (Trajectory &traj) |
void | setParameters (double sim_time, double sim_granularity, double angular_sim_granularity, bool use_dwa=false, double sim_period=0.0) |
SimpleTrajectoryGenerator () | |
~SimpleTrajectoryGenerator () | |
Static Public Member Functions | |
static Eigen::Vector3f | computeNewPositions (const Eigen::Vector3f &pos, const Eigen::Vector3f &vel, double dt) |
static Eigen::Vector3f | computeNewVelocities (const Eigen::Vector3f &sample_target_vel, const Eigen::Vector3f &vel, Eigen::Vector3f acclimits, double dt) |
Protected Attributes | |
double | angular_sim_granularity_ |
bool | continued_acceleration_ |
bool | discretize_by_time_ |
base_local_planner::LocalPlannerLimits * | limits_ |
unsigned int | next_sample_index_ |
Eigen::Vector3f | pos_ |
std::vector< Eigen::Vector3f > | sample_params_ |
double | sim_granularity_ |
double | sim_period_ |
double | sim_time_ |
bool | use_dwa_ |
Eigen::Vector3f | vel_ |
generates trajectories based on equi-distant discretisation of the degrees of freedom. This is supposed to be a simple and robust implementation of the TrajectorySampleGenerator interface, more efficient implementations are thinkable.
This can be used for both dwa and trajectory rollout approaches. As an example, assuming these values: sim_time = 1s, sim_period=200ms, dt = 200ms, vsamples_x=5, acc_limit_x = 1m/s^2, vel_x=0 (robot at rest, values just for easy calculations) dwa_planner will sample max-x-velocities from 0m/s to 0.2m/s. trajectory rollout approach will sample max-x-velocities 0m/s up to 1m/s trajectory rollout approach does so respecting the acceleration limit, so it gradually increases velocity
Definition at line 61 of file simple_trajectory_generator.h.
Definition at line 64 of file simple_trajectory_generator.h.
Definition at line 68 of file simple_trajectory_generator.h.
Eigen::Vector3f base_local_planner::SimpleTrajectoryGenerator::computeNewPositions | ( | const Eigen::Vector3f & | pos, |
const Eigen::Vector3f & | vel, | ||
double | dt | ||
) | [static] |
Definition at line 257 of file simple_trajectory_generator.cpp.
Eigen::Vector3f base_local_planner::SimpleTrajectoryGenerator::computeNewVelocities | ( | const Eigen::Vector3f & | sample_target_vel, |
const Eigen::Vector3f & | vel, | ||
Eigen::Vector3f | acclimits, | ||
double | dt | ||
) | [static] |
cheange vel using acceleration limits to converge towards sample_target-vel
Definition at line 269 of file simple_trajectory_generator.cpp.
bool base_local_planner::SimpleTrajectoryGenerator::generateTrajectory | ( | Eigen::Vector3f | pos, |
Eigen::Vector3f | vel, | ||
Eigen::Vector3f | sample_target_vel, | ||
base_local_planner::Trajectory & | traj | ||
) |
pos | current position of robot |
vel | desired velocity for sampling |
Definition at line 184 of file simple_trajectory_generator.cpp.
bool base_local_planner::SimpleTrajectoryGenerator::hasMoreTrajectories | ( | ) | [virtual] |
Whether this generator can create more trajectories
Implements base_local_planner::TrajectorySampleGenerator.
Definition at line 158 of file simple_trajectory_generator.cpp.
void base_local_planner::SimpleTrajectoryGenerator::initialise | ( | const Eigen::Vector3f & | pos, |
const Eigen::Vector3f & | vel, | ||
const Eigen::Vector3f & | goal, | ||
base_local_planner::LocalPlannerLimits * | limits, | ||
const Eigen::Vector3f & | vsamples, | ||
std::vector< Eigen::Vector3f > | additional_samples, | ||
bool | discretize_by_time = false |
||
) |
pos | current robot position |
vel | current robot velocity |
limits | Current velocity limits |
sim_period | distance between points in one trajectory |
vsamples,: | in how many samples to divide the given dimension |
use_acceleration_limits,: | if true use physical model, else idealized robot model |
additional_samples | (deprecated): Additional velocity samples to generate individual trajectories from. |
discretize_by_time | if true, the trajectory is split according in chunks of the same duration, else of same length |
Definition at line 47 of file simple_trajectory_generator.cpp.
void base_local_planner::SimpleTrajectoryGenerator::initialise | ( | const Eigen::Vector3f & | pos, |
const Eigen::Vector3f & | vel, | ||
const Eigen::Vector3f & | goal, | ||
base_local_planner::LocalPlannerLimits * | limits, | ||
const Eigen::Vector3f & | vsamples, | ||
bool | discretize_by_time = false |
||
) |
pos | current robot position |
vel | current robot velocity |
limits | Current velocity limits |
sim_period | distance between points in one trajectory |
vsamples,: | in how many samples to divide the given dimension |
use_acceleration_limits,: | if true use physical model, else idealized robot model |
discretize_by_time | if true, the trajectory is split according in chunks of the same duration, else of same length |
Definition at line 61 of file simple_trajectory_generator.cpp.
bool base_local_planner::SimpleTrajectoryGenerator::nextTrajectory | ( | Trajectory & | comp_traj | ) | [virtual] |
Whether this generator can create more trajectories
Create and return the next sample trajectory
Implements base_local_planner::TrajectorySampleGenerator.
Definition at line 165 of file simple_trajectory_generator.cpp.
void base_local_planner::SimpleTrajectoryGenerator::setParameters | ( | double | sim_time, |
double | sim_granularity, | ||
double | angular_sim_granularity, | ||
bool | use_dwa = false , |
||
double | sim_period = 0.0 |
||
) |
This function is to be called only when parameters change
Definition at line 141 of file simple_trajectory_generator.cpp.
double base_local_planner::SimpleTrajectoryGenerator::angular_sim_granularity_ [protected] |
Definition at line 151 of file simple_trajectory_generator.h.
Definition at line 148 of file simple_trajectory_generator.h.
bool base_local_planner::SimpleTrajectoryGenerator::discretize_by_time_ [protected] |
Definition at line 149 of file simple_trajectory_generator.h.
base_local_planner::LocalPlannerLimits* base_local_planner::SimpleTrajectoryGenerator::limits_ [protected] |
Definition at line 143 of file simple_trajectory_generator.h.
unsigned int base_local_planner::SimpleTrajectoryGenerator::next_sample_index_ [protected] |
Definition at line 140 of file simple_trajectory_generator.h.
Eigen::Vector3f base_local_planner::SimpleTrajectoryGenerator::pos_ [protected] |
Definition at line 144 of file simple_trajectory_generator.h.
std::vector<Eigen::Vector3f> base_local_planner::SimpleTrajectoryGenerator::sample_params_ [protected] |
Definition at line 142 of file simple_trajectory_generator.h.
double base_local_planner::SimpleTrajectoryGenerator::sim_granularity_ [protected] |
Definition at line 151 of file simple_trajectory_generator.h.
double base_local_planner::SimpleTrajectoryGenerator::sim_period_ [protected] |
Definition at line 153 of file simple_trajectory_generator.h.
double base_local_planner::SimpleTrajectoryGenerator::sim_time_ [protected] |
Definition at line 151 of file simple_trajectory_generator.h.
bool base_local_planner::SimpleTrajectoryGenerator::use_dwa_ [protected] |
Definition at line 152 of file simple_trajectory_generator.h.
Eigen::Vector3f base_local_planner::SimpleTrajectoryGenerator::vel_ [protected] |
Definition at line 145 of file simple_trajectory_generator.h.