40#ifndef UNDERWATER_WOSS_WAYPOINT_POSITION_H
41#define UNDERWATER_WOSS_WAYPOINT_POSITION_H
61 virtual int command(
int argc,
const char*
const* argv);
73 virtual double getSpeed();
85 WayPoint(
const woss::CoordZ& destination,
double speed = 0.0,
double time = HUGE_VAL,
int loop_id = INT_MAX,
int total_loops = 0 );
88 void setDestination(
const woss::CoordZ& dest ) { destination = dest; }
90 void setSpeed(
double s ) { speed = s; }
92 void setTimeToWait(
double t ) { time_to_wait = t; }
94 void setLoopId(
int id ) { loop_to_waypoint_id = id; }
96 void setTotalLoops(
int loops ) { total_loops = loops; }
99 const woss::CoordZ& getDestination()
const {
return destination; }
102 double getSpeed()
const {
return speed; }
104 double getTimeToWait()
const {
return time_to_wait; }
106 int getLoopId()
const {
return loop_to_waypoint_id; }
108 int getTotalLoops()
const {
return total_loops; }
111 bool isValid()
const {
return( destination.
isValid() && !( speed == 0.0 && time_to_wait == 0.0 ) ); }
113 bool hasToLoop()
const {
return( loop_to_waypoint_id != INT_MAX && total_loops != 0.0 ); }
115 bool hasToWait()
const {
return( speed == 0.0 && time_to_wait > 0 && time_to_wait != HUGE_VAL ); }
117 bool hasToStop()
const {
return( speed == 0.0 && time_to_wait == HUGE_VAL ); }
120 virtual double getTimeOfArrival(
const WayPoint& dest_waypoint )
const;
122 virtual woss::CoordZ getCurrentPosition(
const WayPoint& dest_waypoint,
double time_elapsed )
const;
125 friend std::ostream& operator<<( std::ostream& os,
const WayPoint& instance ) {
126 os << instance.destination <<
"; speed = " << instance.speed <<
"; time to wait = " << instance.time_to_wait
127 <<
"; loop id = " << instance.loop_to_waypoint_id <<
"; total loops = " << instance.total_loops;
140 int loop_to_waypoint_id;
147 typedef ::std::vector< WayPoint > WayPointVect;
149 typedef ::std::map< double, int > TimeIdMap;
150 typedef TimeIdMap::iterator TIMIter;
151 typedef TimeIdMap::reverse_iterator TIMRIter;
154 double time_threshold;
156 double last_time_update;
158 double current_speed;
160 WayPointVect waypoint_vect;
162 TimeIdMap timeid_map;
165 virtual void update(
double now );
172 virtual double addWayPoint(
const WayPoint& waypoint );
174 virtual double addLoopPoint(
const WayPoint& waypoint );
Definition uw-woss-position.h:48
Definition uw-woss-waypoint-position.h:79
Definition uw-woss-waypoint-position.h:50
virtual double getBearing()
Definition uw-woss-waypoint-position.cpp:341
virtual woss::CoordZ getLocation()
Definition uw-woss-waypoint-position.cpp:325
virtual bool isEquivalentTo(const woss::CoordZ &coordz)
Definition uw-woss-waypoint-position.cpp:209
virtual double getVerticalOrientation()
Definition uw-woss-waypoint-position.cpp:332
3D-Coordinates (lat, long, depth) class definitions and functions library
Definition coordinates-definitions.h:403
virtual bool isValid() const
Definition coordinates-definitions.h:645
Provides the interface for WossWpPosition class.