[10] | 1 | // %flair:license{
|
---|
[15] | 2 | // This file is part of the Flair framework distributed under the
|
---|
| 3 | // CECILL-C License, Version 1.0.
|
---|
[10] | 4 | // %flair:license}
|
---|
[7] | 5 | /*!
|
---|
| 6 | * \file MetaDualShock3.h
|
---|
| 7 | * \brief Classe intégrant la manette DualShock3 et les consignes joystick
|
---|
| 8 | * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
|
---|
| 9 | * \date 2014/01/14
|
---|
| 10 | * \version 3.4
|
---|
| 11 | */
|
---|
| 12 |
|
---|
| 13 | #ifndef METADUALSHOCK3_H
|
---|
| 14 | #define METADUALSHOCK3_H
|
---|
| 15 |
|
---|
[38] | 16 | #include <TargetController.h>
|
---|
| 17 | #include <IODevice.h>
|
---|
[7] | 18 |
|
---|
| 19 | namespace flair {
|
---|
[15] | 20 | namespace core {
|
---|
| 21 | class AhrsData;
|
---|
| 22 | class Quaternion;
|
---|
[7] | 23 | }
|
---|
[15] | 24 | namespace filter {
|
---|
| 25 | class Ahrs;
|
---|
| 26 | }
|
---|
| 27 | }
|
---|
[7] | 28 |
|
---|
| 29 | class MetaDualShock3_impl;
|
---|
| 30 |
|
---|
| 31 | namespace flair {
|
---|
| 32 | namespace meta {
|
---|
| 33 |
|
---|
[15] | 34 | /*! \class MetaDualShock3
|
---|
| 35 | *
|
---|
| 36 | * \brief Classe intégrant la manette MetaDualShock3
|
---|
| 37 | */
|
---|
[38] | 38 | class MetaDualShock3 : public core::IODevice {
|
---|
[15] | 39 | friend class ::MetaDualShock3_impl;
|
---|
[7] | 40 |
|
---|
[15] | 41 | public:
|
---|
[137] | 42 | MetaDualShock3(std::string name,
|
---|
[38] | 43 | sensor::TargetController *controller);
|
---|
[15] | 44 | ~MetaDualShock3();
|
---|
| 45 | core::AhrsData *GetReferenceOrientation(void) const;
|
---|
| 46 | float ZRef(void) const;
|
---|
| 47 | float DzRef(void) const;
|
---|
| 48 | void SetYawRef(float value);
|
---|
| 49 | /*!
|
---|
| 50 | * \brief Set yaw reference
|
---|
| 51 | *
|
---|
| 52 | * Yaw part of the output quaternion is obtained by integrating the wz desired
|
---|
| 53 | *angular speed.\n
|
---|
| 54 | * This method reset the yaw.
|
---|
| 55 | *
|
---|
| 56 | * \param value value, only the yaw part of the quaternion is used
|
---|
| 57 | */
|
---|
| 58 | void SetYawRef(core::Quaternion const &value);
|
---|
| 59 | void SetZRef(float value);
|
---|
| 60 | float RollTrim(void) const;
|
---|
| 61 | float PitchTrim(void) const;
|
---|
| 62 | void ErrorNotify(void);
|
---|
| 63 | void Rumble(uint8_t left_force, uint8_t left_timeout = 20,
|
---|
| 64 | uint8_t right_force = 0, uint8_t right_timeout = 0);
|
---|
| 65 | void SetLedON(unsigned int ledId);
|
---|
| 66 | void SetLedOFF(unsigned int ledId);
|
---|
| 67 | void FlashLed(unsigned int ledId, uint8_t on_timeout, uint8_t off_timeout);
|
---|
[7] | 68 |
|
---|
[38] | 69 | private:
|
---|
| 70 | class MetaDualShock3_impl* pimpl_;
|
---|
| 71 | void UpdateFrom(const flair::core::io_data *data);
|
---|
| 72 | sensor::TargetController *controller;
|
---|
| 73 | };
|
---|
[7] | 74 | } // end namespace meta
|
---|
| 75 | } // end namespace flair
|
---|
| 76 | #endif // METADUALSHOCK3_H
|
---|