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

#include <umanarc.h>

Inheritance diagram for UManArc:
Inheritance graph

Public Member Functions

virtual void fprint (FILE *fd, const char *prestr, double *v=NULL)
 
virtual 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)
 
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, double maxDist)
 
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)
 
double getTurnAngle ()
 
UPosition getTurnCentre (UPose startPose)
 
double getTurnRadius ()
 
virtual const char * print (const char *prestr, double *v, char *buff, const int buffCnt)
 
void setTurnAngle (double value)
 
void setTurnRadius (double value)
 
 UManArc ()
 
 ~UManArc ()
 
- 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 ()
 
virtual bool getSMRCLcmd (char *, int)
 
double getVel ()
 
void setAcc (double value)
 
void setVel (double value)
 
 UManoeuvre ()
 
virtual ~UManoeuvre ()
 

Protected Attributes

double angle
 
double radius
 
- 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

An arc turn manoeuvre

Author
Christian Andersen

Constructor & Destructor Documentation

UManArc::UManArc ( )

Constructor

References UManoeuvre::MAN_ARC, and UManoeuvre::manType.

UManArc::~UManArc ( )

Destructor

Member Function Documentation

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

Print status for this manoeuvre

Reimplemented from UManoeuvre.

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

Referenced by setTurnAngle(), testManDistance(), and testManToSeg().

double UManArc::getDistance ( )
virtual

Get distance traveled (always positive)

Reimplemented from UManoeuvre.

References absd(), angle, and radius.

Referenced by getSMRCLcmd(), and getSMRCLcmd2().

double UManArc::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 (w==0). Distance into the line is returned in 'atT' (also only if w==0)

Reimplemented from UManoeuvre.

References absd(), angle, dist, getEndPose(), UPose::h, radius, UPose::set(), signofd(), sqr(), UPosition::x, UPose::x, UPosition::y, and UPose::y.

Referenced by setTurnAngle(), and testManDistance().

UPose UManArc::getEndPose ( )
virtual

Time to complete manoeuver with this start velocity. Should be overwritten by a real manoeuvere. NB! Invalid if spped changes sign in manoeuvre - returns time to zero speed. Return 1e10 if start velocity 'startVel' = 0.0. and acceleration = 0.0 too Get relative pose at end of manoeuvre

Reimplemented from UManoeuvre.

References absd(), angle, UPose::h, radius, UManoeuvre::vel, UPose::x, and UPose::y.

Referenced by getDistanceXYSigned(), getEndPoseV(), and getPoseV().

UPoseV UManArc::getEndPoseV ( UPoseV  startPoseV)
virtual

Get end pose from this start pose

Reimplemented from UManoeuvre.

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

Referenced by getSMRCLcmd2(), and UPaintManoeuvre::makeManCloud().

bool UManArc::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 vehicle
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(), angle, UPolygon::clear(), U2Dlined::getCrossing(), UPolygon::getDistance(), UPose::getPoseToMap(), radius, U2Dlined::set2P(), UPosition::x, and UPosition::y.

Referenced by setTurnAngle(), and testManPoly().

double UManArc::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 angle, dist, ULine::getCylinderCrossings(), ULineSegment::getDistanceXYSigned(), ULineSegment::getOtherEnd(), ULine::getPositionOnLine(), UPose::h, ULine::pos, radius, UPose::set(), UPosition::set(), signofd(), UPosition::x, UPose::x, UPosition::y, and UPose::y.

Referenced by setTurnAngle(), and testManToSeg().

UPoseV UManArc::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, getEndPose(), UPoseV::getVel(), radius, setTurnAngle(), sqr(), and tv.

bool UManArc::getSMRCLcmd ( char *  buf,
int  bufCnt,
double  maxDist 
)
virtual

Code this manoeuvre into a SMRCL command string. Returns false if command is not codeable. The driven distance shall not exceed 'maxDist'

References UManoeuvre::acc, angle, buf, dist, getDistance(), UManoeuvre::getMinAcc(), maxd(), maxi(), mind(), radius, roundi(), and UManoeuvre::vel.

Referenced by setTurnAngle().

bool UManArc::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. 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'. Returns false if buffer is too short or command is not codeable.

Reimplemented from UManoeuvre.

References UManoeuvre::acc, angle, buf, dist, getDistance(), getEndPoseV(), UTime::getMicrosec(), UTime::getSec(), UPose::h, radius, roundi(), setTurnAngle(), setTurnRadius(), UPoseV::vel, UManoeuvre::vel, UPose::x, and UPose::y.

Referenced by setTurnAngle().

double UManArc::getTurnAngle ( )
inline
UPosition UManArc::getTurnCentre ( UPose  startPose)

Get the position of the turning centre for this manoeuvre, given this start pose

Parameters
startPoseis where the manoeuvre starts.
Returns
the centre position (z=0)

References angle, UPose::h, radius, UPosition::x, UPose::x, UPosition::y, and UPose::y.

Referenced by setTurnAngle().

double UManArc::getTurnRadius ( )
inline
const char * UManArc::print ( const char *  prestr,
double *  v,
char *  buff,
const int  buffCnt 
)
virtual

Print status to string

Reimplemented from UManoeuvre.

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

Referenced by setTurnAngle().

void UManArc::setTurnAngle ( double  value)
inline
void UManArc::setTurnRadius ( double  value)
inline

Member Data Documentation

double UManArc::angle
protected

Turn angle in radians. positive is counter clockwise. Value may be above 2*PI (more than a full circle).

Referenced by fprint(), getDistance(), getDistanceXYSigned(), getEndPose(), getFoodprintPolygon(), getMinDistanceXYSigned(), getSMRCLcmd(), getSMRCLcmd2(), getTurnAngle(), getTurnCentre(), print(), and setTurnAngle().

double UManArc::radius
protected

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