Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
pilz::VelocityProfile_ATrap Class Reference

A PTP Trajectory Generator of Asymmetric Trapezoidal Velocity Profile. Differences to VelocityProfile_Trap: More...

#include <velocity_profile_atrap.h>

Inheritance diagram for pilz::VelocityProfile_ATrap:
Inheritance graph
[legend]

Public Member Functions

virtual double Acc (double time) const override
 Get given acceleration/deceleration at given time. More...
 
virtual KDL::VelocityProfileClone () const override
 returns copy of current VelocityProfile object More...
 
virtual double Duration () const override
 Duration. More...
 
double FirstPhaseDuration () const
 get the time of first phase More...
 
bool operator== (const VelocityProfile_ATrap &other) const
 Compares two Asymmetric Trapezoidal Velocity Profiles. More...
 
virtual double Pos (double time) const override
 Get position at given time. More...
 
double SecondPhaseDuration () const
 get the time of second phase More...
 
virtual void SetProfile (double pos1, double pos2) override
 compute the fastest profile Algorithm: More...
 
bool setProfileAllDurations (double pos1, double pos2, double duration1, double duration2, double duration3)
 Profile with given acceleration/constant/deceleration durations. Each duration must obey the maximal velocity/acceleration/deceleration constraints. Otherwise the operation will be ignored. Algorithm: More...
 
virtual void SetProfileDuration (double pos1, double pos2, double duration) override
 Profile scaled by the total duration. More...
 
bool setProfileStartVelocity (double pos1, double pos2, double vel1)
 Profile with start velocity Note: This function is not general and is currently only used for live control (vel1*(pos2-pos1)>0). More...
 
double ThirdPhaseDuration () const
 get the time of third phase More...
 
virtual double Vel (double time) const override
 Get velocity at given time. More...
 
 VelocityProfile_ATrap (double max_vel=0, double max_acc=0, double max_dec=0)
 Constructor. More...
 
virtual void Write (std::ostream &os) const override
 Write basic information. More...
 
virtual ~VelocityProfile_ATrap ()
 
- Public Member Functions inherited from KDL::VelocityProfile
virtual ~VelocityProfile ()
 

Private Member Functions

void setEmptyProfile ()
 helper functions More...
 

Private Attributes

double a1_
 three phases of trapezoid More...
 
double a2_
 
double a3_
 
double b1_
 coef. from ^0 -> ^2 of first phase More...
 
double b2_
 
double b3_
 
double c1_
 of second phase More...
 
double c2_
 
double c3_
 
double end_pos_
 
const double max_acc_
 
const double max_dec_
 
const double max_vel_
 specification of the motion profile : More...
 
double start_pos_
 
double start_vel_
 for initial velocity More...
 
double t_a_
 of third phase More...
 
double t_b_
 the duration of first phase More...
 
double t_c_
 the duration of second phase More...
 

Friends

std::ostream & operator<< (std::ostream &os, const VelocityProfile_ATrap &p)
 

Additional Inherited Members

- Static Public Member Functions inherited from KDL::VelocityProfile
static VelocityProfileRead (std::istream &is)
 

Detailed Description

A PTP Trajectory Generator of Asymmetric Trapezoidal Velocity Profile. Differences to VelocityProfile_Trap:

Definition at line 34 of file velocity_profile_atrap.h.

Constructor & Destructor Documentation

pilz::VelocityProfile_ATrap::VelocityProfile_ATrap ( double  max_vel = 0,
double  max_acc = 0,
double  max_dec = 0 
)

Constructor.

Parameters
max_velmaximal velocity (absolute value, always positive)
max_accmaximal acceleration (absolute value, always positive)
max_decmaximal deceleration (absolute value, always positive)

Definition at line 22 of file velocity_profile_atrap.cpp.

pilz::VelocityProfile_ATrap::~VelocityProfile_ATrap ( )
virtual

Definition at line 416 of file velocity_profile_atrap.cpp.

Member Function Documentation

double pilz::VelocityProfile_ATrap::Acc ( double  time) const
overridevirtual

Get given acceleration/deceleration at given time.

Parameters
time
Returns

Implements KDL::VelocityProfile.

Definition at line 333 of file velocity_profile_atrap.cpp.

KDL::VelocityProfile * pilz::VelocityProfile_ATrap::Clone ( ) const
overridevirtual

returns copy of current VelocityProfile object

Returns

Implements KDL::VelocityProfile.

Definition at line 356 of file velocity_profile_atrap.cpp.

double pilz::VelocityProfile_ATrap::Duration ( ) const
overridevirtual

Duration.

Returns
total duration of the trajectory

Implements KDL::VelocityProfile.

Definition at line 282 of file velocity_profile_atrap.cpp.

double pilz::VelocityProfile_ATrap::FirstPhaseDuration ( ) const
inline

get the time of first phase

Returns

Definition at line 101 of file velocity_profile_atrap.h.

bool pilz::VelocityProfile_ATrap::operator== ( const VelocityProfile_ATrap other) const

Compares two Asymmetric Trapezoidal Velocity Profiles.

Returns
True if equal, false otherwise.

Definition at line 394 of file velocity_profile_atrap.cpp.

double pilz::VelocityProfile_ATrap::Pos ( double  time) const
overridevirtual

Get position at given time.

Parameters
time
Returns

Implements KDL::VelocityProfile.

Definition at line 287 of file velocity_profile_atrap.cpp.

double pilz::VelocityProfile_ATrap::SecondPhaseDuration ( ) const
inline

get the time of second phase

Returns

Definition at line 106 of file velocity_profile_atrap.h.

void pilz::VelocityProfile_ATrap::setEmptyProfile ( )
private

helper functions

Definition at line 421 of file velocity_profile_atrap.cpp.

void pilz::VelocityProfile_ATrap::SetProfile ( double  pos1,
double  pos2 
)
overridevirtual

compute the fastest profile Algorithm:

  • compute the minimal distance which is needed to reach maximal velocity
  • if maximal velocity can be reached
    • compute the coefficients of the trajectory
  • if maximal velocity can not be reached
    • compute the new velocity can be reached
    • compute the coefficients based on this new velocity
Parameters
pos1start position
pos2goal position

Implements KDL::VelocityProfile.

Definition at line 32 of file velocity_profile_atrap.cpp.

bool pilz::VelocityProfile_ATrap::setProfileAllDurations ( double  pos1,
double  pos2,
double  duration1,
double  duration2,
double  duration3 
)

Profile with given acceleration/constant/deceleration durations. Each duration must obey the maximal velocity/acceleration/deceleration constraints. Otherwise the operation will be ignored. Algorithm:

  • compute the maximal velocity of given durations
  • compute the acceleration and deceleration of given duraitons
  • if limits are fulfilled
    • compute the coefficients
      Parameters
      pos1start position
      pos2goal position
      acc_durationtime of acceleration phase
      const_durationtime of constant phase
      dec_durationtime of deceleration phase
      Returns
      ture if the combination of three durations is valid

Definition at line 125 of file velocity_profile_atrap.cpp.

void pilz::VelocityProfile_ATrap::SetProfileDuration ( double  pos1,
double  pos2,
double  duration 
)
overridevirtual

Profile scaled by the total duration.

Parameters
pos1start position
pos2goal position
durationtrajectory duration (must be longer than fastest case, otherwise will be ignored)

Implements KDL::VelocityProfile.

Definition at line 102 of file velocity_profile_atrap.cpp.

bool pilz::VelocityProfile_ATrap::setProfileStartVelocity ( double  pos1,
double  pos2,
double  vel1 
)

Profile with start velocity Note: This function is not general and is currently only used for live control (vel1*(pos2-pos1)>0).

Parameters
pos1start position
pos2goal position
vel1start velocity
Returns

Definition at line 181 of file velocity_profile_atrap.cpp.

double pilz::VelocityProfile_ATrap::ThirdPhaseDuration ( ) const
inline

get the time of third phase

Returns

Definition at line 111 of file velocity_profile_atrap.h.

double pilz::VelocityProfile_ATrap::Vel ( double  time) const
overridevirtual

Get velocity at given time.

Parameters
time
Returns

Implements KDL::VelocityProfile.

Definition at line 310 of file velocity_profile_atrap.cpp.

void pilz::VelocityProfile_ATrap::Write ( std::ostream &  os) const
overridevirtual

Write basic information.

Parameters
os

Implements KDL::VelocityProfile.

Definition at line 364 of file velocity_profile_atrap.cpp.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const VelocityProfile_ATrap p 
)
friend

Definition at line 369 of file velocity_profile_atrap.cpp.

Member Data Documentation

double pilz::VelocityProfile_ATrap::a1_
private

three phases of trapezoid

Definition at line 176 of file velocity_profile_atrap.h.

double pilz::VelocityProfile_ATrap::a2_
private

Definition at line 176 of file velocity_profile_atrap.h.

double pilz::VelocityProfile_ATrap::a3_
private

Definition at line 176 of file velocity_profile_atrap.h.

double pilz::VelocityProfile_ATrap::b1_
private

coef. from ^0 -> ^2 of first phase

Definition at line 177 of file velocity_profile_atrap.h.

double pilz::VelocityProfile_ATrap::b2_
private

Definition at line 177 of file velocity_profile_atrap.h.

double pilz::VelocityProfile_ATrap::b3_
private

Definition at line 177 of file velocity_profile_atrap.h.

double pilz::VelocityProfile_ATrap::c1_
private

of second phase

Definition at line 178 of file velocity_profile_atrap.h.

double pilz::VelocityProfile_ATrap::c2_
private

Definition at line 178 of file velocity_profile_atrap.h.

double pilz::VelocityProfile_ATrap::c3_
private

Definition at line 178 of file velocity_profile_atrap.h.

double pilz::VelocityProfile_ATrap::end_pos_
private

Definition at line 170 of file velocity_profile_atrap.h.

const double pilz::VelocityProfile_ATrap::max_acc_
private

Definition at line 167 of file velocity_profile_atrap.h.

const double pilz::VelocityProfile_ATrap::max_dec_
private

Definition at line 168 of file velocity_profile_atrap.h.

const double pilz::VelocityProfile_ATrap::max_vel_
private

specification of the motion profile :

Definition at line 166 of file velocity_profile_atrap.h.

double pilz::VelocityProfile_ATrap::start_pos_
private

Definition at line 169 of file velocity_profile_atrap.h.

double pilz::VelocityProfile_ATrap::start_vel_
private

for initial velocity

Definition at line 173 of file velocity_profile_atrap.h.

double pilz::VelocityProfile_ATrap::t_a_
private

of third phase

time of three phases

Definition at line 181 of file velocity_profile_atrap.h.

double pilz::VelocityProfile_ATrap::t_b_
private

the duration of first phase

Definition at line 182 of file velocity_profile_atrap.h.

double pilz::VelocityProfile_ATrap::t_c_
private

the duration of second phase

Definition at line 183 of file velocity_profile_atrap.h.


The documentation for this class was generated from the following files:


pilz_trajectory_generation
Author(s):
autogenerated on Mon Apr 6 2020 03:17:34