 |
AntiMicroX
|
Go to the documentation of this file.
25 #include <QElapsedTimer>
66 double offsetY,
bool gainYvalid,
double gainY);
69 static void stickRegression(
double *offset,
double *gain,
double xoffset,
double xmin,
double xmax);
void process(double x)
Processes a new sample of the current data stream and updates internal intermediate values.
Definition: statisticsestimator.cpp:36
@ CAL_STICK
Definition: calibration.h:48
void moved(float xaxis, float yaxis, float zaxis)
@ CAL_INDEX_POS
Definition: calibration.h:54
void startStickOffsetCalibration()
Shows user instructions for stick offset calibration, initializes estimators and connects stick data ...
Definition: calibration.cpp:717
JoySensor * getSensor(JoySensorType type) const
Definition: setjoystick.cpp:71
~Calibration()
Definition: calibration.cpp:98
size_t getCount() const
Gets the amount of processed samples.
Definition: statisticsestimator.h:37
@ CAL_GYROSCOPE
Definition: calibration.h:50
void getCalibration(double *offsetX, double *gainX, double *offsetY, double *gainY) const
Reads the calibration values of both stick axes.
Definition: joycontrolstick.cpp:946
Opens calibration window used for calibration.
Definition: calibration.h:40
int getDeadZone()
Get the assigned dead zone value.
Definition: joycontrolstick.cpp:192
bool isCalibrated() const
Check if the sensor is calibrated.
Definition: joysensor.cpp:530
Calibration(InputDevice *joystick, QDialog *parent=0)
Definition: calibration.cpp:38
CalibrationType m_type
Definition: calibration.h:73
void showSensorCalibrationValues(bool offsetXvalid, double offsetX, bool offsetYvalid, double offsetY, bool offsetZvalid, double offsetZ)
Shows the sensor offset calibration values to the user.
Definition: calibration.cpp:146
QElapsedTimer m_rate_timer
Definition: calibration.h:87
static void stickRegression(double *offset, double *gain, double xoffset, double xmin, double xmax)
Performs linear regression on the measurement values of one axis to determine offset and gain.
Definition: calibration.cpp:334
void onSensorOffsetData(float x, float y, float z)
Sensor data event handler. Performs gyroscope offset and accelerometer neutral orientation estimation...
Definition: calibration.cpp:432
JoyControlStick * m_stick
Definition: calibration.h:77
int m_phase
Definition: calibration.h:89
@ CAL_ACCELEROMETER
Definition: calibration.h:49
void startGyroscopeOffsetCalibration()
Show calibration message to the user and enable gyroscope data event handler.
Definition: calibration.cpp:699
static const int CAL_TIMEOUT
Definition: calibration.h:95
CalibrationType
Definition: calibration.h:45
bool askConfirmation(QString message, bool confirmed)
Asks the user for confirmation with a given message if the given condition is false.
Definition: calibration.cpp:377
void selectTypeIndex(unsigned int type_index)
Prepares calibration for the selected device type. Show all used values and labels and connect button...
Definition: calibration.cpp:221
Estimates mean of a data stream using Welford's algorithm and calculates statistic properties.
Definition: statisticsestimator.h:25
double process(double value)
Processes a new sample.
Definition: pt1filter.cpp:36
void moved(int xaxis, int yaxis)
void startAccelerometerAngleCalibration()
Show calibration message to the user and enable accelerometer data event handler.
Definition: calibration.cpp:650
void startAccelerometerCalibration()
Shows user instructions for accelerometer calibration and initializes estimators.
Definition: calibration.cpp:622
void resetSettings()
Asks for confirmation and resets calibration values of the selected device afterwards.
Definition: calibration.cpp:122
void startStickGainCalibration()
Shows user instructions for stick gain calibration, initializes estimators and connects stick data ev...
Definition: calibration.cpp:754
static const double STICK_CAL_TAU
Definition: calibration.h:93
@ CAL_INDEX_MASK
Definition: calibration.h:53
void deviceSelectionChanged(int index)
Device change event handler. Asks for confirmation if there are unsaved changes.
Definition: calibration.cpp:403
bool hasSensor(JoySensorType type) const
Checks if this set has a sensor.
Definition: setjoystick.cpp:253
void reset()
Resets the filter state to default.
Definition: pt1filter.cpp:45
static double radToDeg(double value)
Utility function which converts a given value from radians to degree.
Definition: joysensor.cpp:519
Definition: aboutdialog.h:26
PT1Filter m_filter[2]
Definition: calibration.h:84
unsigned int m_index
Definition: calibration.h:74
double m_last_slope[2]
Definition: calibration.h:85
bool isCalibrated() const
Check if the stick is calibrated.
Definition: joycontrolstick.cpp:928
bool m_changed
Definition: calibration.h:76
void resetCalibrationValues()
Resets calibration values of the currently selected device and updates UI.
Definition: calibration.cpp:351
QDateTime m_end_time
Definition: calibration.h:86
void saveSettings()
Save calibration values into the device object.
Definition: calibration.cpp:596
InputDevice * m_joystick
Definition: calibration.h:79
void resetCalibration()
Resets the calibration of the sensor back to uncalibrated state.
Definition: joysensor.cpp:535
static const double CAL_ACCURACY_SQ
Definition: calibration.h:92
virtual void getCalibration(double *offsetX, double *offsetY, double *offsetZ) const =0
static const int AXISMIN
Definition: globalvariables.h:117
static const int AXISMAX
Definition: globalvariables.h:118
void startGyroscopeCalibration()
Shows user instructions for gyroscope calibration and initializes estimators.
Definition: calibration.cpp:669
Represents stick of a joystick.
Definition: joycontrolstick.h:37
static const int CAL_MIN_SAMPLES
Definition: calibration.h:91
void hideCalibrationData()
hides all calibration values and their labels.
Definition: calibration.cpp:196
void showStickCalibrationValues(bool offsetXvalid, double offsetX, bool gainXvalid, double gainX, bool offsetYvalid, double offsetY, bool gainYvalid, double gainY)
Shows the stick offset and gain calibration values to the user.
Definition: calibration.cpp:174
void onStickOffsetData(int x, int y)
Stick data event handler. Performs stick offset estimation and stops itself if the value was found or...
Definition: calibration.cpp:474
Ui::Calibration * m_ui
Definition: calibration.h:72
StatisticsEstimator m_offset[3]
Definition: calibration.h:81
Represents one sensor in a SetJoystick and its connections to other parts of the application....
Definition: joysensor.h:39
double calculateRelativeErrorSq() const
Calculates the squared relative three sigma error range, i.e. the squared estimation accuracy in perc...
Definition: statisticsestimator.cpp:58
@ CAL_TYPE_MASK
Definition: calibration.h:52
Implementation of a first order lag or PT1 filter. Can be used for example to smooth noisy values a b...
Definition: pt1filter.h:25
double getValue() const
Get the current filter output value.
Definition: pt1filter.h:35
StatisticsEstimator m_max[2]
Definition: calibration.h:83
void reset()
Resets the StatisticsEstimator so that it is ready to process a new data stream.
Definition: statisticsestimator.cpp:25
@ GYROSCOPE
Definition: joysensortype.h:26
const QHash< int, JoyControlStick * > & getSticks() const
Definition: setjoystick.cpp:1107
int m_sample_count
Definition: calibration.h:88
void closeEvent(QCloseEvent *event) override
Ask for confirmation when the dialog is closed with unsafed changed.
Definition: calibration.cpp:103
void resetCalibration()
Resets the calibration of both stick axes back to uncalibrated state.
Definition: joycontrolstick.cpp:933
StatisticsEstimator m_min[2]
Definition: calibration.h:82
it is up to the author donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License If the distribution and or use of the Library is restricted in certain countries either by patents or by copyrighted the original copyright holder who places the Library under this License may add an geographical distribution limitation excluding those so that distribution is permitted only in or among countries not thus excluded In such this License incorporates the limitation as if written in the body of this License The Free Software Foundation may publish revised and or new versions of the Lesser General Public License from time to time Such new versions will be similar in spirit to the present but may differ in detail to address new problems or concerns Each version is given a distinguishing version number If the Library specifies a version number of this License which applies to it and any later you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation If the Library does not specify a license version number
Definition: lgpl-2.1.txt:423
bool m_calibrated
Definition: calibration.h:75
static const int STICK_RATE_SAMPLES
Definition: calibration.h:94
JoySensor * m_sensor
Definition: calibration.h:78
@ CAL_NONE
Definition: calibration.h:47
void onStickGainData(int x, int y)
Stick data event handler. Performs stick gain estimation and stops itself if the value was found or t...
Definition: calibration.cpp:539
@ ACCELEROMETER
Definition: joysensortype.h:25