00001 #include <limits>
00002
00003 #include "Crew/PilotRequest.h"
00004 #include "Motion/WaypointList.h"
00005
00006 namespace DualCoding {
00007
00008 PilotRequest::PilotRequest(PilotTypes::RequestType_t _type) :
00009 requestType(_type),
00010 dx(0), dy(0), da(0), forwardSpeed(0), strafeSpeed(0), turnSpeed(0), walkParameters(""),
00011 collisionAction(PilotTypes::collisionStop),
00012 waypointList(), clearWaypoints(false),
00013 landmarkExtractor(NULL), landmarkExitTest(NULL),
00014 searchObjectExtractor(NULL), searchExitTest(NULL), searchRotationAngle(0),
00015 targetShape(), baseOffset(), targetHeading(std::numeric_limits<float>::quiet_NaN()), gateLength(0),
00016 objectShape(), objectExtractor(NULL), objectMatcher(NULL),
00017 acquireExtractor(NULL), acquireTest(NULL),
00018 allowBackwardMotion(true), maxBackwardDistance(500.f),
00019 pathEditor(NULL), planEditor(NULL),
00020 obstacleInflation(3*25.4f),
00021 avoidCliffs(false), cliffThreshold(200), avoidObstacles(false), obstacleThreshold(100),
00022 trackRequest(NULL),
00023 displayParticles(50), displayIndividualParticles(0), displayPath(true), displayTree(false), displayObstacles(false), autoDisplayObstacles(true),
00024 maxRRTIterations(4000), executePath(true), landmarks(),
00025
00026
00027
00028
00029
00030 requestingBehavior(NULL), requestID(PilotTypes::invalid_Pilot_ID) {}
00031
00032 PilotRequest::PilotRequest(const PilotRequest &req) :
00033 requestType(req.requestType),
00034 dx(req.dx), dy(req.dy), da(req.da),
00035 forwardSpeed(req.forwardSpeed), strafeSpeed(req.strafeSpeed), turnSpeed(req.turnSpeed),
00036 walkParameters(req.walkParameters),
00037 collisionAction(req.collisionAction),
00038 waypointList(req.waypointList), clearWaypoints(req.clearWaypoints),
00039 landmarkExtractor(req.landmarkExtractor), landmarkExitTest(req.landmarkExitTest),
00040 searchObjectExtractor(req.searchObjectExtractor), searchExitTest(req.searchExitTest),
00041 searchRotationAngle(req.searchRotationAngle),
00042 targetShape(req.targetShape), baseOffset(req.baseOffset), targetHeading(req.targetHeading),
00043 gateLength(req.gateLength),
00044 objectShape(req.objectShape), objectExtractor(req.objectExtractor), objectMatcher(req.objectMatcher),
00045 acquireExtractor(req.acquireExtractor), acquireTest(req.acquireTest),
00046 allowBackwardMotion(req.allowBackwardMotion), maxBackwardDistance(req.maxBackwardDistance),
00047 pathEditor(req.pathEditor), planEditor(req.planEditor),
00048 obstacleInflation(req.obstacleInflation),
00049 avoidCliffs(req.avoidCliffs), cliffThreshold(req.cliffThreshold),
00050 avoidObstacles(req.avoidObstacles), obstacleThreshold(req.obstacleThreshold),
00051 trackRequest(req.trackRequest),
00052 displayParticles(req.displayParticles), displayIndividualParticles(req.displayIndividualParticles),
00053 displayPath(req.displayPath), displayTree(req.displayTree), displayObstacles(req.displayObstacles), autoDisplayObstacles(req.autoDisplayObstacles),
00054 maxRRTIterations(req.maxRRTIterations), executePath(req.executePath),landmarks(req.landmarks),
00055
00056
00057
00058
00059
00060 requestingBehavior(req.requestingBehavior), requestID(req.requestID) {}
00061
00062 PilotRequest& PilotRequest::operator=(const PilotRequest &other) {
00063 requestType = other.requestType;
00064 dx = other.dx;
00065 dy = other.dy;
00066 da = other.da;
00067 forwardSpeed = other.forwardSpeed;
00068 strafeSpeed = other.strafeSpeed;
00069 turnSpeed = other.turnSpeed;
00070 walkParameters = other.walkParameters;
00071 collisionAction = other.collisionAction;
00072 waypointList = other.waypointList;
00073 clearWaypoints = other.clearWaypoints;
00074 landmarkExtractor = other.landmarkExtractor;
00075 landmarkExitTest = other.landmarkExitTest;
00076 searchObjectExtractor = other.searchObjectExtractor;
00077 searchExitTest = other.searchExitTest;
00078 searchRotationAngle = other.searchRotationAngle;
00079 targetShape = other.targetShape;
00080 baseOffset = other.baseOffset;
00081 targetHeading = other.targetHeading;
00082 gateLength = other.gateLength;
00083 objectShape = other.objectShape;
00084 objectExtractor = other.objectExtractor;
00085 objectMatcher = other.objectMatcher;
00086 acquireExtractor = other.acquireExtractor;
00087 acquireTest = other.acquireTest;
00088 allowBackwardMotion = other.allowBackwardMotion;
00089 maxBackwardDistance = other.maxBackwardDistance;
00090 pathEditor = other.pathEditor;
00091 planEditor = other.planEditor;
00092 obstacleInflation = other.obstacleInflation;
00093 avoidCliffs = other.avoidCliffs;
00094 cliffThreshold = other.cliffThreshold;
00095 avoidObstacles = other.avoidObstacles;
00096 obstacleThreshold = other.obstacleThreshold;
00097 trackRequest = other.trackRequest;
00098 displayParticles = other.displayParticles;
00099 displayIndividualParticles = other.displayIndividualParticles;
00100 displayPath = other.displayPath;
00101 displayTree = other.displayTree;
00102 displayObstacles = other.displayObstacles;
00103 autoDisplayObstacles = other.autoDisplayObstacles;
00104 maxRRTIterations = other.maxRRTIterations;
00105 executePath = other.executePath;
00106 landmarks = other.landmarks;
00107 return *this;
00108 }
00109
00110 }