AURobotServers  4
Public Member Functions | Protected Attributes | List of all members
UManLine Class Reference

#include <umanline.h>

Inheritance diagram for UManLine:
Inheritance graph

Public Member Functions

virtual void fprint (FILE *fd, const char *prestr, double *v=NULL)
 
double getDistance ()
 
virtual double getDistanceXYSigned (UPosition pos, int *where, bool posIsRight, bool centerOnly, UPose *pHit, double *atT)
 
virtual UPose getEndPose ()
 
virtual UPoseV getEndPoseV (UPoseV startPoseV)
 
virtual bool getFoodprintPolygon (UPolygon *polyIncl, UPolygon *polyExcl, double leftX, double leftY, double rightX, double rightY, double clearence, UPose *startPose, double allowedErr=0.03)
 
virtual double getMinDistanceXYSigned (ULineSegment *seg, int *whereOnSeg, UPosition *posOnSeg, bool posIsRight, int *whereOnMan, UPose *poseOnMan)
 
virtual UPoseV getPoseV (double atManTime, UPoseV startPoseV, double endV)
 
virtual bool getSMRCLcmd (char *buf, int bufCnt)
 
virtual bool getSMRCLcmd2 (char *buf, int bufCnt, UPoseV *startPose, bool *first, double firstDistance, int *lineCnt, int lineCntMax, double *distSum, double distSumMax, UTime *t=NULL, FILE *logprim=NULL)
 
virtual const char * print (const char *prestr, double *v, char *buff, const int buffCnt)
 
void setDistance (double value)
 
 UManLine ()
 
virtual ~UManLine ()
 
- Public Member Functions inherited from UManoeuvre
double getAcc ()
 
virtual double getEndV (UPoseV startPoseV)
 
virtual double getEndV (double startV)
 
virtual double getManTime (double startVel)
 
int getManType ()
 
double getVel ()
 
void setAcc (double value)
 
void setVel (double value)
 
 UManoeuvre ()
 
virtual ~UManoeuvre ()
 

Protected Attributes

double dist
 
- Protected Attributes inherited from UManoeuvre
double acc
 
MAN_TYPE manType
 
double vel
 

Additional Inherited Members

- Public Types inherited from UManoeuvre
enum  MAN_TYPE { MAN_NONE, MAN_LINE, MAN_ARC, MAN_STOP }
 
- Static Public Member Functions inherited from UManoeuvre
static double getMinAcc ()
 

Detailed Description

Straingt line manoeuvre

Author
Christian Andersen

Constructor & Destructor Documentation

UManLine::UManLine ( )

Constructor

References UManoeuvre::MAN_LINE, and UManoeuvre::manType.

UManLine::~UManLine ( )
virtual

Destructor

Member Function Documentation

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

Print status for this manoeuvre

Reimplemented from UManoeuvre.

References UManoeuvre::acc, dist, UManoeuvre::getEndV(), UManoeuvre::getManTime(), and UManoeuvre::vel.

Referenced by setDistance(), testManDistance(), and testManLineToSeg().

double UManLine::getDistance ( )
inlinevirtual

Get distance traveled

Reimplemented from UManoeuvre.

References dist.

Referenced by getSMRCLcmd2().

double UManLine::getDistanceXYSigned ( UPosition  pos,
int *  where,
bool  posIsRight,
bool  centerOnly,
UPose pHit,
double *  atT 
)
virtual

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 from UManoeuvre.

References dist, UPose::set(), signofd(), sqr(), UPosition::x, UPosition::y, and UPosition::z.

Referenced by setDistance(), and testManDistance().

UPose UManLine::getEndPose ( )
virtual

Time to complete manoeuver with this start velocity. Should be overwritten by a real manoeuvere. Return 1e10 if start velocity 'startVel' = 0.0. Get relative pose at end of manoeuvre

Reimplemented from UManoeuvre.

References dist.

Referenced by getEndPoseV().

UPoseV UManLine::getEndPoseV ( UPoseV  startPoseV)
virtual

Get end pose from this start pose

Reimplemented from UManoeuvre.

References getEndPose(), UManoeuvre::getEndV(), and UPoseV::setVel().

Referenced by getSMRCLcmd2().

bool UManLine::getFoodprintPolygon ( UPolygon polyIncl,
UPolygon polyExcl,
double  leftX,
double  leftY,
double  rightX,
double  rightY,
double  clearence,
UPose startPose,
double  allowedErr = 0.03 
)
virtual

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 point.
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.

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 from 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 from UManoeuvre.

References UPolygon::add(), UPolygon::clear(), dist, and UPose::getPoseToMap().

Referenced by setDistance().

double UManLine::getMinDistanceXYSigned ( ULineSegment seg,
int *  whereOnSeg,
UPosition posOnSeg,
bool  posIsRight,
int *  whereOnMan,
UPose poseOnMan 
)
virtual

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 from UManoeuvre.

References dist, U2Dlined::getCrossing(), ULineSegment::getOtherEnd(), ULine::getPositionOnLine(), mind(), ULine::pos, UPose::set(), UPosition::set(), U2Dlined::set2P(), UPosition::x, UPose::x, and UPosition::y.

Referenced by setDistance(), and testManLineToSeg().

UPoseV UManLine::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 from UManoeuvre.

References UManoeuvre::acc, UPoseV::getVel(), UPose::set(), sqr(), and tv.

bool UManLine::getSMRCLcmd ( char *  buf,
int  bufCnt 
)
virtual

Code this manoeuvre into a SMRCL command string. Returns false if command is not codeable.

Reimplemented from UManoeuvre.

References UManoeuvre::acc, dist, UManoeuvre::getMinAcc(), maxd(), and UManoeuvre::vel.

Referenced by setDistance().

bool UManLine::getSMRCLcmd2 ( char *  buf,
int  bufCnt,
UPoseV startPose,
bool *  first,
double  firstDistance,
int *  lineCnt,
int  lineCntMax,
double *  distSum,
double  distSumMax,
UTime t = NULL,
FILE *  logprim = NULL 
)
virtual

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. Returns new start position for next manoeuvre in 'startPose', and as well as new 'lineCnt' and distance travelled in 'distSum'. 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 false if buffer is too short or command is not codeable.

Reimplemented from UManoeuvre.

References UManoeuvre::acc, buf, UPose::clear(), dist, getDistance(), getEndPoseV(), UTime::getMicrosec(), UTime::getSec(), UPose::h, UPoseV::set(), UPoseV::vel, UManoeuvre::vel, UPose::x, and UPose::y.

Referenced by setDistance().

const char * UManLine::print ( const char *  prestr,
double *  v,
char *  buff,
const int  buffCnt 
)
virtual

Print status to string

Reimplemented from UManoeuvre.

References UManoeuvre::acc, dist, UManoeuvre::getEndV(), UManoeuvre::getManTime(), and UManoeuvre::vel.

Referenced by setDistance().

void UManLine::setDistance ( double  value)
inline

Member Data Documentation

double UManLine::dist
protected

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