KDL
1.4.0
|
A Path being the composition of other Path objects. More...
#include <src/path_composite.hpp>
Public Types | |
enum | IdentifierType { ID_LINE =1, ID_CIRCLE =2, ID_COMPOSITE =3, ID_ROUNDED_COMPOSITE =4, ID_POINT =5, ID_CYCLIC_CLOSED =6 } |
Public Member Functions | |
Path_Composite () | |
void | Add (Path *geom, bool aggregate=true) |
Adds a Path* to this composite. More... | |
virtual double | LengthToS (double length) |
LengthToS() converts a physical length along the trajectory to the parameter s used in Pos, Vel and Acc. More... | |
virtual double | PathLength () |
Returns the total path length of the trajectory (has dimension LENGTH) This is not always a physical length , ie when dealing with rotations that are dominant. More... | |
virtual Frame | Pos (double s) const |
Returns the Frame at the current path length s. More... | |
virtual Twist | Vel (double s, double sd) const |
Returns the velocity twist at path length s theta and with derivative of s == sd. More... | |
virtual Twist | Acc (double s, double sd, double sdd) const |
Returns the acceleration twist at path length s and with derivative of s == sd, and 2nd derivative of s == sdd. More... | |
virtual Path * | Clone () |
Virtual constructor, constructing by copying, Returns a deep copy of this Path Object. More... | |
virtual void | Write (std::ostream &os) |
Writes one of the derived objects to the stream. More... | |
virtual int | GetNrOfSegments () |
returns the number of underlying segments. More... | |
virtual Path * | GetSegment (int i) |
returns a pointer to the underlying Path of the given segment number i. More... | |
virtual double | GetLengthToEndOfSegment (int i) |
gets the length to the end of the given segment. More... | |
virtual void | GetCurrentSegmentLocation (double s, int &segment_number, double &inner_s) |
virtual IdentifierType | getIdentifier () const |
gets an identifier indicating the type of this Path object More... | |
virtual | ~Path_Composite () |
Static Public Member Functions | |
static Path * | Read (std::istream &is) |
Reads one of the derived objects from the stream and returns a pointer (factory method) More... | |
Private Types | |
typedef std::vector< std::pair< Path *, bool > > | PathVector |
typedef std::vector< double > | DoubleVector |
Private Member Functions | |
double | Lookup (double s) const |
Private Attributes | |
PathVector | gv |
DoubleVector | dv |
double | pathlength |
double | cached_starts |
double | cached_ends |
int | cached_index |
A Path being the composition of other Path objects.
For several of its methods, this class needs to lookup the segment corresponding to a value of the path variable s. To increase efficiency, this value is cached.
Currently a linear search is used to look up the segment. A binary search is more efficient. Can STL be used for this ? Increase the efficiency for caching for the common case of a fine grained monotonously increasing path variable s.
For all Path.., VelocityProfile.., Trajectory... check the bounds on the inputs with asserts.
explain this routine in the wiki.
|
private |
|
private |
|
inherited |
KDL::Path_Composite::Path_Composite | ( | ) |
References cached_ends, cached_index, cached_starts, and pathlength.
Referenced by Clone().
|
virtual |
References gv.
Referenced by getIdentifier().
|
virtual |
Returns the acceleration twist at path length s and with derivative of s == sd, and 2nd derivative of s == sdd.
Implements KDL::Path.
References cached_index, gv, and Lookup().
Referenced by KDL::Path_RoundedComposite::Acc().
void KDL::Path_Composite::Add | ( | Path * | geom, |
bool | aggregate = true |
||
) |
Adds a Path* to this composite.
References dv, gv, pathlength, and KDL::Path::PathLength().
Referenced by KDL::Path_RoundedComposite::Add(), and KDL::Path_RoundedComposite::Finish().
|
virtual |
Virtual constructor, constructing by copying, Returns a deep copy of this Path Object.
Implements KDL::Path.
References dv, gv, and Path_Composite().
Referenced by KDL::Path_RoundedComposite::Clone().
|
virtual |
s | [INPUT] path length variable for the composite. |
segment_number | [OUTPUT] segments that corresponds to the path length variable s. |
inner_s | [OUTPUT] path length to use within the segment. |
References cached_index, and Lookup().
Referenced by KDL::Path_RoundedComposite::GetCurrentSegmentLocation().
|
inlinevirtual |
gets an identifier indicating the type of this Path object
Implements KDL::Path.
References KDL::Path::ID_COMPOSITE, and ~Path_Composite().
|
virtual |
gets the length to the end of the given segment.
i | segment number |
References dv.
Referenced by KDL::Path_RoundedComposite::GetLengthToEndOfSegment().
|
virtual |
returns the number of underlying segments.
References dv.
Referenced by KDL::Path_RoundedComposite::GetNrOfSegments().
|
virtual |
returns a pointer to the underlying Path of the given segment number i.
i | segment number |
Referenced by KDL::Path_RoundedComposite::GetSegment().
|
virtual |
LengthToS() converts a physical length along the trajectory to the parameter s used in Pos, Vel and Acc.
This is used because in cases with large rotations the parameter s does NOT correspond to the lineair length along the trajectory. User should be sure that the lineair distance travelled by this path object is NOT zero, when using this method ! (e.g. the case of only rotational change) throws Error_MotionPlanning_Not_Applicable if used on composed path objects.
Implements KDL::Path.
Referenced by KDL::Path_RoundedComposite::LengthToS().
|
private |
References cached_ends, cached_index, cached_starts, dv, and pathlength.
Referenced by Acc(), GetCurrentSegmentLocation(), Pos(), and Vel().
|
virtual |
Returns the total path length of the trajectory (has dimension LENGTH) This is not always a physical length , ie when dealing with rotations that are dominant.
Implements KDL::Path.
References pathlength.
Referenced by KDL::Path_RoundedComposite::PathLength().
|
virtual |
Returns the Frame at the current path length s.
Implements KDL::Path.
References cached_index, gv, and Lookup().
Referenced by KDL::Path_RoundedComposite::Pos().
|
staticinherited |
Reads one of the derived objects from the stream and returns a pointer (factory method)
References KDL::RotationalInterpolation::Read().
Referenced by KDL::Trajectory::Read().
|
virtual |
Returns the velocity twist at path length s theta and with derivative of s == sd.
Implements KDL::Path.
References cached_index, gv, and Lookup().
Referenced by KDL::Path_RoundedComposite::Vel().
|
virtual |
Writes one of the derived objects to the stream.
Implements KDL::Path.
Referenced by KDL::Path_RoundedComposite::Write().
|
mutableprivate |
Referenced by Lookup(), and Path_Composite().
|
mutableprivate |
Referenced by Acc(), GetCurrentSegmentLocation(), Lookup(), Path_Composite(), Pos(), and Vel().
|
mutableprivate |
Referenced by Lookup(), and Path_Composite().
|
private |
Referenced by Add(), Clone(), GetLengthToEndOfSegment(), GetNrOfSegments(), GetSegment(), Lookup(), and Write().
|
private |
Referenced by Acc(), Add(), Clone(), GetSegment(), Pos(), Vel(), Write(), and ~Path_Composite().
|
private |
Referenced by Add(), Lookup(), Path_Composite(), and PathLength().