AURobotServers  4
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
UManoeuvre Class Reference

#include <umanoeuvre.h>

Inheritance diagram for UManoeuvre:
Inheritance graph

Public Types

enum  MAN_TYPE { MAN_NONE, MAN_LINE, MAN_ARC, MAN_STOP }
 

Public Member Functions

virtual void fprint (FILE *fd, const char *prestr, double *v=NULL)
 
double getAcc ()
 
virtual double getDistance ()
 
virtual double getDistanceXYSigned (UPosition, int *, bool, bool, UPose *, double *)
 
virtual UPose getEndPose ()
 
virtual UPoseV getEndPoseV (UPoseV startPoseV)
 
virtual double getEndV (UPoseV startPoseV)
 
virtual double getEndV (double startV)
 
virtual bool getFoodprintPolygon (UPolygon *, UPolygon *, double, double, double, double, double, UPose *, double)
 
virtual double getManTime (double startVel)
 
int getManType ()
 
virtual double getMinDistanceXYSigned (ULineSegment *, int *, UPosition *, bool, int *, UPose *)
 
virtual UPoseV getPoseV (double atManTime, UPoseV startPoseV, double endV)
 
virtual bool getSMRCLcmd (char *, int)
 
virtual bool getSMRCLcmd2 (char *, int, UPoseV *, bool *, double, int *, int, double *, double, UTime *, FILE *)
 
double getVel ()
 
virtual const char * print (const char *, double *, char *buff, const int)
 
void setAcc (double value)
 
void setVel (double value)
 
 UManoeuvre ()
 
virtual ~UManoeuvre ()
 

Static Public Member Functions

static double getMinAcc ()
 

Protected Attributes

double acc
 
MAN_TYPE manType
 
double vel
 

Detailed Description

Base classe for a series of basic manoeuvres

Author
Christian Andersen

Member Enumeration Documentation

Manoeuvre types

Enumerator
MAN_NONE 
MAN_LINE 
MAN_ARC 
MAN_STOP 

Constructor & Destructor Documentation

UManoeuvre::UManoeuvre ( )

Constructor

References acc, MAN_NONE, manType, and vel.

UManoeuvre::~UManoeuvre ( )
virtual

destructor

Member Function Documentation

void UManoeuvre::fprint ( FILE *  fd,
const char *  prestr,
double *  v = NULL 
)
virtual

Print status info with this lead string

Reimplemented in UManArc, and UManLine.

Referenced by getManType().

double UManoeuvre::getAcc ( )
inline

Get acceleration during manoeuvre

References acc.

Referenced by USmlTag::codeManoeuvre(), and UManSeq::copy().

virtual double UManoeuvre::getDistance ( )
inlinevirtual
virtual double UManoeuvre::getDistanceXYSigned ( UPosition  ,
int *  ,
bool  ,
bool  ,
UPose ,
double *   
)
inlinevirtual

Get distance to this position from the manoeuvre line Positive is to the right of segment - seen from first end in direction towards other end if 'posIsRight' is true. Returnes distance to either end or to a point on line whatever is closest. If 'where' is not NULL, then the closest part is returned here as: 0=point on line, 1= first point, 2= other end. Distance to ends are not calculated if 'centerOnly' is true. The closest position on route is returned in 'pHit' if closest on line.

Reimplemented in UManArc, and UManLine.

Referenced by UManPPSeq::getDistanceXYSigned().

UPose UManoeuvre::getEndPose ( )
virtual

Get relative pose at end of manoeuvre

Reimplemented in UManArc, and UManLine.

Referenced by UManPPSeq::getDistanceXYSigned(), and UManPPSeq::getMinDistanceXYSigned().

UPoseV UManoeuvre::getEndPoseV ( UPoseV  startPoseV)
virtual
double UManoeuvre::getEndV ( UPoseV  startPoseV)
virtual

Get velocity at end of manoeuvre

Reimplemented in UManStop.

References UPoseV::getVel().

Referenced by UManLine::fprint(), UManArc::fprint(), UManLine::getEndPoseV(), UManLine::print(), UManArc::print(), and testMan().

double UManoeuvre::getEndV ( double  startV)
virtual

Get end velocity assuming this start velocity

Reimplemented in UManStop.

References absd(), acc, getDistance(), sqr(), and vel.

virtual bool UManoeuvre::getFoodprintPolygon ( UPolygon ,
UPolygon ,
double  ,
double  ,
double  ,
double  ,
double  ,
UPose ,
double   
)
inlinevirtual

Get this manoeuvre as a polygin covering the robot foodprint during the manoeuvre.

Parameters
polyInclis a polygon (convex) with sufficient corners for the manoeuvre.
polyExclis a polygon (convex) covering the concavity of the polyIncl that is not part of the manoeuvre footprint.
leftXis the forward distance of the front-left-most extreme point of the robot (positive).
leftYis the x-coordinate of the position of the front-left-most extreme point of the robot (should be positive).
rightXis the forward distance of the front-right-most extreme point of the robot (positive).
rightYis the y-coordinate of the position of the front-right-most extreme point of the robot (should be negative).
clearenceis the minimum clearence around extreme points.
startPoseis the start pose of the manoeuvre, indicating the coordinate system used.
allowedErris the allowed deviation from true polygon in meters (must be > 0.0).
Returns
true if polygon is valid.

Reimplemented in UManArc, and UManLine.

Referenced by UAvoidPath2::getClosestObst2().

double UManoeuvre::getManTime ( double  startVel)
virtual

Time to complete manoeuver. Should be overwritten by a real manoeuvere.

Reimplemented in UManStop.

References absd(), acc, getDistance(), sqr(), and vel.

Referenced by UManPPSeq::calcEndVel(), UManLine::fprint(), UManArc::fprint(), UManPPSeq::getPoseV(), UManLine::print(), UManArc::print(), and testMan().

int UManoeuvre::getManType ( )
inline

Get manoeuvre type: 0 = base - i.e. not valid manoeuvre. 1 = line - straight in current direction 2 = arc - a turn manoeuvre with constant radius and arc length 3 = stop - stop all movement

References fprint(), and manType.

Referenced by USmlTag::codeManoeuvre(), UManSeq::copy(), UAvoidPath2::getManAsPolygon(), UManPPSeq::getMaxTurnArc(), UPaintManoeuvre::makeManCloud(), UNavPaint::paintManData(), UClientFuncLaserGui::paintPathData(), UManSeq::removeLastArc(), and UManPPSeq::truncate().

static double UManoeuvre::getMinAcc ( )
inlinestatic

Minimum acceleration transferred to SMR, to avoid unwanted situations with no speed and too little acceleration

Referenced by UManLine::getSMRCLcmd(), and UManArc::getSMRCLcmd().

virtual double UManoeuvre::getMinDistanceXYSigned ( ULineSegment ,
int *  ,
UPosition ,
bool  ,
int *  ,
UPose  
)
inlinevirtual

Get shortest distance to this line segment 'seg'. If 'posIsRight', then the distance is positive to the right of the route. The closest point on the segnment is returned in 'posOnSeg'. If the closest point on the segment streach, then whereOnSeg = 0, if the ref end of segment, then whereOnSeg = 1, other end is 2. the closest point in the route is returned in 'poseOnSeg'. If the closest point on the manoeuvre is between endpoints, then whereOnMan = 0, if the first end of manoeuvre, then whereOnMan = 1, last end is 2.

Reimplemented in UManArc, and UManLine.

Referenced by UManPPSeq::getMinDistanceXYSigned().

UPoseV UManoeuvre::getPoseV ( double  atManTime,
UPoseV  startPoseV,
double  endV 
)
virtual

Get end pose from this start pose. Assumes that the 'atManTime' is within this manoeuvre, if not the result is unpredictable (most likely just extended)

Reimplemented in UManArc, and UManLine.

virtual bool UManoeuvre::getSMRCLcmd ( char *  ,
int   
)
inlinevirtual

Code this manoeuvre into a SMRCL command string. Returns false if buffer is too short or command is not codeable.

Reimplemented in UManStop, and UManLine.

Referenced by UManStop::getManTime(), and UManStop::getSMRCLcmd2().

virtual bool UManoeuvre::getSMRCLcmd2 ( char *  ,
int  ,
UPoseV ,
bool *  ,
double  ,
int *  ,
int  ,
double *  ,
double  ,
UTime ,
FILE *   
)
inlinevirtual

Code this manoeuvre into a SMRCL command string. Return in short form, so that no ore than 'lineCntMax' lines are coded, and no more than 'distSumMax' are covered. if *first is true, then (distSum + distabce of this manoeuvre) must be longet than 'firstDistance'. This is to avoid a target position behind the robot. If manoeuvre is used *first is set to false, if not then there is no command in 'buf'. Returns new start position for next manoeuvre in 'startPose', and as well as new 'lineCnt' and distance travelled in 'distSum'.

Parameters
tis optional current pose time for logging of manoeuvre primitives
logprimis the file handle to log to - format time, type (2 or 3) posev, posev false if buffer is too short or command is not codeable.

Reimplemented in UManArc, and UManLine.

Referenced by UManStop::getManTime(), and UResSmrCtl::sendNewManoeuvreToSMR().

double UManoeuvre::getVel ( )
inline

Get drive vel at end of manoeuvre

References vel.

Referenced by USmlTag::codeManoeuvre(), and UManSeq::copy().

virtual const char* UManoeuvre::print ( const char *  ,
double *  ,
char *  buff,
const int   
)
inlinevirtual

Print status info to string with this lead string

Reimplemented in UManArc, and UManLine.

Referenced by UManStop::getManTime(), and UManPPSeq::print().

void UManoeuvre::setAcc ( double  value)
inline

Get acceleration during manoeuvre

References acc.

Referenced by UManSeq::getNewArc(), UManSeq::getNewLine(), UManSeq::getNewStop(), and testMan().

void UManoeuvre::setVel ( double  value)
inline

Set drive vel at end of manoeuvre

References vel.

Referenced by UManSeq::getNewArc(), UManSeq::getNewLine(), UManSeq::getNewStop(), and testMan().

Member Data Documentation

double UManoeuvre::acc
protected
MAN_TYPE UManoeuvre::manType
protected

Manoeuvre type: 0 = MAN_NONE = base - i.e. not valid manoeuvre. 1 = MAN_LINE = line - straight in current direction 2 = MAN_ARC = arc - a turn manoeuvre with constant radius and arc length 3 = MAN_STOP = stop all movement

Referenced by getManType(), UManArc::UManArc(), UManLine::UManLine(), UManoeuvre(), and UManStop::UManStop().

double UManoeuvre::vel
protected

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