AURobotServers
4
|
#include <umanarc.h>
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 () |
An arc turn manoeuvre
UManArc::UManArc | ( | ) |
Constructor
References UManoeuvre::MAN_ARC, and UManoeuvre::manType.
UManArc::~UManArc | ( | ) |
Destructor
|
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().
|
virtual |
Get distance traveled (always positive)
Reimplemented from UManoeuvre.
References absd(), angle, and radius.
Referenced by getSMRCLcmd(), and getSMRCLcmd2().
|
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().
|
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().
Get end pose from this start pose
Reimplemented from UManoeuvre.
References getEndPose(), UPoseV::setVel(), and UManoeuvre::vel.
Referenced by getSMRCLcmd2(), and UPaintManoeuvre::makeManCloud().
|
virtual |
Get this manoeuvre as a polygin covering the robot foodprint during the manoeuvre.
polyIncl | is a polygon (convex) with sufficient corners for the manoeuvre. |
polyExcl | is a polygon (convex) covering the concavity of the polyIncl that is not part of the manoeuvre footprint. |
leftX | is the forward distance of the front-left-most extreme point of the robot (positive). |
leftY | is the x-coordinate of the position of the front-left-most extreme point of the robot (should be positive). |
rightX | is the forward distance of the front-right-most extreme point of the robot (positive). |
rightY | is the y-coordinate of the position of the front-right-most extreme point of the robot (should be negative). |
clearence | is the minimum clearence around vehicle |
startPose | is the start pose of the manoeuvre, indicating the coordinate system used. |
allowedErr | is the allowed deviation from true polygon in meters (must be > 0.0). |
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().
|
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().
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.
|
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().
|
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().
|
inline |
Get turn angle (positive is counter clockwise)
References angle.
Referenced by UAvoidPath2::getManAsPolygon(), UManPPSeq::getMaxTurnArc(), UPaintManoeuvre::makeManCloud(), UNavPaint::paintManData(), UClientFuncLaserGui::paintPathData(), and UManPPSeq::truncate().
Get the position of the turning centre for this manoeuvre, given this start pose
startPose | is where the manoeuvre starts. |
References angle, UPose::h, radius, UPosition::x, UPose::x, UPosition::y, and UPose::y.
Referenced by setTurnAngle().
|
inline |
Get turn radius
References radius.
Referenced by UAvoidPath2::getManAsPolygon(), UPaintManoeuvre::makeManCloud(), UNavPaint::paintManData(), UClientFuncLaserGui::paintPathData(), and UManPPSeq::truncate().
|
virtual |
Print status to string
Reimplemented from UManoeuvre.
References UManoeuvre::acc, angle, UManoeuvre::getEndV(), UManoeuvre::getManTime(), radius, and UManoeuvre::vel.
Referenced by setTurnAngle().
|
inline |
Set turn angle (positive is counter clockwise)
References angle, buf, fprint(), getDistanceXYSigned(), getFoodprintPolygon(), getMinDistanceXYSigned(), getSMRCLcmd(), getSMRCLcmd2(), getTurnCentre(), and print().
Referenced by UAvoidPath2::extendManoeuvre(), UManSeq::getNewArc(), getPoseV(), getSMRCLcmd2(), UPaintManoeuvre::makeManCloud(), UNavPaint::paintManData(), UClientFuncLaserGui::paintPathData(), testManDistance(), testManPoly(), testManToSeg(), and UManPPSeq::truncate().
|
inline |
Set turn radius
References radius.
Referenced by UAvoidPath2::extendManoeuvre(), UManSeq::getNewArc(), getSMRCLcmd2(), UPaintManoeuvre::makeManCloud(), UNavPaint::paintManData(), UClientFuncLaserGui::paintPathData(), testManDistance(), testManPoly(), and testManToSeg().
|
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().
|
protected |
Turn radius in meter (always positive)
Referenced by fprint(), getDistance(), getDistanceXYSigned(), getEndPose(), getFoodprintPolygon(), getMinDistanceXYSigned(), getPoseV(), getSMRCLcmd(), getSMRCLcmd2(), getTurnCentre(), getTurnRadius(), print(), and setTurnRadius().