ASCO Aerial Autonomy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
velocity_yaw.h
Go to the documentation of this file.
1 #pragma once
4 
10 struct VelocityYaw : public Velocity {
15  VelocityYaw() : Velocity(), yaw(0) {}
22  VelocityYaw(Velocity v, double yaw) : Velocity(v), yaw(yaw) {}
31  VelocityYaw(double x, double y, double z, double yaw)
32  : Velocity(x, y, z), yaw(yaw) {}
33  double yaw;
34 
42  bool operator==(const VelocityYaw &v) const {
43  return (Velocity::operator==(v) && yaw == v.yaw);
44  }
52  bool operator!=(const VelocityYaw &v) const { return !(*this == v); }
53 
61  VelocityYaw operator-(const VelocityYaw &v) const {
62  return VelocityYaw(this->x - v.x, this->y - v.y, this->z - v.z,
63  math::angleWrap(this->yaw - v.yaw));
64  }
65 };
double yaw
Orientation around global z axis.
Definition: velocity_yaw.h:33
VelocityYaw operator-(const VelocityYaw &v) const
Substract two velocity yaw entities.
Definition: velocity_yaw.h:61
VelocityYaw(Velocity v, double yaw)
Explicit constructor.
Definition: velocity_yaw.h:22
bool operator==(const VelocityYaw &v) const
Compare two velocityyaws.
Definition: velocity_yaw.h:42
double z
z component in m/s
Definition: velocity.h:21
VelocityYaw()
Implicit constructor Instantiates velocity and yaw to zero.
Definition: velocity_yaw.h:15
double x
x component in m/s
Definition: velocity.h:19
Store velocity and yaw Used as goal for builtin velocity and yaw controller for UAV system...
Definition: velocity_yaw.h:10
double angleWrap(double x)
Wrap an angle to be in the range [-pi, pi)
Definition: math.cpp:11
Store velocity vector.
Definition: velocity.h:5
double y
y component in m/s
Definition: velocity.h:20
bool operator!=(const VelocityYaw &v) const
Compare two velocityyaws.
Definition: velocity_yaw.h:52
VelocityYaw(double x, double y, double z, double yaw)
Explicit constructor.
Definition: velocity_yaw.h:31