Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Path: blob/master/libraries/AP_CustomRotations/AP_CustomRotations.h
Views: 1798
/*1* This file is free software: you can redistribute it and/or modify it2* under the terms of the GNU General Public License as published by the3* Free Software Foundation, either version 3 of the License, or4* (at your option) any later version.5*6* This file is distributed in the hope that it will be useful, but7* WITHOUT ANY WARRANTY; without even the implied warranty of8* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.9* See the GNU General Public License for more details.10*11* You should have received a copy of the GNU General Public License along12* with this program. If not, see <http://www.gnu.org/licenses/>.13*/14#pragma once1516#include "AP_CustomRotations_config.h"1718#if AP_CUSTOMROTATIONS_ENABLED1920#include <AP_Param/AP_Param.h>21#include <AP_Math/AP_Math.h>2223#define NUM_CUST_ROT ROTATION_CUSTOM_END - ROTATION_CUSTOM_12425struct AP_CustomRotation_params {26public:27AP_CustomRotation_params();2829static const struct AP_Param::GroupInfo var_info[];3031AP_Float roll;32AP_Float pitch;33AP_Float yaw;34};3536class AP_CustomRotation {37public:38AP_CustomRotation(AP_CustomRotation_params &_params);3940void init();4142Quaternion q;43Matrix3f m;4445AP_CustomRotation_params ¶ms;46};4748class AP_CustomRotations {49public:50AP_CustomRotations();5152CLASS_NO_COPY(AP_CustomRotations);5354static AP_CustomRotations *get_singleton(void) { return singleton; }5556void init();5758void from_rotation(enum Rotation r, QuaternionD &q);59void from_rotation(enum Rotation r, Quaternion &q);6061void rotate(enum Rotation r, Vector3d& v);62void rotate(enum Rotation r, Vector3f& v);6364void convert(Rotation r, float roll, float pitch, float yaw);65void set(Rotation r, float roll, float pitch, float yaw);6667static const struct AP_Param::GroupInfo var_info[];6869private:7071AP_Int8 enable;7273AP_CustomRotation* get_rotation(Rotation r);7475AP_CustomRotation* rotations[NUM_CUST_ROT];7677AP_CustomRotation_params params[NUM_CUST_ROT];7879static AP_CustomRotations *singleton;80};8182namespace AP {83AP_CustomRotations &custom_rotations();84};858687#endif // AP_CUSTOMROTATIONS_ENABLED888990