AURobotServers
4
|
#include <umanline.h>
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 () |
Straingt line manoeuvre
UManLine::UManLine | ( | ) |
Constructor
References UManoeuvre::MAN_LINE, and UManoeuvre::manType.
|
virtual |
Destructor
|
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().
|
inlinevirtual |
|
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().
|
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().
Get end pose from this start pose
Reimplemented from UManoeuvre.
References getEndPose(), UManoeuvre::getEndV(), and UPoseV::setVel().
Referenced by getSMRCLcmd2().
|
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 extreme point. |
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). |
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 from extreme points. |
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(), UPolygon::clear(), dist, and UPose::getPoseToMap().
Referenced by setDistance().
|
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().
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.
|
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().
|
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().
|
virtual |
Print status to string
Reimplemented from UManoeuvre.
References UManoeuvre::acc, dist, UManoeuvre::getEndV(), UManoeuvre::getManTime(), and UManoeuvre::vel.
Referenced by setDistance().
|
inline |
Set distance traveled
References buf, dist, fprint(), getDistanceXYSigned(), getFoodprintPolygon(), getMinDistanceXYSigned(), getSMRCLcmd(), getSMRCLcmd2(), and print().
Referenced by UManSeq::getNewLine(), testMan(), testManDistance(), testManLineToSeg(), and UManPPSeq::truncate().
|
protected |
Distance of line
Referenced by fprint(), getDistance(), getDistanceXYSigned(), getEndPose(), getFoodprintPolygon(), getMinDistanceXYSigned(), getSMRCLcmd(), getSMRCLcmd2(), print(), and setDistance().