77 std::cout <<
"UwPosEstimation::update, new informations are obslete"
99 double x = std::abs(x_ROV - x_wp);
100 double y = std::abs(y_ROV - y_wp);
101 double z = std::abs(z_ROV - z_wp);
102 double rho = sqrt(pow(x,2) + pow(y,2) + pow(z,2));
107 Position estimated_ROV_pos;
109 estimated_ROV_pos.setX(x_wp);
110 estimated_ROV_pos.setY(y_wp);
111 estimated_ROV_pos.setZ(z_wp);
112 return estimated_ROV_pos;
115 if (x == 0 && y == 0) {
116 estimated_ROV_pos.setX(x_ROV);
117 estimated_ROV_pos.setY(y_ROV);
118 estimated_ROV_pos.setZ(z_ROV + deltaT *
speed);
132 theta = atan(y/x) +
pi;
134 theta = atan(y/x) -
pi;
138 estimated_ROV_pos.setX(x_ROV + deltaT*
speed*sin(psi)*cos(theta));
139 estimated_ROV_pos.setY(y_ROV + deltaT*
speed*sin(psi)*sin(theta));
140 estimated_ROV_pos.setZ(z_ROV + deltaT*
speed*cos(psi));
142 return estimated_ROV_pos;
147 double x1 = p1.getX();
148 double y1 = p1.getY();
149 double z1 = p1.getZ();
150 double x2 = p2.getX();
151 double y2 = p2.getY();
152 double z2 = p2.getZ();
154 return sqrt(pow(x2-x1,2) + pow(y2-y1,2) + pow(z2-z1,2));
virtual void update(Position newInitPos, Position newDest, double newTime, double newSpeed)
Update initial position, destination, time of last update.
virtual ~UwPosEstimation()
Destructor of UwPosEstimation class.
virtual Position getDest()
Get destination of last update.
UwPosEstimation()
Constructor of UwPosEstimation class.
double speed
speed of the node.
virtual Position getInitPos()
Get itnitial position of last update.
Position destPos
Destination of last update.
Position initialPos
Initial position related to last update.
virtual double nodesDistance(Position &p1, Position &p2)
Compute absoulute distance between 2 nodes.
virtual Position getEstimatePos(double time)
Get position estimation at a given time.
virtual double getTimestamp()
Get time of last update.
virtual double getSpeed()
Get speed of the node.
double timestamp
time of last update.
Estimate position given initial point, end point and time.