moveit2
The MoveIt Motion Planning Framework for ROS 2.
Public Member Functions | Friends | List of all members
pilz_industrial_motion_planner::VelocityProfileATrap 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_industrial_motion_planner::VelocityProfileATrap:
Inheritance graph
[legend]
Collaboration diagram for pilz_industrial_motion_planner::VelocityProfileATrap:
Collaboration graph
[legend]

Public Member Functions

 VelocityProfileATrap (double max_vel=0, double max_acc=0, double max_dec=0)
 Constructor. More...
 
void SetProfile (double pos1, double pos2) override
 compute the fastest profile Algorithm: More...
 
void SetProfileDuration (double pos1, double pos2, double duration) override
 Profile scaled by the total duration. 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...
 
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 firstPhaseDuration () const
 get the time of first phase More...
 
double secondPhaseDuration () const
 get the time of second phase More...
 
double thirdPhaseDuration () const
 get the time of third phase More...
 
bool operator== (const VelocityProfileATrap &other) const
 Compares two Asymmetric Trapezoidal Velocity Profiles. More...
 
double Duration () const override
 Duration. More...
 
double Pos (double time) const override
 Get position at given time. More...
 
double Vel (double time) const override
 Get velocity at given time. More...
 
double Acc (double time) const override
 Get given acceleration/deceleration at given time. More...
 
void Write (std::ostream &os) const override
 Write basic information. More...
 
KDL::VelocityProfile * Clone () const override
 returns copy of current VelocityProfile object More...
 
 ~VelocityProfileATrap () override
 

Friends

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

Detailed Description

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

Definition at line 51 of file velocity_profile_atrap.h.

Constructor & Destructor Documentation

◆ VelocityProfileATrap()

pilz_industrial_motion_planner::VelocityProfileATrap::VelocityProfileATrap ( 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 39 of file velocity_profile_atrap.cpp.

Here is the caller graph for this function:

◆ ~VelocityProfileATrap()

pilz_industrial_motion_planner::VelocityProfileATrap::~VelocityProfileATrap ( )
override

Definition at line 431 of file velocity_profile_atrap.cpp.

Member Function Documentation

◆ Acc()

double pilz_industrial_motion_planner::VelocityProfileATrap::Acc ( double  time) const
override

Get given acceleration/deceleration at given time.

Parameters
time
Returns

Definition at line 360 of file velocity_profile_atrap.cpp.

Here is the caller graph for this function:

◆ Clone()

KDL::VelocityProfile * pilz_industrial_motion_planner::VelocityProfileATrap::Clone ( ) const
override

returns copy of current VelocityProfile object

Returns

Definition at line 384 of file velocity_profile_atrap.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Duration()

double pilz_industrial_motion_planner::VelocityProfileATrap::Duration ( ) const
override

Duration.

Returns
total duration of the trajectory

Definition at line 307 of file velocity_profile_atrap.cpp.

Here is the caller graph for this function:

◆ firstPhaseDuration()

double pilz_industrial_motion_planner::VelocityProfileATrap::firstPhaseDuration ( ) const
inline

get the time of first phase

Returns

Definition at line 120 of file velocity_profile_atrap.h.

Here is the caller graph for this function:

◆ operator==()

bool pilz_industrial_motion_planner::VelocityProfileATrap::operator== ( const VelocityProfileATrap other) const

Compares two Asymmetric Trapezoidal Velocity Profiles.

Returns
True if equal, false otherwise.

Definition at line 422 of file velocity_profile_atrap.cpp.

◆ Pos()

double pilz_industrial_motion_planner::VelocityProfileATrap::Pos ( double  time) const
override

Get position at given time.

Parameters
time
Returns

Definition at line 312 of file velocity_profile_atrap.cpp.

Here is the caller graph for this function:

◆ secondPhaseDuration()

double pilz_industrial_motion_planner::VelocityProfileATrap::secondPhaseDuration ( ) const
inline

get the time of second phase

Returns

Definition at line 128 of file velocity_profile_atrap.h.

Here is the caller graph for this function:

◆ SetProfile()

void pilz_industrial_motion_planner::VelocityProfileATrap::SetProfile ( double  pos1,
double  pos2 
)
override

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

Definition at line 61 of file velocity_profile_atrap.cpp.

Here is the caller graph for this function:

◆ setProfileAllDurations()

bool pilz_industrial_motion_planner::VelocityProfileATrap::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
      true if the combination of three durations is valid

Definition at line 152 of file velocity_profile_atrap.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetProfileDuration()

void pilz_industrial_motion_planner::VelocityProfileATrap::SetProfileDuration ( double  pos1,
double  pos2,
double  duration 
)
override

Profile scaled by the total duration.

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

Definition at line 129 of file velocity_profile_atrap.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setProfileStartVelocity()

bool pilz_industrial_motion_planner::VelocityProfileATrap::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 207 of file velocity_profile_atrap.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ thirdPhaseDuration()

double pilz_industrial_motion_planner::VelocityProfileATrap::thirdPhaseDuration ( ) const
inline

get the time of third phase

Returns

Definition at line 136 of file velocity_profile_atrap.h.

Here is the caller graph for this function:

◆ Vel()

double pilz_industrial_motion_planner::VelocityProfileATrap::Vel ( double  time) const
override

Get velocity at given time.

Parameters
time
Returns

Definition at line 336 of file velocity_profile_atrap.cpp.

Here is the caller graph for this function:

◆ Write()

void pilz_industrial_motion_planner::VelocityProfileATrap::Write ( std::ostream &  os) const
override

Write basic information.

Parameters
os

Definition at line 392 of file velocity_profile_atrap.cpp.

Friends And Related Function Documentation

◆ operator<<

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

Definition at line 397 of file velocity_profile_atrap.cpp.


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