1 #ifndef __JDETECTOR__JCOMPASS__
2 #define __JDETECTOR__JCOMPASS__
21 namespace JDETECTOR {}
22 namespace JPP {
using namespace JDETECTOR; }
124 this->
roll = atan2(-A1, -A2);
125 this->
pitch = atan2(A0, sqrt(A1*A1 + A2*A2));
147 this->
pitch = asin(+1.0);
149 this->
pitch = asin(-1.0);
151 this->
pitch = asin(sp);
164 return static_cast<const JCompass&
>(*this);
175 static_cast<JCompass&
>(*this) = compass;
192 return (Rz * Ry * Rx);
205 const double cy = cos(-0.5 *
yaw);
206 const double sy = sin(-0.5 *
yaw);
207 const double cp = cos(+0.5 *
pitch);
208 const double sp = sin(+0.5 *
pitch);
209 const double cr = cos(-0.5 *
roll);
210 const double sr = sin(-0.5 *
roll);
213 sr *
cp * cy - cr * sp * sy,
214 cr * sp * cy + sr *
cp * sy,
215 cr *
cp * sy - sr * sp * cy);
260 const double precision = std::numeric_limits<double>::min())
const
262 return (fabs(
getYaw() - compass.
getYaw()) <= precision &&
274 void correct(
const double declination,
const double meridian)
276 this->
yaw += declination;
277 this->
yaw -= meridian;
338 out << compass.
pitch;
bool equals(const JCompass &compass, const double precision=std::numeric_limits< double >::min()) const
Check equality.
Interface for binary output.
void correct(const double declination, const double meridian)
Correct compass for magnetic declination and meridian convergence angle.
double getB() const
Get b value.
JRotation3D getRotation() const
Get rotation matrix.
friend std::istream & operator>>(std::istream &in, JCompass &compass)
Read compasss from input.
JCompass()
Default constructor.
JCompass(const double yaw, const double pitch, const double roll)
Constructor.
friend std::ostream & operator<<(std::ostream &out, const JCompass &compass)
Write compasss to output.
JQuaternion3D getQuaternion() const
Get quaternion.
friend JReader & operator>>(JReader &in, JCompass &compass)
Read compasss from input.
double getRoll() const
Get roll compass.
double getYaw() const
Get yaw compass.
Template definition of auxiliary base class for comparison of data structures.
Data structure for compass in three dimensions.
const JCompass & getCompass() const
Get compass.
Interface for binary input.
double getD() const
Get d value.
Data structure for unit quaternion in three dimensions.
JCompass(const JAHRS &data, const JAHRSCalibration &calibration)
Constructor.
double getC() const
Get c value.
friend JWriter & operator<<(JWriter &out, const JCompass &compass)
Write compasss to output.
double getA() const
Get a value.
double getPitch() const
Get pitch compass.
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
void setCompass(const JCompass &compass)
Set compass.
JCompass(const JQuaternion3D &Q)
Constructor.