├── Calibration.pdf
├── Linux
├── RTIMULibGL
│ ├── VRWidgetLib
│ │ ├── Images
│ │ │ ├── BlueShade.png
│ │ │ ├── Compass.png
│ │ │ ├── RedShade.png
│ │ │ ├── GreenShade.png
│ │ │ └── CompassNeedle.png
│ │ ├── VRWidgetLib.qrc
│ │ ├── VRWidgetLib.sln
│ │ ├── VRWidgetLib.pri
│ │ └── VRIMUWidget.h
│ ├── QtGLLib
│ │ ├── QTGLLib.sln
│ │ ├── QtGLFlatShader.h
│ │ ├── QtGLADSShader.h
│ │ ├── QtGLTextureShader.h
│ │ ├── QtGLADSTextureShader.h
│ │ ├── QtGLPlaneComponent.h
│ │ ├── QtGLWireCubeComponent.h
│ │ ├── QtGLPlaneComponent.cpp
│ │ ├── QtGLLib.pri
│ │ ├── QtGLFlatShader.cpp
│ │ ├── QtGLWireCubeComponent.cpp
│ │ └── QtGLShader.h
│ ├── RTIMULibGL.pri
│ └── IMUView.h
├── RTIMULibvrpn
│ └── README.md
├── python
│ ├── tests
│ │ ├── Fusion.py
│ │ ├── InjectIMU.py
│ │ └── Fusion10.py
│ ├── PyRTHumidity.h
│ ├── PyRTPressure.h
│ ├── PyRTIMU.h
│ └── setup.py
├── RTIMULibCal
│ ├── README.md
│ └── CMakeLists.txt
├── RTIMULibDemo
│ ├── main.cpp
│ ├── RTIMULibDemo.pri
│ ├── RTIMULibDemo.pro
│ ├── SelectFusionDlg.h
│ ├── SelectIMUDlg.h
│ ├── CMakeLists.txt
│ └── SelectFusionDlg.cpp
├── RTIMULibDemoGL
│ ├── main.cpp
│ ├── RTIMULibDemoGL.pri
│ ├── SelectFusionDlg.h
│ ├── RTIMULibDemoGL.pro
│ └── SelectIMUDlg.h
├── RTIMULibDrive
│ └── CMakeLists.txt
├── RTIMULibDrive10
│ └── CMakeLists.txt
└── RTIMULibDrive11
│ └── CMakeLists.txt
├── RTHost
├── RTIMULibGL
│ ├── VRWidgetLib
│ │ ├── Images
│ │ │ ├── Compass.png
│ │ │ ├── RedShade.png
│ │ │ ├── BlueShade.png
│ │ │ ├── GreenShade.png
│ │ │ └── CompassNeedle.png
│ │ ├── VRWidgetLib.qrc
│ │ ├── VRWidgetLib.sln
│ │ ├── VRWidgetLib.pri
│ │ └── VRIMUWidget.h
│ ├── QtGLLib
│ │ ├── QTGLLib.sln
│ │ ├── QtGLFlatShader.h
│ │ ├── QtGLADSShader.h
│ │ ├── QtGLTextureShader.h
│ │ ├── QtGLADSTextureShader.h
│ │ ├── QtGLPlaneComponent.h
│ │ ├── QtGLWireCubeComponent.h
│ │ ├── QtGLPlaneComponent.cpp
│ │ ├── QtGLLib.pri
│ │ ├── QtGLFlatShader.cpp
│ │ ├── QtGLWireCubeComponent.cpp
│ │ └── QtGLShader.h
│ ├── RTIMULibGL.pri
│ └── IMUView.h
├── RTSerialPort
│ ├── config.pri
│ ├── common.pri
│ ├── buildlib
│ │ └── buildlib.pro
│ ├── Qextserialport.sln
│ ├── src
│ │ ├── qextserialport.pri
│ │ ├── qextserialenumerator.h
│ │ ├── qextserialport_global.h
│ │ └── qextwineventnotifier_p.h
│ └── README
├── RTHostIMU
│ ├── RTHostIMU.sln
│ ├── RTHostIMU.pri
│ ├── main.cpp
│ ├── RTHostIMU.pro
│ └── CMakeLists.txt
├── RTHostIMUGL
│ ├── RTHostIMUGL.pri
│ ├── main.cpp
│ └── RTHostIMUGL.pro
├── RTArduLinkHost
│ ├── RTArduLinkHost.pri
│ ├── CMakeLists.txt
│ ├── RTArduLinkUtils.h
│ └── RTArduLinkDemoDefs.h
└── RTHostIMUCommon
│ ├── RTHostIMUCommon.pri
│ ├── SelectFusionDlg.h
│ ├── RTArduLinkIMUDefs.h
│ ├── CMakeLists.txt
│ ├── RTHostIMUClient.h
│ └── RTHostIMUThread.h
├── RTIMULibVersion.txt
├── .gitignore
├── LICENSE
├── RTEllipsoidFit
├── mag_fit_display.m
├── ellipsoid_fit_license.txt
└── RTEllipsoidFit.m
└── RTIMULib
├── RTIMULIB LICENSE
├── IMUDrivers
├── RTIMUNull.cpp
├── RTIMUBNO055.h
├── RTPressureLPS25H.h
├── RTHumidity.cpp
├── RTHumidityHTU21D.h
├── RTIMUNull.h
├── RTHumidity.h
├── RTPressure.h
├── RTPressure.cpp
├── RTHumidityHTS221.h
├── RTPressureMS5611.h
└── RTPressureMS5637.h
├── RTIMULib.h
├── RTFusionRTQF.h
└── RTIMULibDefs.h
/Calibration.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RPi-Distro/RTIMULib/HEAD/Calibration.pdf
--------------------------------------------------------------------------------
/Linux/RTIMULibGL/VRWidgetLib/Images/BlueShade.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RPi-Distro/RTIMULib/HEAD/Linux/RTIMULibGL/VRWidgetLib/Images/BlueShade.png
--------------------------------------------------------------------------------
/Linux/RTIMULibGL/VRWidgetLib/Images/Compass.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RPi-Distro/RTIMULib/HEAD/Linux/RTIMULibGL/VRWidgetLib/Images/Compass.png
--------------------------------------------------------------------------------
/Linux/RTIMULibGL/VRWidgetLib/Images/RedShade.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RPi-Distro/RTIMULib/HEAD/Linux/RTIMULibGL/VRWidgetLib/Images/RedShade.png
--------------------------------------------------------------------------------
/RTHost/RTIMULibGL/VRWidgetLib/Images/Compass.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RPi-Distro/RTIMULib/HEAD/RTHost/RTIMULibGL/VRWidgetLib/Images/Compass.png
--------------------------------------------------------------------------------
/RTHost/RTIMULibGL/VRWidgetLib/Images/RedShade.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RPi-Distro/RTIMULib/HEAD/RTHost/RTIMULibGL/VRWidgetLib/Images/RedShade.png
--------------------------------------------------------------------------------
/Linux/RTIMULibGL/VRWidgetLib/Images/GreenShade.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RPi-Distro/RTIMULib/HEAD/Linux/RTIMULibGL/VRWidgetLib/Images/GreenShade.png
--------------------------------------------------------------------------------
/RTHost/RTIMULibGL/VRWidgetLib/Images/BlueShade.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RPi-Distro/RTIMULib/HEAD/RTHost/RTIMULibGL/VRWidgetLib/Images/BlueShade.png
--------------------------------------------------------------------------------
/RTHost/RTIMULibGL/VRWidgetLib/Images/GreenShade.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RPi-Distro/RTIMULib/HEAD/RTHost/RTIMULibGL/VRWidgetLib/Images/GreenShade.png
--------------------------------------------------------------------------------
/Linux/RTIMULibGL/VRWidgetLib/Images/CompassNeedle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RPi-Distro/RTIMULib/HEAD/Linux/RTIMULibGL/VRWidgetLib/Images/CompassNeedle.png
--------------------------------------------------------------------------------
/RTHost/RTIMULibGL/VRWidgetLib/Images/CompassNeedle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RPi-Distro/RTIMULib/HEAD/RTHost/RTIMULibGL/VRWidgetLib/Images/CompassNeedle.png
--------------------------------------------------------------------------------
/RTIMULibVersion.txt:
--------------------------------------------------------------------------------
1 | SET(RTIMULIB_VERSION_MAJOR 7)
2 | SET(RTIMULIB_VERSION_MINOR 2)
3 | SET(RTIMULIB_VERSION_PATCH 1)
4 | SET(RTIMULIB_VERSION
5 | ${RTIMULIB_VERSION_MAJOR}.${RTIMULIB_VERSION_MINOR}.${RTIMULIB_VERSION_PATCH})
6 |
7 |
--------------------------------------------------------------------------------
/Linux/RTIMULibGL/VRWidgetLib/VRWidgetLib.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 | Images/Compass.png
4 | Images/CompassNeedle.png
5 | Images/RedShade.png
6 | Images/BlueShade.png
7 | Images/GreenShade.png
8 |
9 |
10 |
--------------------------------------------------------------------------------
/RTHost/RTIMULibGL/VRWidgetLib/VRWidgetLib.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 | Images/Compass.png
4 | Images/CompassNeedle.png
5 | Images/RedShade.png
6 | Images/BlueShade.png
7 | Images/GreenShade.png
8 |
9 |
10 |
--------------------------------------------------------------------------------
/RTHost/RTSerialPort/config.pri:
--------------------------------------------------------------------------------
1 | # This is an example config.pri for building and using qextserialport.
2 | #
3 | # When using the qextserialport, all you need is to add following line
4 | # in your .pro file:
5 | # include(pathToQextserialport/src/qextserialport.pri)
6 | #
7 | # uncomment the following line if you want to use qextserialport as library
8 | #QEXTSERIALPORT_LIBRARY = yes
9 |
10 | # uncomment the following line too if you want to use it as static library
11 | #QEXTSERIALPORT_STATIC = yes
12 |
--------------------------------------------------------------------------------
/RTHost/RTSerialPort/common.pri:
--------------------------------------------------------------------------------
1 | infile(config.pri, QEXTSERIALPORT_LIBRARY, yes): CONFIG += qextserialport-library
2 | qextserialport-library{
3 | infile(config.pri, QEXTSERIALPORT_STATIC, yes): CONFIG += qextserialport-static
4 | }
5 | # Though maybe you have been fimiliar with "TEMPLATE += fakelib" and "TEMPLATE -= fakelib",
6 | # but it don't work when you using "qmake -tp XXX". So I use another variable Here.
7 | SAVE_TEMPLATE = $$TEMPLATE
8 | TEMPLATE = fakelib
9 | QEXTSERIALPORT_LIBNAME = $$qtLibraryTarget(qextserialport-1.2)
10 | TEMPLATE = $$SAVE_TEMPLATE
11 | QEXTSERIALPORT_LIBDIR = $$PWD/lib
12 | unix:qextserialport-library:!qextserialport-buildlib:QMAKE_RPATHDIR += $$QEXTSERIALPORT_LIBDIR
13 |
--------------------------------------------------------------------------------
/RTHost/RTSerialPort/buildlib/buildlib.pro:
--------------------------------------------------------------------------------
1 | TEMPLATE=lib
2 | CONFIG += qt qextserialport-buildlib
3 | # Include .pri file before using "qextserialport-static"
4 | # and after CONFIG += "qextserialport-buildlib"
5 | include(../src/qextserialport.pri)
6 | qextserialport-static:CONFIG += static
7 | else:CONFIG += dll
8 | mac:CONFIG += absolute_library_soname
9 | win32|mac:!wince*:!win32-msvc:!macx-xcode:CONFIG += debug_and_release build_all
10 | TARGET = $$QEXTSERIALPORT_LIBNAME
11 | DESTDIR = $$QEXTSERIALPORT_LIBDIR
12 | win32:!qextserialport-static{
13 | DLLDESTDIR = $$[QT_INSTALL_BINS]
14 | QMAKE_DISTCLEAN += $$[QT_INSTALL_BINS]\\$${QEXTSERIALPORT_LIBNAME}.dll
15 | }
16 | target.path = $$DESTDIR
17 | INSTALLS += target
18 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | Makefile*
2 | *.autosave
3 | *.opensdf
4 | *.pro.user
5 | *.cache
6 | Makefile*
7 | !Linux/RTIMULibDrive/Makefile
8 | !Linux/RTIMULibDrive10/Makefile
9 | !Linux/RTIMULibDrive11/Makefile
10 | !Linux/RTIMULibCal/Makefile
11 | !Linux/RTIMULibvrpn/Makefile
12 | build/
13 | debug/
14 | Debug/
15 | Release/
16 | ipch/
17 | release/
18 | objects/
19 | Output/
20 | GeneratedFiles/
21 | *.deps
22 | *.log.*
23 | *.exe
24 | *.lib
25 | *.ilk
26 | *.pdb
27 | *.log
28 | *.ncb
29 | *.user
30 | *.suo
31 | *.aps
32 | *.sdf
33 | *.obj
34 | *.msi
35 | *.pch
36 | *.ini
37 | *.srf
38 | *.srx
39 | *.dta
40 | *~
41 | *.a
42 | *.o
43 | *.axf
44 | *.bin
45 | *.map
46 | !.gitignore
47 | .metadata/
48 | *.dat
49 | *.tgz
50 | *.bz2
51 | *.pro.user*
52 | .DS_store
53 | octave-core
54 |
--------------------------------------------------------------------------------
/Linux/RTIMULibGL/VRWidgetLib/VRWidgetLib.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 11.00
3 | # Visual Studio 2010
4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "VRWidgetLib", "VRWidgetLib.vcxproj", "{183C43F1-DC99-467E-8364-AA7E69E8E1A8}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Win32 = Debug|Win32
9 | Release|Win32 = Release|Win32
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {183C43F1-DC99-467E-8364-AA7E69E8E1A8}.Debug|Win32.ActiveCfg = Debug|Win32
13 | {183C43F1-DC99-467E-8364-AA7E69E8E1A8}.Debug|Win32.Build.0 = Debug|Win32
14 | {183C43F1-DC99-467E-8364-AA7E69E8E1A8}.Release|Win32.ActiveCfg = Release|Win32
15 | {183C43F1-DC99-467E-8364-AA7E69E8E1A8}.Release|Win32.Build.0 = Release|Win32
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/RTHost/RTIMULibGL/VRWidgetLib/VRWidgetLib.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 11.00
3 | # Visual Studio 2010
4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "VRWidgetLib", "VRWidgetLib.vcxproj", "{183C43F1-DC99-467E-8364-AA7E69E8E1A8}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Win32 = Debug|Win32
9 | Release|Win32 = Release|Win32
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {183C43F1-DC99-467E-8364-AA7E69E8E1A8}.Debug|Win32.ActiveCfg = Debug|Win32
13 | {183C43F1-DC99-467E-8364-AA7E69E8E1A8}.Debug|Win32.Build.0 = Debug|Win32
14 | {183C43F1-DC99-467E-8364-AA7E69E8E1A8}.Release|Win32.ActiveCfg = Release|Win32
15 | {183C43F1-DC99-467E-8364-AA7E69E8E1A8}.Release|Win32.Build.0 = Release|Win32
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/RTHost/RTSerialPort/Qextserialport.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 11.00
3 | # Visual Studio 2010
4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Qextserialport", "Qextserialport.vcxproj", "{FD99181C-B9C8-46FA-A071-F0ABEFFADF75}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Win32 = Debug|Win32
9 | Release|Win32 = Release|Win32
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {FD99181C-B9C8-46FA-A071-F0ABEFFADF75}.Debug|Win32.ActiveCfg = Debug|Win32
13 | {FD99181C-B9C8-46FA-A071-F0ABEFFADF75}.Debug|Win32.Build.0 = Debug|Win32
14 | {FD99181C-B9C8-46FA-A071-F0ABEFFADF75}.Release|Win32.ActiveCfg = Release|Win32
15 | {FD99181C-B9C8-46FA-A071-F0ABEFFADF75}.Release|Win32.Build.0 = Release|Win32
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/RTHost/RTHostIMU/RTHostIMU.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 11.00
3 | # Visual Studio 2010
4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RTHostIMU", "RTHostIMU.vcxproj", "{CA859603-52C2-46FE-9535-24D89853619B}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Win32 = Debug|Win32
9 | Release|Win32 = Release|Win32
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {CA859603-52C2-46FE-9535-24D89853619B}.Debug|Win32.ActiveCfg = Debug|Win32
13 | {CA859603-52C2-46FE-9535-24D89853619B}.Debug|Win32.Build.0 = Debug|Win32
14 | {CA859603-52C2-46FE-9535-24D89853619B}.Release|Win32.ActiveCfg = Release|Win32
15 | {CA859603-52C2-46FE-9535-24D89853619B}.Release|Win32.Build.0 = Release|Win32
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | GlobalSection(ExtensibilityGlobals) = postSolution
21 | Qt5Version = $(DefaultQtVersion)
22 | EndGlobalSection
23 | EndGlobal
24 |
--------------------------------------------------------------------------------
/Linux/RTIMULibvrpn/README.md:
--------------------------------------------------------------------------------
1 | # RTIMULibvrpn - RTIMULib with vrpn integration
2 |
3 | RTIMULibvrpn shows how to integrate RTIMULib with vrpn (http://www.cs.unc.edu/Research/vrpn/). The integration code was generously supplied by Lucas Matias Angarola (lucasangarola@gmail.com).
4 |
5 | ### Setting up vrpn
6 |
7 | Download vrpn from:
8 |
9 | http://www.cs.unc.edu/Research/vrpn/downloads/
10 |
11 | Unzip the file into some directory. Navigate to that directory and enter:
12 |
13 | mkdir build
14 | cd build
15 | cmake ..
16 | make
17 | sudo make install
18 |
19 | This will create and install the vrpn libraries.
20 |
21 | ### Build and run RTIMULibvrpn
22 |
23 | Navigate to the RTIMULibvrpn directory and enter:
24 |
25 | make
26 | sudo make install
27 | RTIMULibvrpn
28 |
29 | This will start the vrpn and RTIMULib. To view the output, enter:
30 |
31 | .//client_src/vrpn_print_devices Tracker0@
32 |
33 | where is the directory where vrpn was built and is the address of the system running RTIMULibvrpn. If this is run on the same machine, then:
34 |
35 | .//client_src/vrpn_print_devices Tracker0@localhost
36 |
37 | works fine.
38 |
39 |
--------------------------------------------------------------------------------
/Linux/python/tests/Fusion.py:
--------------------------------------------------------------------------------
1 | import sys, getopt
2 |
3 | sys.path.append('.')
4 | import RTIMU
5 | import os.path
6 | import time
7 | import math
8 |
9 | SETTINGS_FILE = "RTIMULib"
10 |
11 | print("Using settings file " + SETTINGS_FILE + ".ini")
12 | if not os.path.exists(SETTINGS_FILE + ".ini"):
13 | print("Settings file does not exist, will be created")
14 |
15 | s = RTIMU.Settings(SETTINGS_FILE)
16 | imu = RTIMU.RTIMU(s)
17 |
18 | print("IMU Name: " + imu.IMUName())
19 |
20 | if (not imu.IMUInit()):
21 | print("IMU Init Failed")
22 | sys.exit(1)
23 | else:
24 | print("IMU Init Succeeded")
25 |
26 | # this is a good time to set any fusion parameters
27 |
28 | imu.setSlerpPower(0.02)
29 | imu.setGyroEnable(True)
30 | imu.setAccelEnable(True)
31 | imu.setCompassEnable(True)
32 |
33 | poll_interval = imu.IMUGetPollInterval()
34 | print("Recommended Poll Interval: %dmS\n" % poll_interval)
35 |
36 | while True:
37 | if imu.IMURead():
38 | # x, y, z = imu.getFusionData()
39 | # print("%f %f %f" % (x,y,z))
40 | data = imu.getIMUData()
41 | fusionPose = data["fusionPose"]
42 | print("r: %f p: %f y: %f" % (math.degrees(fusionPose[0]),
43 | math.degrees(fusionPose[1]), math.degrees(fusionPose[2])))
44 | time.sleep(poll_interval*1.0/1000.0)
45 |
46 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014-2015, richards-tech, LLC
6 | //
7 | // Permission is hereby granted, free of charge,
8 | // to any person obtaining a copy of
9 | // this software and associated documentation files
10 | // (the "Software"), to deal in the Software without
11 | // restriction, including without limitation the rights
12 | // to use, copy, modify, merge, publish, distribute,
13 | // sublicense, and/or sell copies of the Software, and
14 | // to permit persons to whom the Software is furnished
15 | // to do so, subject to the following conditions:
16 | //
17 | // The above copyright notice and this permission notice
18 | // shall be included in all copies or substantial portions
19 | // of the Software.
20 | //
21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
22 | // ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
23 | // TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
24 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
25 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
26 | // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
28 | // IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29 | // DEALINGS IN THE SOFTWARE.
30 |
--------------------------------------------------------------------------------
/RTEllipsoidFit/mag_fit_display.m:
--------------------------------------------------------------------------------
1 | %//
2 | %// Copyright (c) 2014, richards-tech
3 | %//
4 | %// This file is part of RTEllipsoidFit
5 | %//
6 | %// RTEllipsoidFit is free software: you can redistribute it and/or modify
7 | %// it under the terms of the GNU General Public License as published by
8 | %// the Free Software Foundation, either version 3 of the License, or
9 | %// (at your option) any later version.
10 | %//
11 | %// RTEllipsoidFit is distributed in the hope that it will be useful,
12 | %// but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | %// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | %// GNU General Public License for more details.
15 | %//
16 | %// You should have received a copy of the GNU General Public License
17 | %// along with RTEllipsoidFit. If not, see .
18 | %//
19 |
20 | function mag_fit_display(x, y, z, center, radii, v, xCorr, yCorr, zCorr)
21 |
22 | displayRadius = 100;
23 |
24 | figure(1);
25 | hold on;
26 |
27 | grid;
28 | xlabel('x');
29 | ylabel('y');
30 | zlabel('z');
31 | axis ([-displayRadius, displayRadius, -displayRadius, displayRadius, -displayRadius, displayRadius], "square");
32 | title('Uncorrected samples (red) and corrected (blue) values');
33 | plot3( x, y, z, ['.' 'r'] );
34 | plot3( xCorr, yCorr, zCorr, ['.' 'b'] );
35 |
36 | % display immediately
37 |
38 | drawnow();
39 |
40 | end
41 |
--------------------------------------------------------------------------------
/Linux/python/tests/InjectIMU.py:
--------------------------------------------------------------------------------
1 | import sys, getopt
2 |
3 | sys.path.append('.')
4 | import RTIMU
5 | import os.path
6 | import time
7 | import math
8 |
9 | # Note: timestamp is in microseconds
10 |
11 | timestamp = 0
12 |
13 | SETTINGS_FILE = "RTIMULib"
14 |
15 | print("Using settings file " + SETTINGS_FILE + ".ini")
16 | if not os.path.exists(SETTINGS_FILE + ".ini"):
17 | print("Settings file does not exist, will be created")
18 |
19 | s = RTIMU.Settings(SETTINGS_FILE)
20 | imu = RTIMU.RTIMU(s)
21 | imu.IMUInit()
22 |
23 | print("IMU Name: " + imu.IMUName())
24 |
25 | # set some gyro rate here to test (units: rads/s)
26 |
27 | gx = 0.0
28 | gy = 0.0
29 | gz = 0.1
30 |
31 | # set accel to indicate horizontal (units: g)
32 |
33 | ax = 0.0
34 | ay = 0.0
35 | az = 1.0
36 |
37 | # set mag to whatever (or leave as 0 if turned off) (units: uT)
38 |
39 | mx = 0.0
40 | my = 0.0
41 | mz = 0.0
42 |
43 | # this is how to turn off the magnetometer
44 |
45 | imu.setCompassEnable(False)
46 |
47 | # everything is now ready
48 |
49 | while True:
50 | print("gz: %f" % gz)
51 | imu.setExtIMUData(gx, gy, gz, ax, ay, az, mx, my, mz, timestamp)
52 | data = imu.getIMUData()
53 | fusionPose = data["fusionPose"]
54 | print("r: %f p: %f y: %f" % (math.degrees(fusionPose[0]),
55 | math.degrees(fusionPose[1]), math.degrees(fusionPose[2])))
56 | time.sleep(0.1)
57 | timestamp += 100000
58 |
59 |
--------------------------------------------------------------------------------
/Linux/RTIMULibGL/QtGLLib/QTGLLib.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 11.00
3 | # Visual Studio 2010
4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "QTGLLib", "QTGLLib.vcxproj", "{88277939-80B3-4156-9CD7-D2DE7A339BFB}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Win32 = Debug|Win32
9 | Release|Win32 = Release|Win32
10 | StaticDebug|Win32 = StaticDebug|Win32
11 | StaticRelease|Win32 = StaticRelease|Win32
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {88277939-80B3-4156-9CD7-D2DE7A339BFB}.Debug|Win32.ActiveCfg = Debug|Win32
15 | {88277939-80B3-4156-9CD7-D2DE7A339BFB}.Debug|Win32.Build.0 = Debug|Win32
16 | {88277939-80B3-4156-9CD7-D2DE7A339BFB}.Release|Win32.ActiveCfg = Release|Win32
17 | {88277939-80B3-4156-9CD7-D2DE7A339BFB}.Release|Win32.Build.0 = Release|Win32
18 | {88277939-80B3-4156-9CD7-D2DE7A339BFB}.StaticDebug|Win32.ActiveCfg = StaticDebug|Win32
19 | {88277939-80B3-4156-9CD7-D2DE7A339BFB}.StaticDebug|Win32.Build.0 = StaticDebug|Win32
20 | {88277939-80B3-4156-9CD7-D2DE7A339BFB}.StaticRelease|Win32.ActiveCfg = StaticRelease|Win32
21 | {88277939-80B3-4156-9CD7-D2DE7A339BFB}.StaticRelease|Win32.Build.0 = StaticRelease|Win32
22 | EndGlobalSection
23 | GlobalSection(SolutionProperties) = preSolution
24 | HideSolutionNode = FALSE
25 | EndGlobalSection
26 | EndGlobal
27 |
--------------------------------------------------------------------------------
/RTEllipsoidFit/ellipsoid_fit_license.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) 2009, Yury Petrov
2 | All rights reserved.
3 |
4 | Redistribution and use in source and binary forms, with or without
5 | modification, are permitted provided that the following conditions are
6 | met:
7 |
8 | * Redistributions of source code must retain the above copyright
9 | notice, this list of conditions and the following disclaimer.
10 | * Redistributions in binary form must reproduce the above copyright
11 | notice, this list of conditions and the following disclaimer in
12 | the documentation and/or other materials provided with the distribution
13 |
14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
18 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24 | POSSIBILITY OF SUCH DAMAGE.
25 |
--------------------------------------------------------------------------------
/RTHost/RTIMULibGL/QtGLLib/QTGLLib.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 11.00
3 | # Visual Studio 2010
4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "QTGLLib", "QTGLLib.vcxproj", "{88277939-80B3-4156-9CD7-D2DE7A339BFB}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Win32 = Debug|Win32
9 | Release|Win32 = Release|Win32
10 | StaticDebug|Win32 = StaticDebug|Win32
11 | StaticRelease|Win32 = StaticRelease|Win32
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {88277939-80B3-4156-9CD7-D2DE7A339BFB}.Debug|Win32.ActiveCfg = Debug|Win32
15 | {88277939-80B3-4156-9CD7-D2DE7A339BFB}.Debug|Win32.Build.0 = Debug|Win32
16 | {88277939-80B3-4156-9CD7-D2DE7A339BFB}.Release|Win32.ActiveCfg = Release|Win32
17 | {88277939-80B3-4156-9CD7-D2DE7A339BFB}.Release|Win32.Build.0 = Release|Win32
18 | {88277939-80B3-4156-9CD7-D2DE7A339BFB}.StaticDebug|Win32.ActiveCfg = StaticDebug|Win32
19 | {88277939-80B3-4156-9CD7-D2DE7A339BFB}.StaticDebug|Win32.Build.0 = StaticDebug|Win32
20 | {88277939-80B3-4156-9CD7-D2DE7A339BFB}.StaticRelease|Win32.ActiveCfg = StaticRelease|Win32
21 | {88277939-80B3-4156-9CD7-D2DE7A339BFB}.StaticRelease|Win32.Build.0 = StaticRelease|Win32
22 | EndGlobalSection
23 | GlobalSection(SolutionProperties) = preSolution
24 | HideSolutionNode = FALSE
25 | EndGlobalSection
26 | EndGlobal
27 |
--------------------------------------------------------------------------------
/RTIMULib/RTIMULIB LICENSE:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014-2015, richards-tech, LLC
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | // this software and associated documentation files (the "Software"), to deal in
9 | // the Software without restriction, including without limitation the rights to use,
10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | // Software, and to permit persons to whom the Software is furnished to do so,
12 | // subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | // The MPU-9250 and SPI driver code is based on code generously supplied by
25 | // staslock@gmail.com (www.clickdrive.io)
26 |
27 |
--------------------------------------------------------------------------------
/RTHost/RTHostIMU/RTHostIMU.pri:
--------------------------------------------------------------------------------
1 | #////////////////////////////////////////////////////////////////////////////
2 | #//
3 | #// This file is part of RTIMULib
4 | #//
5 | #// Copyright (c) 2014, richards-tech
6 | #//
7 | #// Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | #// this software and associated documentation files (the "Software"), to deal in
9 | #// the Software without restriction, including without limitation the rights to use,
10 | #// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | #// Software, and to permit persons to whom the Software is furnished to do so,
12 | #// subject to the following conditions:
13 | #//
14 | #// The above copyright notice and this permission notice shall be included in all
15 | #// copies or substantial portions of the Software.
16 | #//
17 | #// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | #// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | #// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | #// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | #// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | #// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 |
25 | INCLUDEPATH += $$PWD
26 | DEPENDPATH += $$PWD
27 |
28 | HEADERS += RTHostIMU.h
29 |
30 | SOURCES += main.cpp \
31 | RTHostIMU.cpp \
32 |
33 | FORMS += RTHostIMU.ui
34 |
35 |
--------------------------------------------------------------------------------
/RTHost/RTHostIMUGL/RTHostIMUGL.pri:
--------------------------------------------------------------------------------
1 | #////////////////////////////////////////////////////////////////////////////
2 | #//
3 | #// This file is part of RTIMULib
4 | #//
5 | #// Copyright (c) 2014, richards-tech
6 | #//
7 | #// Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | #// this software and associated documentation files (the "Software"), to deal in
9 | #// the Software without restriction, including without limitation the rights to use,
10 | #// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | #// Software, and to permit persons to whom the Software is furnished to do so,
12 | #// subject to the following conditions:
13 | #//
14 | #// The above copyright notice and this permission notice shall be included in all
15 | #// copies or substantial portions of the Software.
16 | #//
17 | #// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | #// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | #// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | #// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | #// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | #// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | INCLUDEPATH += $$PWD
25 | DEPENDPATH += $$PWD
26 |
27 | HEADERS += \
28 | RTHostIMUGL.h \
29 |
30 | SOURCES += main.cpp \
31 | RTHostIMUGL.cpp \
32 |
33 | FORMS += RTHostIMUGL.ui
34 |
35 |
--------------------------------------------------------------------------------
/Linux/RTIMULibGL/RTIMULibGL.pri:
--------------------------------------------------------------------------------
1 | #////////////////////////////////////////////////////////////////////////////
2 | #//
3 | #// This file is part of RTIMULib
4 | #//
5 | #// Copyright (c) 2014, richards-tech
6 | #//
7 | #// Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | #// this software and associated documentation files (the "Software"), to deal in
9 | #// the Software without restriction, including without limitation the rights to use,
10 | #// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | #// Software, and to permit persons to whom the Software is furnished to do so,
12 | #// subject to the following conditions:
13 | #//
14 | #// The above copyright notice and this permission notice shall be included in all
15 | #// copies or substantial portions of the Software.
16 | #//
17 | #// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | #// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | #// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | #// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | #// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | #// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | INCLUDEPATH += $$PWD
25 | DEPENDPATH += $$PWD
26 |
27 | include(QtGLLib/QtGLLib.pri)
28 | include(VRWidgetLib/VRWidgetLib.pri)
29 |
30 | HEADERS += $$PWD/IMUView.h
31 |
32 | SOURCES += $$PWD/IMUView.cpp
33 |
34 |
--------------------------------------------------------------------------------
/RTHost/RTIMULibGL/RTIMULibGL.pri:
--------------------------------------------------------------------------------
1 | #////////////////////////////////////////////////////////////////////////////
2 | #//
3 | #// This file is part of RTIMULib
4 | #//
5 | #// Copyright (c) 2014, richards-tech
6 | #//
7 | #// Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | #// this software and associated documentation files (the "Software"), to deal in
9 | #// the Software without restriction, including without limitation the rights to use,
10 | #// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | #// Software, and to permit persons to whom the Software is furnished to do so,
12 | #// subject to the following conditions:
13 | #//
14 | #// The above copyright notice and this permission notice shall be included in all
15 | #// copies or substantial portions of the Software.
16 | #//
17 | #// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | #// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | #// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | #// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | #// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | #// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | INCLUDEPATH += $$PWD
25 | DEPENDPATH += $$PWD
26 |
27 | include(QtGLLib/QtGLLib.pri)
28 | include(VRWidgetLib/VRWidgetLib.pri)
29 |
30 | HEADERS += $$PWD/IMUView.h
31 |
32 | SOURCES += $$PWD/IMUView.cpp
33 |
34 |
--------------------------------------------------------------------------------
/Linux/RTIMULibGL/VRWidgetLib/VRWidgetLib.pri:
--------------------------------------------------------------------------------
1 | #////////////////////////////////////////////////////////////////////////////
2 | #//
3 | #// This file is part of RTIMULib
4 | #//
5 | #// Copyright (c) 2014, richards-tech
6 | #//
7 | #// Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | #// this software and associated documentation files (the "Software"), to deal in
9 | #// the Software without restriction, including without limitation the rights to use,
10 | #// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | #// Software, and to permit persons to whom the Software is furnished to do so,
12 | #// subject to the following conditions:
13 | #//
14 | #// The above copyright notice and this permission notice shall be included in all
15 | #// copies or substantial portions of the Software.
16 | #//
17 | #// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | #// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | #// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | #// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | #// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | #// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | INCLUDEPATH += $$PWD
25 | DEPENDPATH += $$PWD
26 |
27 | HEADERS += $$PWD/VRWidget.h \
28 | $$PWD/VRIMUWidget.h
29 |
30 | SOURCES += $$PWD/VRWidget.cpp \
31 | $$PWD/VRIMUWidget.cpp
32 |
33 | RESOURCES += $$PWD/VRWidgetLib.qrc
34 |
35 |
--------------------------------------------------------------------------------
/RTHost/RTIMULibGL/VRWidgetLib/VRWidgetLib.pri:
--------------------------------------------------------------------------------
1 | #////////////////////////////////////////////////////////////////////////////
2 | #//
3 | #// This file is part of RTIMULib
4 | #//
5 | #// Copyright (c) 2014, richards-tech
6 | #//
7 | #// Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | #// this software and associated documentation files (the "Software"), to deal in
9 | #// the Software without restriction, including without limitation the rights to use,
10 | #// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | #// Software, and to permit persons to whom the Software is furnished to do so,
12 | #// subject to the following conditions:
13 | #//
14 | #// The above copyright notice and this permission notice shall be included in all
15 | #// copies or substantial portions of the Software.
16 | #//
17 | #// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | #// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | #// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | #// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | #// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | #// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | INCLUDEPATH += $$PWD
25 | DEPENDPATH += $$PWD
26 |
27 | HEADERS += $$PWD/VRWidget.h \
28 | $$PWD/VRIMUWidget.h
29 |
30 | SOURCES += $$PWD/VRWidget.cpp \
31 | $$PWD/VRIMUWidget.cpp
32 |
33 | RESOURCES += $$PWD/VRWidgetLib.qrc
34 |
35 |
--------------------------------------------------------------------------------
/Linux/RTIMULibCal/README.md:
--------------------------------------------------------------------------------
1 | # RTIMULibCal - a command line program to generate calibration data
2 |
3 | It is essential to calibrate the IMU's magnetometer (at the very least) or else very poor results will be obtained. In a non-GUI environment, use RTIMULibCal. RTIMULibCal has minimal pre-requisites so should be usable on any system that is capable of compiling and running RTIMULibDrive. Ellipsoid fit requires octave to be available. If it isn't, only min/max calibration will be available.
4 |
5 | ### Build
6 |
7 | Install cmake if not already there:
8 |
9 | sudo apt-get install cmake
10 |
11 | Navigate to the RTIMULibCal directory and run:
12 |
13 |
14 | make
15 | sudo make install
16 |
17 | ### Usage
18 |
19 | RTIMULibCal can either add calibration data to an existing RTIMULib.ini or else create a new one with the calibration data. RTIMULib.ini is used/created in the working directory.
20 |
21 | If magnetometer ellipsoid fit isn't required, RTIMULibCal can be run anywhere. If ellipsoid fit is required, then the program assumes that the RTEllipsoidFit directory is at the same level as the working directory so that "../RTEllipsoidFit" refers to the directory holding the RTEllipsoidFit.m octave program. If not, ellipsoid fitting will fail.
22 |
23 | The normal process is to run the magnetometer min/max option followed by the magnetometer ellipsoid fit option followed finally by the accelerometer min/max option. The program is self-documenting in that the instructions for every option will be displayed when the option is selected.
24 |
25 | The resulting RTIMULib.ini can then be used by any other RTIMULib application.
26 |
--------------------------------------------------------------------------------
/RTHost/RTHostIMU/main.cpp:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014, richards-tech
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | // this software and associated documentation files (the "Software"), to deal in
9 | // the Software without restriction, including without limitation the rights to use,
10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | // Software, and to permit persons to whom the Software is furnished to do so,
12 | // subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 |
25 | #include "RTHostIMU.h"
26 |
27 | #include
28 |
29 | // This is standard Qt startup
30 |
31 | int main(int argc, char *argv[])
32 | {
33 | QApplication a(argc, argv);
34 |
35 | RTHostIMU *w = new RTHostIMU();
36 |
37 | w->show();
38 |
39 | return a.exec();
40 | }
41 |
42 |
--------------------------------------------------------------------------------
/RTHost/RTHostIMUGL/main.cpp:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014, richards-tech
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | // this software and associated documentation files (the "Software"), to deal in
9 | // the Software without restriction, including without limitation the rights to use,
10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | // Software, and to permit persons to whom the Software is furnished to do so,
12 | // subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #include "RTHostIMUGL.h"
25 |
26 | #include
27 |
28 | // This is standard Qt startup
29 |
30 | int main(int argc, char *argv[])
31 | {
32 | QApplication a(argc, argv);
33 |
34 | RTHostIMUGL *w = new RTHostIMUGL();
35 |
36 | w->show();
37 |
38 | return a.exec();
39 | }
40 |
41 |
--------------------------------------------------------------------------------
/Linux/RTIMULibDemo/main.cpp:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014-2015, richards-tech, LLC
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | // this software and associated documentation files (the "Software"), to deal in
9 | // the Software without restriction, including without limitation the rights to use,
10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | // Software, and to permit persons to whom the Software is furnished to do so,
12 | // subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #include "RTIMULibDemo.h"
25 |
26 | #include
27 |
28 | // This is standard Qt startup
29 |
30 | int main(int argc, char *argv[])
31 | {
32 | QApplication a(argc, argv);
33 |
34 | RTIMULibDemo *w = new RTIMULibDemo();
35 |
36 | w->show();
37 |
38 | return a.exec();
39 | }
40 |
41 |
--------------------------------------------------------------------------------
/Linux/RTIMULibDemoGL/main.cpp:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014-2015, richards-tech, LLC
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | // this software and associated documentation files (the "Software"), to deal in
9 | // the Software without restriction, including without limitation the rights to use,
10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | // Software, and to permit persons to whom the Software is furnished to do so,
12 | // subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #include "RTIMULibDemoGL.h"
25 |
26 | #include
27 |
28 | // This is standard Qt startup
29 |
30 | int main(int argc, char *argv[])
31 | {
32 | QApplication a(argc, argv);
33 |
34 | RTIMULibDemoGL *w = new RTIMULibDemoGL();
35 |
36 | w->show();
37 |
38 | return a.exec();
39 | }
40 |
41 |
--------------------------------------------------------------------------------
/Linux/RTIMULibGL/QtGLLib/QtGLFlatShader.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014, richards-tech
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | // this software and associated documentation files (the "Software"), to deal in
9 | // the Software without restriction, including without limitation the rights to use,
10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | // Software, and to permit persons to whom the Software is furnished to do so,
12 | // subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #ifndef QTGLFLATSHADER_H
25 | #define QTGLFLATSHADER_H
26 |
27 | class QtGLFlatShader : public QtGLShader
28 | {
29 | public:
30 | QtGLFlatShader(QObject *parent);
31 | ~QtGLFlatShader();
32 |
33 | void load(const QVector3D *vertices, const QColor& color);
34 |
35 | private:
36 |
37 | };
38 |
39 | #endif // QTGLFLATSHADER_H
40 |
--------------------------------------------------------------------------------
/RTHost/RTIMULibGL/QtGLLib/QtGLFlatShader.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014, richards-tech
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | // this software and associated documentation files (the "Software"), to deal in
9 | // the Software without restriction, including without limitation the rights to use,
10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | // Software, and to permit persons to whom the Software is furnished to do so,
12 | // subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #ifndef QTGLFLATSHADER_H
25 | #define QTGLFLATSHADER_H
26 |
27 | class QtGLFlatShader : public QtGLShader
28 | {
29 | public:
30 | QtGLFlatShader(QObject *parent);
31 | ~QtGLFlatShader();
32 |
33 | void load(const QVector3D *vertices, const QColor& color);
34 |
35 | private:
36 |
37 | };
38 |
39 | #endif // QTGLFLATSHADER_H
40 |
--------------------------------------------------------------------------------
/Linux/python/PyRTHumidity.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014, avishorp
6 | // Copyright (c) 2014, richards-tech
7 | //
8 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
9 | // this software and associated documentation files (the "Software"), to deal in
10 | // the Software without restriction, including without limitation the rights to use,
11 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
12 | // Software, and to permit persons to whom the Software is furnished to do so,
13 | // subject to the following conditions:
14 | //
15 | // The above copyright notice and this permission notice shall be included in all
16 | // copies or substantial portions of the Software.
17 | //
18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
19 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
20 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
21 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
22 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 |
25 | // Python binding for RTIMULib
26 |
27 | #include
28 | #include "structmember.h"
29 | #include "RTIMULib.h"
30 |
31 | // RTHumidity Type
32 | struct RTIMU_RTHumidity {
33 | PyObject_HEAD
34 | RTHumidity* val;
35 | };
36 |
37 | // Create the RTHumidity type
38 | int RTIMU_RTHumidity_create(PyObject* module);
39 |
40 |
--------------------------------------------------------------------------------
/Linux/python/PyRTPressure.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014, avishorp
6 | // Copyright (c) 2014, richards-tech
7 | //
8 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
9 | // this software and associated documentation files (the "Software"), to deal in
10 | // the Software without restriction, including without limitation the rights to use,
11 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
12 | // Software, and to permit persons to whom the Software is furnished to do so,
13 | // subject to the following conditions:
14 | //
15 | // The above copyright notice and this permission notice shall be included in all
16 | // copies or substantial portions of the Software.
17 | //
18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
19 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
20 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
21 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
22 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 |
25 | // Python binding for RTIMULib
26 |
27 | #include
28 | #include "structmember.h"
29 | #include "RTIMULib.h"
30 |
31 | // RTPressure Type
32 | struct RTIMU_RTPressure {
33 | PyObject_HEAD
34 | RTPressure* val;
35 | };
36 |
37 | // Create the RTPressure type
38 | int RTIMU_RTPressure_create(PyObject* module);
39 |
40 |
--------------------------------------------------------------------------------
/RTHost/RTArduLinkHost/RTArduLinkHost.pri:
--------------------------------------------------------------------------------
1 | #///////////////////////////////////////////////////////////
2 | #//
3 | #// This file is part of RTArduLink
4 | #//
5 | #// Copyright (c) 2014 richards-tech
6 | #//
7 | #// Permission is hereby granted, free of charge,
8 | #// to any person obtaining a copy of
9 | #// this software and associated documentation files
10 | #// (the "Software"), to deal in the Software without
11 | #// restriction, including without limitation the rights
12 | #// to use, copy, modify, merge, publish, distribute,
13 | #// sublicense, and/or sell copies of the Software, and
14 | #// to permit persons to whom the Software is furnished
15 | #// to do so, subject to the following conditions:
16 | #//
17 | #// The above copyright notice and this permission notice
18 | #// shall be included in all copies or substantial portions
19 | #// of the Software.
20 | #//
21 | #// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
22 | #// ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
23 | #// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
24 | #// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
25 | #// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
26 | #// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 | #// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
28 | #// IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29 | #// DEALINGS IN THE SOFTWARE.
30 |
31 | INCLUDEPATH += $$PWD
32 | DEPENDPATH += $$PWD
33 |
34 | HEADERS += $$PWD/RTArduLinkDefs.h \
35 | $$PWD/RTArduLinkDemoDefs.h \
36 | $$PWD/RTArduLinkHost.h \
37 | $$PWD/RTArduLinkUtils.h
38 |
39 | SOURCES += $$PWD/RTArduLinkHost.cpp \
40 | $$PWD/RTArduLinkUtils.cpp
41 |
--------------------------------------------------------------------------------
/Linux/RTIMULibGL/QtGLLib/QtGLADSShader.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014, richards-tech
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | // this software and associated documentation files (the "Software"), to deal in
9 | // the Software without restriction, including without limitation the rights to use,
10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | // Software, and to permit persons to whom the Software is furnished to do so,
12 | // subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #ifndef QTGLADSSHADER_H
25 | #define QTGLADSSHADER_H
26 |
27 | class QtGLADSShader : public QtGLShader
28 | {
29 | public:
30 | QtGLADSShader(QObject *parent);
31 | ~QtGLADSShader();
32 |
33 | void load(const QVector3D *vertices, const QVector3D *normals, const COMPONENT_MATERIAL& material);
34 |
35 | private:
36 |
37 | };
38 |
39 | #endif // QTGLADSSHADER_H
40 |
--------------------------------------------------------------------------------
/Linux/RTIMULibGL/QtGLLib/QtGLTextureShader.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014, richards-tech
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | // this software and associated documentation files (the "Software"), to deal in
9 | // the Software without restriction, including without limitation the rights to use,
10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | // Software, and to permit persons to whom the Software is furnished to do so,
12 | // subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #ifndef QTGLTEXTURESHADER_H
25 | #define QTGLTEXTURESHADER_H
26 |
27 | class QtGLTextureShader : public QtGLShader
28 | {
29 | public:
30 | QtGLTextureShader(QObject *parent);
31 | ~QtGLTextureShader();
32 |
33 | void load(const QVector3D *vertices, const QVector2D *textureCoords);
34 |
35 | private:
36 |
37 | };
38 |
39 | #endif // QTGLTEXTURESHADER_H
40 |
--------------------------------------------------------------------------------
/RTHost/RTIMULibGL/QtGLLib/QtGLADSShader.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014, richards-tech
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | // this software and associated documentation files (the "Software"), to deal in
9 | // the Software without restriction, including without limitation the rights to use,
10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | // Software, and to permit persons to whom the Software is furnished to do so,
12 | // subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #ifndef QTGLADSSHADER_H
25 | #define QTGLADSSHADER_H
26 |
27 | class QtGLADSShader : public QtGLShader
28 | {
29 | public:
30 | QtGLADSShader(QObject *parent);
31 | ~QtGLADSShader();
32 |
33 | void load(const QVector3D *vertices, const QVector3D *normals, const COMPONENT_MATERIAL& material);
34 |
35 | private:
36 |
37 | };
38 |
39 | #endif // QTGLADSSHADER_H
40 |
--------------------------------------------------------------------------------
/RTHost/RTIMULibGL/QtGLLib/QtGLTextureShader.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014, richards-tech
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | // this software and associated documentation files (the "Software"), to deal in
9 | // the Software without restriction, including without limitation the rights to use,
10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | // Software, and to permit persons to whom the Software is furnished to do so,
12 | // subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #ifndef QTGLTEXTURESHADER_H
25 | #define QTGLTEXTURESHADER_H
26 |
27 | class QtGLTextureShader : public QtGLShader
28 | {
29 | public:
30 | QtGLTextureShader(QObject *parent);
31 | ~QtGLTextureShader();
32 |
33 | void load(const QVector3D *vertices, const QVector2D *textureCoords);
34 |
35 | private:
36 |
37 | };
38 |
39 | #endif // QTGLTEXTURESHADER_H
40 |
--------------------------------------------------------------------------------
/Linux/RTIMULibCal/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #////////////////////////////////////////////////////////////////////////////
2 | #//
3 | #// This file is part of RTIMULib
4 | #//
5 | #// Copyright (c) 2014-2015, richards-tech, LLC
6 | #//
7 | #// Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | #// this software and associated documentation files (the "Software"), to deal in
9 | #// the Software without restriction, including without limitation the rights to use,
10 | #// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | #// Software, and to permit persons to whom the Software is furnished to do so,
12 | #// subject to the following conditions:
13 | #//
14 | #// The above copyright notice and this permission notice shall be included in all
15 | #// copies or substantial portions of the Software.
16 | #//
17 | #// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | #// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | #// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | #// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | #// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | #// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #// The cmake support was based on work by Moritz Fischer at ettus.com.
25 | #// Original copyright notice:
26 | #
27 | # Copyright 2014 Ettus Research LLC
28 | #
29 |
30 |
31 | SET(CAL_SRCS
32 | RTIMULibCal.cpp)
33 |
34 | ADD_EXECUTABLE(RTIMULibCal ${CAL_SRCS})
35 | TARGET_LINK_LIBRARIES(RTIMULibCal RTIMULib)
36 |
37 | INSTALL(TARGETS RTIMULibCal DESTINATION bin)
38 |
--------------------------------------------------------------------------------
/Linux/RTIMULibDrive/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #////////////////////////////////////////////////////////////////////////////
2 | #//
3 | #// This file is part of RTIMULib
4 | #//
5 | #// Copyright (c) 2014-2015, richards-tech, LLC
6 | #//
7 | #// Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | #// this software and associated documentation files (the "Software"), to deal in
9 | #// the Software without restriction, including without limitation the rights to use,
10 | #// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | #// Software, and to permit persons to whom the Software is furnished to do so,
12 | #// subject to the following conditions:
13 | #//
14 | #// The above copyright notice and this permission notice shall be included in all
15 | #// copies or substantial portions of the Software.
16 | #//
17 | #// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | #// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | #// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | #// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | #// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | #// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #// The cmake support was based on work by Moritz Fischer at ettus.com.
25 | #// Original copyright notice:
26 | #
27 | # Copyright 2014 Ettus Research LLC
28 | #
29 |
30 | SET(DRIVE_SRCS
31 | RTIMULibDrive.cpp)
32 |
33 | ADD_EXECUTABLE(RTIMULibDrive ${DRIVE_SRCS})
34 | TARGET_LINK_LIBRARIES(RTIMULibDrive RTIMULib)
35 |
36 | INSTALL(TARGETS RTIMULibDrive DESTINATION bin)
37 |
--------------------------------------------------------------------------------
/Linux/RTIMULibDrive10/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #////////////////////////////////////////////////////////////////////////////
2 | #//
3 | #// This file is part of RTIMULib
4 | #//
5 | #// Copyright (c) 2014-2015, richards-tech, LLC
6 | #//
7 | #// Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | #// this software and associated documentation files (the "Software"), to deal in
9 | #// the Software without restriction, including without limitation the rights to use,
10 | #// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | #// Software, and to permit persons to whom the Software is furnished to do so,
12 | #// subject to the following conditions:
13 | #//
14 | #// The above copyright notice and this permission notice shall be included in all
15 | #// copies or substantial portions of the Software.
16 | #//
17 | #// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | #// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | #// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | #// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | #// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | #// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #// The cmake support was based on work by Moritz Fischer at ettus.com.
25 | #// Original copyright notice:
26 | #
27 | # Copyright 2014 Ettus Research LLC
28 | #
29 |
30 | SET(DRIVE_SRCS
31 | RTIMULibDrive10.cpp)
32 |
33 | ADD_EXECUTABLE(RTIMULibDrive10 ${DRIVE_SRCS})
34 | TARGET_LINK_LIBRARIES(RTIMULibDrive10 RTIMULib)
35 |
36 | INSTALL(TARGETS RTIMULibDrive10 DESTINATION bin)
37 |
--------------------------------------------------------------------------------
/Linux/RTIMULibDrive11/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #////////////////////////////////////////////////////////////////////////////
2 | #//
3 | #// This file is part of RTIMULib
4 | #//
5 | #// Copyright (c) 2014-2015, richards-tech, LLC
6 | #//
7 | #// Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | #// this software and associated documentation files (the "Software"), to deal in
9 | #// the Software without restriction, including without limitation the rights to use,
10 | #// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | #// Software, and to permit persons to whom the Software is furnished to do so,
12 | #// subject to the following conditions:
13 | #//
14 | #// The above copyright notice and this permission notice shall be included in all
15 | #// copies or substantial portions of the Software.
16 | #//
17 | #// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | #// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | #// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | #// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | #// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | #// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #// The cmake support was based on work by Moritz Fischer at ettus.com.
25 | #// Original copyright notice:
26 | #
27 | # Copyright 2014 Ettus Research LLC
28 | #
29 |
30 | SET(DRIVE_SRCS
31 | RTIMULibDrive11.cpp)
32 |
33 | ADD_EXECUTABLE(RTIMULibDrive11 ${DRIVE_SRCS})
34 | TARGET_LINK_LIBRARIES(RTIMULibDrive11 RTIMULib)
35 |
36 | INSTALL(TARGETS RTIMULibDrive11 DESTINATION bin)
37 |
--------------------------------------------------------------------------------
/Linux/RTIMULibGL/QtGLLib/QtGLADSTextureShader.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014, richards-tech
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | // this software and associated documentation files (the "Software"), to deal in
9 | // the Software without restriction, including without limitation the rights to use,
10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | // Software, and to permit persons to whom the Software is furnished to do so,
12 | // subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #ifndef QTGLADSTEXTURESHADER_H
25 | #define QTGLADSTEXTURESHADER_H
26 |
27 | class QtGLADSTextureShader : public QtGLShader
28 | {
29 | public:
30 | QtGLADSTextureShader(QObject *parent);
31 | ~QtGLADSTextureShader();
32 |
33 | void load(const QVector3D *vertices, const QVector3D *normals,
34 | const QVector2D *textureCoords, const COMPONENT_MATERIAL& material);
35 |
36 | private:
37 |
38 | };
39 |
40 | #endif // QTGLADSTEXTURESHADER_H
41 |
--------------------------------------------------------------------------------
/RTHost/RTIMULibGL/QtGLLib/QtGLADSTextureShader.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014, richards-tech
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | // this software and associated documentation files (the "Software"), to deal in
9 | // the Software without restriction, including without limitation the rights to use,
10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | // Software, and to permit persons to whom the Software is furnished to do so,
12 | // subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #ifndef QTGLADSTEXTURESHADER_H
25 | #define QTGLADSTEXTURESHADER_H
26 |
27 | class QtGLADSTextureShader : public QtGLShader
28 | {
29 | public:
30 | QtGLADSTextureShader(QObject *parent);
31 | ~QtGLADSTextureShader();
32 |
33 | void load(const QVector3D *vertices, const QVector3D *normals,
34 | const QVector2D *textureCoords, const COMPONENT_MATERIAL& material);
35 |
36 | private:
37 |
38 | };
39 |
40 | #endif // QTGLADSTEXTURESHADER_H
41 |
--------------------------------------------------------------------------------
/RTHost/RTHostIMUCommon/RTHostIMUCommon.pri:
--------------------------------------------------------------------------------
1 | #////////////////////////////////////////////////////////////////////////////
2 | #//
3 | #// This file is part of RTIMULib
4 | #//
5 | #// Copyright (c) 2014, richards-tech
6 | #//
7 | #// Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | #// this software and associated documentation files (the "Software"), to deal in
9 | #// the Software without restriction, including without limitation the rights to use,
10 | #// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | #// Software, and to permit persons to whom the Software is furnished to do so,
12 | #// subject to the following conditions:
13 | #//
14 | #// The above copyright notice and this permission notice shall be included in all
15 | #// copies or substantial portions of the Software.
16 | #//
17 | #// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | #// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | #// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | #// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | #// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | #// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 |
25 | INCLUDEPATH += $$PWD
26 | DEPENDPATH += $$PWD
27 |
28 | HEADERS += $$PWD/RTArduLinkIMUDefs.h \
29 | $$PWD/RTHostIMUClient.h \
30 | $$PWD/RTHostIMUThread.h \
31 | $$PWD/SelectFusionDlg.h \
32 | $$PWD/MagCalDlg.h \
33 | $$PWD/AccelCalDlg.h \
34 |
35 | SOURCES += $$PWD/RTHostIMUClient.cpp \
36 | $$PWD/RTHostIMUThread.cpp \
37 | $$PWD/SelectFusionDlg.cpp \
38 | $$PWD/MagCalDlg.cpp \
39 | $$PWD/AccelCalDlg.cpp \
40 |
41 |
--------------------------------------------------------------------------------
/Linux/RTIMULibGL/QtGLLib/QtGLPlaneComponent.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014, richards-tech
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | // this software and associated documentation files (the "Software"), to deal in
9 | // the Software without restriction, including without limitation the rights to use,
10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | // Software, and to permit persons to whom the Software is furnished to do so,
12 | // subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 | //
24 |
25 | // This file contains OpenGL and Qt includes. This file should be included first
26 | // and the order of includes is very important (especially on Linux).
27 |
28 | #ifndef QTGLPLANECOMPONENT_H
29 | #define QTGLPLANECOMPONENT_H
30 |
31 | class QtGLPlaneComponent : public QtGLComponent
32 | {
33 | public:
34 | QtGLPlaneComponent();
35 | ~QtGLPlaneComponent();
36 |
37 | void generate(float width, float height);
38 | void draw();
39 |
40 | };
41 |
42 | #endif // QTGLPLANECOMPONENT_H
43 |
--------------------------------------------------------------------------------
/Linux/RTIMULibDemo/RTIMULibDemo.pri:
--------------------------------------------------------------------------------
1 | #////////////////////////////////////////////////////////////////////////////
2 | #//
3 | #// This file is part of RTIMULib
4 | #//
5 | #// Copyright (c) 2014-2015, richards-tech, LLC
6 | #//
7 | #// Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | #// this software and associated documentation files (the "Software"), to deal in
9 | #// the Software without restriction, including without limitation the rights to use,
10 | #// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | #// Software, and to permit persons to whom the Software is furnished to do so,
12 | #// subject to the following conditions:
13 | #//
14 | #// The above copyright notice and this permission notice shall be included in all
15 | #// copies or substantial portions of the Software.
16 | #//
17 | #// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | #// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | #// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | #// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | #// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | #// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | INCLUDEPATH += $$PWD
25 | DEPENDPATH += $$PWD
26 |
27 | HEADERS += RTIMULibDemo.h \
28 | SelectIMUDlg.h \
29 | SelectFusionDlg.h \
30 | IMUThread.h \
31 | AccelCalDlg.h \
32 | MagCalDlg.h \
33 |
34 | SOURCES += main.cpp \
35 | RTIMULibDemo.cpp \
36 | SelectIMUDlg.cpp \
37 | SelectFusionDlg.cpp \
38 | IMUThread.cpp \
39 | AccelCalDlg.cpp \
40 | MagCalDlg.cpp \
41 |
42 | FORMS += RTIMULibDemo.ui
43 |
44 |
--------------------------------------------------------------------------------
/RTHost/RTIMULibGL/QtGLLib/QtGLPlaneComponent.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014, richards-tech
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | // this software and associated documentation files (the "Software"), to deal in
9 | // the Software without restriction, including without limitation the rights to use,
10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | // Software, and to permit persons to whom the Software is furnished to do so,
12 | // subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 | //
24 |
25 | // This file contains OpenGL and Qt includes. This file should be included first
26 | // and the order of includes is very important (especially on Linux).
27 |
28 | #ifndef QTGLPLANECOMPONENT_H
29 | #define QTGLPLANECOMPONENT_H
30 |
31 | class QtGLPlaneComponent : public QtGLComponent
32 | {
33 | public:
34 | QtGLPlaneComponent();
35 | ~QtGLPlaneComponent();
36 |
37 | void generate(float width, float height);
38 | void draw();
39 |
40 | };
41 |
42 | #endif // QTGLPLANECOMPONENT_H
43 |
--------------------------------------------------------------------------------
/Linux/RTIMULibDemoGL/RTIMULibDemoGL.pri:
--------------------------------------------------------------------------------
1 | #////////////////////////////////////////////////////////////////////////////
2 | #//
3 | #// This file is part of RTIMULib
4 | #//
5 | #// Copyright (c) 2014-2015, richards-tech, LLC
6 | #//
7 | #// Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | #// this software and associated documentation files (the "Software"), to deal in
9 | #// the Software without restriction, including without limitation the rights to use,
10 | #// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | #// Software, and to permit persons to whom the Software is furnished to do so,
12 | #// subject to the following conditions:
13 | #//
14 | #// The above copyright notice and this permission notice shall be included in all
15 | #// copies or substantial portions of the Software.
16 | #//
17 | #// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | #// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | #// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | #// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | #// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | #// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | INCLUDEPATH += $$PWD
25 | DEPENDPATH += $$PWD
26 |
27 | HEADERS += RTIMULibDemoGL.h \
28 | SelectIMUDlg.h \
29 | SelectFusionDlg.h \
30 | IMUThread.h \
31 | AccelCalDlg.h \
32 | MagCalDlg.h \
33 |
34 | SOURCES += main.cpp \
35 | RTIMULibDemoGL.cpp \
36 | SelectIMUDlg.cpp \
37 | SelectFusionDlg.cpp \
38 | IMUThread.cpp \
39 | AccelCalDlg.cpp \
40 | MagCalDlg.cpp \
41 |
42 | FORMS += RTIMULibDemoGL.ui
43 |
44 |
--------------------------------------------------------------------------------
/Linux/RTIMULibGL/QtGLLib/QtGLWireCubeComponent.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014, richards-tech
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | // this software and associated documentation files (the "Software"), to deal in
9 | // the Software without restriction, including without limitation the rights to use,
10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | // Software, and to permit persons to whom the Software is furnished to do so,
12 | // subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | // This file contains OpenGL and Qt includes. This file should be included first
25 | // and the order of includes is very important (especially on Linux).
26 |
27 | #ifndef QTGLWIRECUBECOMPONENT_H
28 | #define QTGLWIRECUBECOMPONENT_H
29 |
30 | class QtGLWireCubeComponent : public QtGLComponent
31 | {
32 | public:
33 | QtGLWireCubeComponent();
34 | ~QtGLWireCubeComponent();
35 |
36 | void generate(float width, float height, float depth);
37 | void draw();
38 |
39 | };
40 |
41 | #endif // QTGLWIRECUBECOMPONENT_H
42 |
--------------------------------------------------------------------------------
/RTHost/RTIMULibGL/QtGLLib/QtGLWireCubeComponent.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014, richards-tech
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | // this software and associated documentation files (the "Software"), to deal in
9 | // the Software without restriction, including without limitation the rights to use,
10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | // Software, and to permit persons to whom the Software is furnished to do so,
12 | // subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | // This file contains OpenGL and Qt includes. This file should be included first
25 | // and the order of includes is very important (especially on Linux).
26 |
27 | #ifndef QTGLWIRECUBECOMPONENT_H
28 | #define QTGLWIRECUBECOMPONENT_H
29 |
30 | class QtGLWireCubeComponent : public QtGLComponent
31 | {
32 | public:
33 | QtGLWireCubeComponent();
34 | ~QtGLWireCubeComponent();
35 |
36 | void generate(float width, float height, float depth);
37 | void draw();
38 |
39 | };
40 |
41 | #endif // QTGLWIRECUBECOMPONENT_H
42 |
--------------------------------------------------------------------------------
/RTIMULib/IMUDrivers/RTIMUNull.cpp:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014-2015, richards-tech, LLC
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | // this software and associated documentation files (the "Software"), to deal in
9 | // the Software without restriction, including without limitation the rights to use,
10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | // Software, and to permit persons to whom the Software is furnished to do so,
12 | // subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #include "RTIMUNull.h"
25 | #include "RTIMUSettings.h"
26 |
27 | RTIMUNull::RTIMUNull(RTIMUSettings *settings) : RTIMU(settings)
28 | {
29 | }
30 |
31 | RTIMUNull::~RTIMUNull()
32 | {
33 | }
34 |
35 | bool RTIMUNull::IMUInit()
36 | {
37 | return true;
38 | }
39 |
40 | int RTIMUNull::IMUGetPollInterval()
41 | {
42 | return (100); // just a dummy value really
43 | }
44 |
45 | bool RTIMUNull::IMURead()
46 | {
47 | updateFusion();
48 | return true;
49 | }
50 |
51 | void RTIMUNull::setIMUData(const RTIMU_DATA& data)
52 | {
53 | m_imuData = data;
54 | }
55 |
--------------------------------------------------------------------------------
/RTIMULib/IMUDrivers/RTIMUBNO055.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014-2015, richards-tech, LLC
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | // this software and associated documentation files (the "Software"), to deal in
9 | // the Software without restriction, including without limitation the rights to use,
10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | // Software, and to permit persons to whom the Software is furnished to do so,
12 | // subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 |
25 | #ifndef _RTIMUBNO055_H
26 | #define _RTIMUBNO055_H
27 |
28 | #include "RTIMU.h"
29 |
30 | class RTIMUBNO055 : public RTIMU
31 | {
32 | public:
33 | RTIMUBNO055(RTIMUSettings *settings);
34 | ~RTIMUBNO055();
35 |
36 | virtual const char *IMUName() { return "BNO055"; }
37 | virtual int IMUType() { return RTIMU_TYPE_BNO055; }
38 | virtual bool IMUInit();
39 | virtual int IMUGetPollInterval();
40 | virtual bool IMURead();
41 |
42 | private:
43 | unsigned char m_slaveAddr; // I2C address of BNO055
44 |
45 | uint64_t m_lastReadTime;
46 | };
47 |
48 | #endif // _RTIMUBNO055_H
49 |
--------------------------------------------------------------------------------
/Linux/RTIMULibDemo/RTIMULibDemo.pro:
--------------------------------------------------------------------------------
1 | #////////////////////////////////////////////////////////////////////////////
2 | #//
3 | #// This file is part of RTIMULib
4 | #//
5 | #// Copyright (c) 2014-2015, richards-tech, LLC
6 | #//
7 | #// Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | #// this software and associated documentation files (the "Software"), to deal in
9 | #// the Software without restriction, including without limitation the rights to use,
10 | #// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | #// Software, and to permit persons to whom the Software is furnished to do so,
12 | #// subject to the following conditions:
13 | #//
14 | #// The above copyright notice and this permission notice shall be included in all
15 | #// copies or substantial portions of the Software.
16 | #//
17 | #// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | #// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | #// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | #// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | #// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | #// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | greaterThan(QT_MAJOR_VERSION, 4): cache()
25 |
26 | TEMPLATE = app
27 |
28 | TARGET = RTIMULibDemo
29 |
30 | DESTDIR = Output
31 |
32 | QT += core gui
33 |
34 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
35 |
36 | CONFIG += debug_and_release
37 |
38 | target.path = /usr/local/bin
39 |
40 | INSTALLS += target
41 |
42 | DEFINES += QT_NETWORK_LIB
43 |
44 | INCLUDEPATH += GeneratedFiles
45 |
46 | MOC_DIR += GeneratedFiles/moc
47 |
48 | OBJECTS_DIR += objects
49 |
50 | UI_DIR += GeneratedFiles
51 |
52 | RCC_DIR += GeneratedFiles
53 |
54 | include(RTIMULibDemo.pri)
55 | include(../../RTIMULib/RTIMULib.pri)
56 |
57 |
--------------------------------------------------------------------------------
/Linux/python/PyRTIMU.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014-2015, richards-tech
6 | // Copyright (c) 2014, avishorp
7 | //
8 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
9 | // this software and associated documentation files (the "Software"), to deal in
10 | // the Software without restriction, including without limitation the rights to use,
11 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
12 | // Software, and to permit persons to whom the Software is furnished to do so,
13 | // subject to the following conditions:
14 | //
15 | // The above copyright notice and this permission notice shall be included in all
16 | // copies or substantial portions of the Software.
17 | //
18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
19 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
20 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
21 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
22 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 |
25 | // Python binding for RTIMULib
26 |
27 | #include
28 | #include "structmember.h"
29 | #include "RTIMULib.h"
30 |
31 | // RTIMUSettings Type
32 | struct RTIMU_Settings {
33 | PyObject_HEAD
34 | RTIMUSettings* val;
35 | };
36 |
37 | // RTIMU Type
38 | struct RTIMU_RTIMU {
39 | PyObject_HEAD
40 | RTIMU* val;
41 | };
42 |
43 | // Create the RTIMU_Settings type
44 | int RTIMU_Settings_create(PyObject* module);
45 |
46 | // Check if the given object is of RTIMU_Settings type
47 | bool RTIMU_Settings_typecheck(PyObject* obj);
48 |
49 | // Create the RTIMU type
50 | int RTIMU_RTIMU_create(PyObject* module);
51 |
52 |
--------------------------------------------------------------------------------
/Linux/RTIMULibDemo/SelectFusionDlg.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014-2015, richards-tech, LLC
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | // this software and associated documentation files (the "Software"), to deal in
9 | // the Software without restriction, including without limitation the rights to use,
10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | // Software, and to permit persons to whom the Software is furnished to do so,
12 | // subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #ifndef SELECTFUSIONDLG_H
25 | #define SELECTFUSIONDLG_H
26 |
27 | #include
28 | #include
29 | #include
30 |
31 | class RTIMUSettings;
32 |
33 | class SelectFusionDlg : public QDialog
34 | {
35 | Q_OBJECT
36 |
37 | public:
38 | SelectFusionDlg(RTIMUSettings *settings, QWidget *parent = 0);
39 | ~SelectFusionDlg();
40 |
41 | public slots:
42 | void onOk();
43 | void onCancel();
44 |
45 | private:
46 | void layoutWindow();
47 |
48 | RTIMUSettings *m_settings;
49 |
50 | QDialogButtonBox *m_buttons;
51 | QComboBox *m_selectFusion;
52 | };
53 |
54 | #endif // SELECTFUSIONDLG_H
55 |
--------------------------------------------------------------------------------
/Linux/RTIMULibDemoGL/SelectFusionDlg.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014-2015, richards-tech, LLC
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | // this software and associated documentation files (the "Software"), to deal in
9 | // the Software without restriction, including without limitation the rights to use,
10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | // Software, and to permit persons to whom the Software is furnished to do so,
12 | // subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #ifndef SELECTFUSIONDLG_H
25 | #define SELECTFUSIONDLG_H
26 |
27 | #include
28 | #include
29 | #include
30 |
31 | class RTIMUSettings;
32 |
33 | class SelectFusionDlg : public QDialog
34 | {
35 | Q_OBJECT
36 |
37 | public:
38 | SelectFusionDlg(RTIMUSettings *settings, QWidget *parent = 0);
39 | ~SelectFusionDlg();
40 |
41 | public slots:
42 | void onOk();
43 | void onCancel();
44 |
45 | private:
46 | void layoutWindow();
47 |
48 | RTIMUSettings *m_settings;
49 |
50 | QDialogButtonBox *m_buttons;
51 | QComboBox *m_selectFusion;
52 | };
53 |
54 | #endif // SELECTFUSIONDLG_H
55 |
--------------------------------------------------------------------------------
/RTHost/RTHostIMUCommon/SelectFusionDlg.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014, richards-tech
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | // this software and associated documentation files (the "Software"), to deal in
9 | // the Software without restriction, including without limitation the rights to use,
10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | // Software, and to permit persons to whom the Software is furnished to do so,
12 | // subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 |
25 | #ifndef SELECTFUSIONDLG_H
26 | #define SELECTFUSIONDLG_H
27 |
28 | #include
29 | #include
30 | #include
31 |
32 | class RTIMUSettings;
33 |
34 | class SelectFusionDlg : public QDialog
35 | {
36 | Q_OBJECT
37 |
38 | public:
39 | SelectFusionDlg(RTIMUSettings *settings, QWidget *parent = 0);
40 | ~SelectFusionDlg();
41 |
42 | public slots:
43 | void onOk();
44 | void onCancel();
45 |
46 | private:
47 | void layoutWindow();
48 |
49 | RTIMUSettings *m_settings;
50 |
51 | QDialogButtonBox *m_buttons;
52 | QComboBox *m_selectFusion;
53 | };
54 |
55 | #endif // SELECTFUSIONDLG_H
56 |
--------------------------------------------------------------------------------
/Linux/RTIMULibDemoGL/RTIMULibDemoGL.pro:
--------------------------------------------------------------------------------
1 | #////////////////////////////////////////////////////////////////////////////
2 | #//
3 | #// This file is part of RTIMULib
4 | #//
5 | #// Copyright (c) 2014-2015, richards-tech, LLC
6 | #//
7 | #// Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | #// this software and associated documentation files (the "Software"), to deal in
9 | #// the Software without restriction, including without limitation the rights to use,
10 | #// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | #// Software, and to permit persons to whom the Software is furnished to do so,
12 | #// subject to the following conditions:
13 | #//
14 | #// The above copyright notice and this permission notice shall be included in all
15 | #// copies or substantial portions of the Software.
16 | #//
17 | #// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | #// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | #// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | #// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | #// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | #// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | greaterThan(QT_MAJOR_VERSION, 4): cache()
25 |
26 | TEMPLATE = app
27 |
28 | TARGET = RTIMULibDemoGL
29 |
30 | DESTDIR = Output
31 |
32 | QT += core gui opengl
33 |
34 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
35 |
36 | CONFIG += debug_and_release
37 |
38 | target.path = /usr/local/bin
39 |
40 | INSTALLS += target
41 |
42 | DEFINES += QT_NETWORK_LIB
43 |
44 | INCLUDEPATH += GeneratedFiles
45 |
46 | MOC_DIR += GeneratedFiles/moc
47 |
48 | OBJECTS_DIR += objects
49 |
50 | UI_DIR += GeneratedFiles
51 |
52 | RCC_DIR += GeneratedFiles
53 |
54 | include(RTIMULibDemoGL.pri)
55 | include(../../RTIMULib/RTIMULib.pri)
56 | include(../RTIMULibGL/RTIMULibGL.pri)
57 |
58 |
--------------------------------------------------------------------------------
/Linux/RTIMULibGL/QtGLLib/QtGLPlaneComponent.cpp:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014, richards-tech
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | // this software and associated documentation files (the "Software"), to deal in
9 | // the Software without restriction, including without limitation the rights to use,
10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | // Software, and to permit persons to whom the Software is furnished to do so,
12 | // subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #include "QtGL.h"
25 |
26 | QtGLPlaneComponent::QtGLPlaneComponent()
27 | {
28 | }
29 |
30 | QtGLPlaneComponent::~QtGLPlaneComponent()
31 | {
32 |
33 | }
34 |
35 | void QtGLPlaneComponent::generate(float width, float height)
36 | {
37 | static const float coords[4][2] = {{+0.5f, +0.5f}, {-0.5f, +0.5f}, {-0.5f, -0.5f}, {+0.5f, -0.5f}};
38 |
39 | reset();
40 |
41 | for (int vert = 0; vert < 4; vert++) {
42 | addTextureCoord(QVector2D(vert == 0 || vert == 3, vert == 0 || vert == 1));
43 | addVertex(QVector3D(width * coords[vert][0], height * coords[vert][1], 0));
44 | }
45 | }
46 |
47 | void QtGLPlaneComponent::draw()
48 | {
49 | QtGLComponent::draw(GL_TRIANGLE_FAN);
50 | }
51 |
--------------------------------------------------------------------------------
/RTHost/RTIMULibGL/QtGLLib/QtGLPlaneComponent.cpp:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014, richards-tech
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | // this software and associated documentation files (the "Software"), to deal in
9 | // the Software without restriction, including without limitation the rights to use,
10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | // Software, and to permit persons to whom the Software is furnished to do so,
12 | // subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #include "QtGL.h"
25 |
26 | QtGLPlaneComponent::QtGLPlaneComponent()
27 | {
28 | }
29 |
30 | QtGLPlaneComponent::~QtGLPlaneComponent()
31 | {
32 |
33 | }
34 |
35 | void QtGLPlaneComponent::generate(float width, float height)
36 | {
37 | static const float coords[4][2] = {{+0.5f, +0.5f}, {-0.5f, +0.5f}, {-0.5f, -0.5f}, {+0.5f, -0.5f}};
38 |
39 | reset();
40 |
41 | for (int vert = 0; vert < 4; vert++) {
42 | addTextureCoord(QVector2D(vert == 0 || vert == 3, vert == 0 || vert == 1));
43 | addVertex(QVector3D(width * coords[vert][0], height * coords[vert][1], 0));
44 | }
45 | }
46 |
47 | void QtGLPlaneComponent::draw()
48 | {
49 | QtGLComponent::draw(GL_TRIANGLE_FAN);
50 | }
51 |
--------------------------------------------------------------------------------
/Linux/RTIMULibGL/VRWidgetLib/VRIMUWidget.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014, richards-tech
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | // this software and associated documentation files (the "Software"), to deal in
9 | // the Software without restriction, including without limitation the rights to use,
10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | // Software, and to permit persons to whom the Software is furnished to do so,
12 | // subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #ifndef VRIMUWIDGET_H
25 | #define VRIMUWIDGET_H
26 |
27 | #include "VRWidget.h"
28 |
29 | class VRIMUWidget : public VRWidget
30 | {
31 | Q_OBJECT
32 |
33 | public:
34 | VRIMUWidget(QObject *parent, VRWIDGET_TYPE = VRWIDGET_IMU);
35 | ~VRIMUWidget();
36 |
37 | virtual void VRWidgetInit();
38 | virtual void VRWidgetRender();
39 |
40 | private:
41 | QtGLCylinderComponent m_IMUXCylinder;
42 | QtGLCylinderComponent m_IMUYCylinder;
43 | QtGLCylinderComponent m_IMUZCylinder;
44 | QtGLDiskComponent m_IMUXTop;
45 | QtGLDiskComponent m_IMUYTop;
46 | QtGLDiskComponent m_IMUZTop;
47 |
48 | QtGLWireCubeComponent m_cube;
49 |
50 | qreal m_IMURadius;
51 | qreal m_IMULength;
52 | };
53 |
54 | #endif // VRIMUWIDGET_H
55 |
--------------------------------------------------------------------------------
/RTHost/RTIMULibGL/VRWidgetLib/VRIMUWidget.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014, richards-tech
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | // this software and associated documentation files (the "Software"), to deal in
9 | // the Software without restriction, including without limitation the rights to use,
10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | // Software, and to permit persons to whom the Software is furnished to do so,
12 | // subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #ifndef VRIMUWIDGET_H
25 | #define VRIMUWIDGET_H
26 |
27 | #include "VRWidget.h"
28 |
29 | class VRIMUWidget : public VRWidget
30 | {
31 | Q_OBJECT
32 |
33 | public:
34 | VRIMUWidget(QObject *parent, VRWIDGET_TYPE = VRWIDGET_IMU);
35 | ~VRIMUWidget();
36 |
37 | virtual void VRWidgetInit();
38 | virtual void VRWidgetRender();
39 |
40 | private:
41 | QtGLCylinderComponent m_IMUXCylinder;
42 | QtGLCylinderComponent m_IMUYCylinder;
43 | QtGLCylinderComponent m_IMUZCylinder;
44 | QtGLDiskComponent m_IMUXTop;
45 | QtGLDiskComponent m_IMUYTop;
46 | QtGLDiskComponent m_IMUZTop;
47 |
48 | QtGLWireCubeComponent m_cube;
49 |
50 | qreal m_IMURadius;
51 | qreal m_IMULength;
52 | };
53 |
54 | #endif // VRIMUWIDGET_H
55 |
--------------------------------------------------------------------------------
/RTHost/RTHostIMU/RTHostIMU.pro:
--------------------------------------------------------------------------------
1 | #////////////////////////////////////////////////////////////////////////////
2 | #//
3 | #// This file is part of RTIMULib
4 | #//
5 | #// Copyright (c) 2014, richards-tech
6 | #//
7 | #// Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | #// this software and associated documentation files (the "Software"), to deal in
9 | #// the Software without restriction, including without limitation the rights to use,
10 | #// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | #// Software, and to permit persons to whom the Software is furnished to do so,
12 | #// subject to the following conditions:
13 | #//
14 | #// The above copyright notice and this permission notice shall be included in all
15 | #// copies or substantial portions of the Software.
16 | #//
17 | #// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | #// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | #// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | #// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | #// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | #// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 |
25 | greaterThan(QT_MAJOR_VERSION, 4): cache()
26 |
27 | TEMPLATE = app
28 |
29 | TARGET = RTHostIMU
30 |
31 | DESTDIR = Output
32 |
33 | QT += core gui
34 |
35 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
36 |
37 | CONFIG += debug_and_release
38 |
39 | target.path = /usr/local/bin
40 |
41 | INSTALLS += target
42 |
43 | DEFINES += QT_NETWORK_LIB
44 |
45 | INCLUDEPATH += GeneratedFiles
46 |
47 | MOC_DIR += GeneratedFiles/moc
48 |
49 | OBJECTS_DIR += objects
50 |
51 | UI_DIR += GeneratedFiles
52 |
53 | RCC_DIR += GeneratedFiles
54 |
55 | include(RTHostIMU.pri)
56 | include(../RTHostIMUCommon/RTHostIMUCommon.pri)
57 | include(../../RTIMULib/RTIMULib.pri)
58 | include(../RTSerialPort/src/qextserialport.pri)
59 | include(../RTArduLinkHost/RTArduLinkHost.pri)
60 |
61 |
--------------------------------------------------------------------------------
/RTIMULib/RTIMULib.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014-2015, richards-tech, LLC
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | // this software and associated documentation files (the "Software"), to deal in
9 | // the Software without restriction, including without limitation the rights to use,
10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | // Software, and to permit persons to whom the Software is furnished to do so,
12 | // subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 |
25 | #ifndef _RTIMULIB_H
26 | #define _RTIMULIB_H
27 |
28 | #include "RTIMULibDefs.h"
29 |
30 | #include "RTMath.h"
31 |
32 | #include "RTFusion.h"
33 | #include "RTFusionKalman4.h"
34 |
35 | #include "RTIMUHal.h"
36 | #include "IMUDrivers/RTIMU.h"
37 | #include "IMUDrivers/RTIMUNull.h"
38 | #include "IMUDrivers/RTIMUMPU9150.h"
39 | #include "IMUDrivers/RTIMUGD20HM303D.h"
40 | #include "IMUDrivers/RTIMUGD20M303DLHC.h"
41 | #include "IMUDrivers/RTIMULSM9DS0.h"
42 |
43 | #include "IMUDrivers/RTPressure.h"
44 | #include "IMUDrivers/RTPressureBMP180.h"
45 | #include "IMUDrivers/RTPressureLPS25H.h"
46 | #include "IMUDrivers/RTPressureMS5611.h"
47 |
48 | #include "IMUDrivers/RTHumidity.h"
49 | #include "IMUDrivers/RTHumidityHTS221.h"
50 |
51 | #include "RTIMUSettings.h"
52 |
53 |
54 | #endif // _RTIMULIB_H
55 |
--------------------------------------------------------------------------------
/Linux/RTIMULibDemo/SelectIMUDlg.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014-2015, richards-tech, LLC
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | // this software and associated documentation files (the "Software"), to deal in
9 | // the Software without restriction, including without limitation the rights to use,
10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | // Software, and to permit persons to whom the Software is furnished to do so,
12 | // subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #ifndef SELECTIMUDLG_H
25 | #define SELECTIMUDLG_H
26 |
27 | #include
28 | #include
29 | #include
30 |
31 | class RTIMUSettings;
32 |
33 | class SelectIMUDlg : public QDialog
34 | {
35 | Q_OBJECT
36 |
37 | public:
38 | SelectIMUDlg(RTIMUSettings *settings, QWidget *parent = 0);
39 | ~SelectIMUDlg();
40 |
41 | public slots:
42 | void onOk();
43 | void onCancel();
44 | void setSelectAddress(int imuType);
45 |
46 | private:
47 | void layoutWindow();
48 | void setSelectAddress(int imuType, int slaveAddress);
49 |
50 | RTIMUSettings *m_settings;
51 |
52 | QDialogButtonBox *m_buttons;
53 | QComboBox *m_selectBus;
54 | QComboBox *m_selectIMU;
55 | QComboBox *m_selectAddress;
56 |
57 | };
58 |
59 | #endif // SELECTIMUDLG_H
60 |
--------------------------------------------------------------------------------
/Linux/RTIMULibDemoGL/SelectIMUDlg.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014-2015, richards-tech, LLC
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | // this software and associated documentation files (the "Software"), to deal in
9 | // the Software without restriction, including without limitation the rights to use,
10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | // Software, and to permit persons to whom the Software is furnished to do so,
12 | // subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #ifndef SELECTIMUDLG_H
25 | #define SELECTIMUDLG_H
26 |
27 | #include
28 | #include
29 | #include
30 |
31 | class RTIMUSettings;
32 |
33 | class SelectIMUDlg : public QDialog
34 | {
35 | Q_OBJECT
36 |
37 | public:
38 | SelectIMUDlg(RTIMUSettings *settings, QWidget *parent = 0);
39 | ~SelectIMUDlg();
40 |
41 | public slots:
42 | void onOk();
43 | void onCancel();
44 | void setSelectAddress(int imuType);
45 |
46 | private:
47 | void layoutWindow();
48 | void setSelectAddress(int imuType, int slaveAddress);
49 |
50 | RTIMUSettings *m_settings;
51 |
52 | QDialogButtonBox *m_buttons;
53 | QComboBox *m_selectBus;
54 | QComboBox *m_selectIMU;
55 | QComboBox *m_selectAddress;
56 |
57 | };
58 |
59 | #endif // SELECTIMUDLG_H
60 |
--------------------------------------------------------------------------------
/Linux/RTIMULibGL/QtGLLib/QtGLLib.pri:
--------------------------------------------------------------------------------
1 | #////////////////////////////////////////////////////////////////////////////
2 | #//
3 | #// This file is part of RTIMULib
4 | #//
5 | #// Copyright (c) 2014, richards-tech
6 | #//
7 | #// Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | #// this software and associated documentation files (the "Software"), to deal in
9 | #// the Software without restriction, including without limitation the rights to use,
10 | #// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | #// Software, and to permit persons to whom the Software is furnished to do so,
12 | #// subject to the following conditions:
13 | #//
14 | #// The above copyright notice and this permission notice shall be included in all
15 | #// copies or substantial portions of the Software.
16 | #//
17 | #// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | #// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | #// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | #// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | #// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | #// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | INCLUDEPATH += $$PWD
25 | DEPENDPATH += $$PWD
26 |
27 | HEADERS += $$PWD/QtGL.h \
28 | $$PWD/QtGLShader.h \
29 | $$PWD/QtGLTextureShader.h \
30 | $$PWD/QtGLFlatShader.h \
31 | $$PWD/QtGLADSShader.h \
32 | $$PWD/QtGLADSTextureShader.h \
33 | $$PWD/QtGLComponent.h \
34 | $$PWD/QtGLPlaneComponent.h \
35 | $$PWD/QtGLCylinderComponent.h \
36 | $$PWD/QtGLWireCubeComponent.h \
37 | $$PWD/QtGLDiskComponent.h
38 |
39 | SOURCES += $$PWD/QtGL.cpp \
40 | $$PWD/QtGLTextureShader.cpp \
41 | $$PWD/QtGLFlatShader.cpp \
42 | $$PWD/QtGLADSShader.cpp \
43 | $$PWD/QtGLADSTextureShader.cpp \
44 | $$PWD/QtGLComponent.cpp \
45 | $$PWD/QtGLPlaneComponent.cpp \
46 | $$PWD/QtGLCylinderComponent.cpp \
47 | $$PWD/QtGLWireCubeComponent.cpp \
48 | $$PWD/QtGLDiskComponent.cpp
49 |
--------------------------------------------------------------------------------
/RTHost/RTIMULibGL/QtGLLib/QtGLLib.pri:
--------------------------------------------------------------------------------
1 | #////////////////////////////////////////////////////////////////////////////
2 | #//
3 | #// This file is part of RTIMULib
4 | #//
5 | #// Copyright (c) 2014, richards-tech
6 | #//
7 | #// Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | #// this software and associated documentation files (the "Software"), to deal in
9 | #// the Software without restriction, including without limitation the rights to use,
10 | #// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | #// Software, and to permit persons to whom the Software is furnished to do so,
12 | #// subject to the following conditions:
13 | #//
14 | #// The above copyright notice and this permission notice shall be included in all
15 | #// copies or substantial portions of the Software.
16 | #//
17 | #// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | #// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | #// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | #// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | #// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | #// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | INCLUDEPATH += $$PWD
25 | DEPENDPATH += $$PWD
26 |
27 | HEADERS += $$PWD/QtGL.h \
28 | $$PWD/QtGLShader.h \
29 | $$PWD/QtGLTextureShader.h \
30 | $$PWD/QtGLFlatShader.h \
31 | $$PWD/QtGLADSShader.h \
32 | $$PWD/QtGLADSTextureShader.h \
33 | $$PWD/QtGLComponent.h \
34 | $$PWD/QtGLPlaneComponent.h \
35 | $$PWD/QtGLCylinderComponent.h \
36 | $$PWD/QtGLWireCubeComponent.h \
37 | $$PWD/QtGLDiskComponent.h
38 |
39 | SOURCES += $$PWD/QtGL.cpp \
40 | $$PWD/QtGLTextureShader.cpp \
41 | $$PWD/QtGLFlatShader.cpp \
42 | $$PWD/QtGLADSShader.cpp \
43 | $$PWD/QtGLADSTextureShader.cpp \
44 | $$PWD/QtGLComponent.cpp \
45 | $$PWD/QtGLPlaneComponent.cpp \
46 | $$PWD/QtGLCylinderComponent.cpp \
47 | $$PWD/QtGLWireCubeComponent.cpp \
48 | $$PWD/QtGLDiskComponent.cpp
49 |
--------------------------------------------------------------------------------
/RTHost/RTHostIMUGL/RTHostIMUGL.pro:
--------------------------------------------------------------------------------
1 | #////////////////////////////////////////////////////////////////////////////
2 | #//
3 | #// This file is part of RTIMULib
4 | #//
5 | #// Copyright (c) 2014, richards-tech
6 | #//
7 | #// Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | #// this software and associated documentation files (the "Software"), to deal in
9 | #// the Software without restriction, including without limitation the rights to use,
10 | #// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | #// Software, and to permit persons to whom the Software is furnished to do so,
12 | #// subject to the following conditions:
13 | #//
14 | #// The above copyright notice and this permission notice shall be included in all
15 | #// copies or substantial portions of the Software.
16 | #//
17 | #// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | #// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | #// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | #// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | #// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | #// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | greaterThan(QT_MAJOR_VERSION, 4): cache()
25 |
26 | TEMPLATE = app
27 |
28 | TARGET = RTHostIMUGL
29 |
30 | DESTDIR = Output
31 |
32 | QT += core gui opengl
33 |
34 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
35 |
36 | CONFIG += debug_and_release
37 |
38 | target.path = /usr/local/bin
39 |
40 | INSTALLS += target
41 |
42 | DEFINES += QT_NETWORK_LIB
43 |
44 | INCLUDEPATH += GeneratedFiles
45 |
46 | MOC_DIR += GeneratedFiles/moc
47 |
48 | OBJECTS_DIR += objects
49 |
50 | UI_DIR += GeneratedFiles
51 |
52 | RCC_DIR += GeneratedFiles
53 |
54 | include(RTHostIMUGL.pri)
55 | include(../RTSerialPort/src/qextserialport.pri)
56 | include(../../RTIMULib/RTIMULib.pri)
57 | include(../RTHostIMUCommon/RTHostIMUCommon.pri)
58 | include(../RTArduLinkHost/RTArduLinkHost.pri)
59 | include(../RTIMULibGL/RTIMULibGL.pri)
60 |
61 |
62 |
--------------------------------------------------------------------------------
/RTHost/RTSerialPort/src/qextserialport.pri:
--------------------------------------------------------------------------------
1 | exists(../common.pri) {
2 | #For case:
3 | # someone want to copy all file in the src/ directory
4 | # to their project src/ directory and they does not like
5 | # the common.pri file.
6 | #In this case:
7 | # they can just include this file (qextserialport.pri) too.
8 | include(../common.pri)
9 | }
10 | INCLUDEPATH += $$PWD
11 | DEPENDPATH += $$PWD
12 |
13 | qextserialport-library:!qextserialport-buildlib {
14 | # Using QextSerialPort as shared or static library.
15 | LIBS += -L$$QEXTSERIALPORT_LIBDIR -l$$QEXTSERIALPORT_LIBNAME
16 | !qextserialport-static: DEFINES += QEXTSERIALPORT_USING_SHARED
17 | } else {
18 | # Building library(shared or static)
19 | # or including source files
20 | HEADERS += $$PWD/qextserialport.h \
21 | $$PWD/qextserialport_p.h \
22 | $$PWD/qextserialenumerator.h \
23 | $$PWD/qextserialenumerator_p.h \
24 | $$PWD/qextserialport_global.h
25 | SOURCES += $$PWD/qextserialport.cpp \
26 | $$PWD/qextserialenumerator.cpp
27 | unix:SOURCES += $$PWD/qextserialport_unix.cpp
28 | unix:!macx:SOURCES += $$PWD/qextserialenumerator_unix.cpp
29 | macx:SOURCES += $$PWD/qextserialenumerator_osx.cpp
30 | win32:SOURCES += $$PWD/qextserialport_win.cpp \
31 | $$PWD/qextserialenumerator_win.cpp
32 |
33 | # For Windows user who doesn't have Qt4's Private files
34 | win32:contains(QT_VERSION, ^4\\..*\\..*):!exists($$[QT_INSTALL_HEADERS]/QtCore/private/qwineventnotifier_p.h){
35 | DEFINES += QESP_NO_QT4_PRIVATE
36 | HEADERS += $$PWD/qextwineventnotifier_p.h
37 | SOURCES += $$PWD/qextwineventnotifier_p.cpp
38 | }
39 |
40 | # For building shared library only
41 | contains(TEMPLATE, .*lib):contains(CONFIG, shared): DEFINES += QEXTSERIALPORT_BUILD_SHARED
42 | }
43 |
44 | macx:LIBS += -framework IOKit -framework CoreFoundation
45 | win32:LIBS += -lsetupapi -ladvapi32 -luser32
46 |
--------------------------------------------------------------------------------
/Linux/RTIMULibGL/IMUView.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014, richards-tech
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | // this software and associated documentation files (the "Software"), to deal in
9 | // the Software without restriction, including without limitation the rights to use,
10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | // Software, and to permit persons to whom the Software is furnished to do so,
12 | // subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #ifndef IMUVIEW_H
25 | #define IMUVIEW_H
26 |
27 | #include
28 | #include
29 | #include
30 |
31 | #include "VRIMUWidget.h"
32 | #include "RTMath.h"
33 |
34 | #define IMUVIEW_DEPTH -15 // normal IMU position
35 | #define IMUVIEW_RESTART_INTERVAL 1000 // length of time in restart interval
36 |
37 | class VRIMUWidget;
38 |
39 | class IMUView : public QGLWidget, protected QGLFunctions
40 | {
41 | Q_OBJECT
42 |
43 | public:
44 | IMUView(QWidget *parent = NULL);
45 | void updateIMU(RTVector3& pose);
46 |
47 | protected:
48 | void initializeGL();
49 | void resizeGL(int width, int height);
50 | void paintGL();
51 | void closeEvent(QCloseEvent *);
52 |
53 | private:
54 | void setupViewport(int width, int height);
55 |
56 | VRIMUWidget *m_IMUWidget;
57 |
58 | QMutex m_lock;
59 | };
60 |
61 | #endif // IMUVIEW_H
62 |
--------------------------------------------------------------------------------
/RTHost/RTIMULibGL/IMUView.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014, richards-tech
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | // this software and associated documentation files (the "Software"), to deal in
9 | // the Software without restriction, including without limitation the rights to use,
10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | // Software, and to permit persons to whom the Software is furnished to do so,
12 | // subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #ifndef IMUVIEW_H
25 | #define IMUVIEW_H
26 |
27 | #include
28 | #include
29 | #include
30 |
31 | #include "VRIMUWidget.h"
32 | #include "RTMath.h"
33 |
34 | #define IMUVIEW_DEPTH -15 // normal IMU position
35 | #define IMUVIEW_RESTART_INTERVAL 1000 // length of time in restart interval
36 |
37 | class VRIMUWidget;
38 |
39 | class IMUView : public QGLWidget, protected QGLFunctions
40 | {
41 | Q_OBJECT
42 |
43 | public:
44 | IMUView(QWidget *parent = NULL);
45 | void updateIMU(RTVector3& pose);
46 |
47 | protected:
48 | void initializeGL();
49 | void resizeGL(int width, int height);
50 | void paintGL();
51 | void closeEvent(QCloseEvent *);
52 |
53 | private:
54 | void setupViewport(int width, int height);
55 |
56 | VRIMUWidget *m_IMUWidget;
57 |
58 | QMutex m_lock;
59 | };
60 |
61 | #endif // IMUVIEW_H
62 |
--------------------------------------------------------------------------------
/RTIMULib/IMUDrivers/RTPressureLPS25H.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014-2015, richards-tech, LLC
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | // this software and associated documentation files (the "Software"), to deal in
9 | // the Software without restriction, including without limitation the rights to use,
10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | // Software, and to permit persons to whom the Software is furnished to do so,
12 | // subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #ifndef _RTPRESSURELPS25H_H_
25 | #define _RTPRESSURELPS25H_H_
26 |
27 | #include "RTPressure.h"
28 |
29 | class RTIMUSettings;
30 |
31 | class RTPressureLPS25H : public RTPressure
32 | {
33 | public:
34 | RTPressureLPS25H(RTIMUSettings *settings);
35 | ~RTPressureLPS25H();
36 |
37 | virtual const char *pressureName() { return "LPS25H"; }
38 | virtual int pressureType() { return RTPRESSURE_TYPE_LPS25H; }
39 | virtual bool pressureInit();
40 | virtual bool pressureRead(RTIMU_DATA& data);
41 |
42 | private:
43 | unsigned char m_pressureAddr; // I2C address
44 |
45 | RTFLOAT m_pressure; // the current pressure
46 | RTFLOAT m_temperature; // the current temperature
47 | bool m_pressureValid;
48 | bool m_temperatureValid;
49 |
50 | };
51 |
52 | #endif // _RTPRESSURELPS25H_H_
53 |
54 |
--------------------------------------------------------------------------------
/RTIMULib/IMUDrivers/RTHumidity.cpp:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014-2015, richards-tech, LLC
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | // this software and associated documentation files (the "Software"), to deal in
9 | // the Software without restriction, including without limitation the rights to use,
10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | // Software, and to permit persons to whom the Software is furnished to do so,
12 | // subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 |
25 | #include "RTHumidity.h"
26 |
27 | #include "RTHumidityHTS221.h"
28 | #include "RTHumidityHTU21D.h"
29 |
30 | RTHumidity *RTHumidity::createHumidity(RTIMUSettings *settings)
31 | {
32 | switch (settings->m_humidityType) {
33 | case RTHUMIDITY_TYPE_HTS221:
34 | return new RTHumidityHTS221(settings);
35 |
36 | case RTHUMIDITY_TYPE_HTU21D:
37 | return new RTHumidityHTU21D(settings);
38 |
39 | case RTHUMIDITY_TYPE_AUTODISCOVER:
40 | if (settings->discoverHumidity(settings->m_humidityType, settings->m_I2CHumidityAddress)) {
41 | settings->saveSettings();
42 | return RTHumidity::createHumidity(settings);
43 | }
44 | return NULL;
45 |
46 | case RTHUMIDITY_TYPE_NULL:
47 | return NULL;
48 |
49 | default:
50 | return NULL;
51 | }
52 | }
53 |
54 |
55 | RTHumidity::RTHumidity(RTIMUSettings *settings)
56 | {
57 | m_settings = settings;
58 | }
59 |
60 | RTHumidity::~RTHumidity()
61 | {
62 | }
63 |
--------------------------------------------------------------------------------
/RTIMULib/IMUDrivers/RTHumidityHTU21D.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014-2015, richards-tech, LLC
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | // this software and associated documentation files (the "Software"), to deal in
9 | // the Software without restriction, including without limitation the rights to use,
10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | // Software, and to permit persons to whom the Software is furnished to do so,
12 | // subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #ifndef _RTHUMIDITYHTU21D_H_
25 | #define _RTHUMIDITYHTU21D_H_
26 |
27 | #include "RTHumidity.h"
28 |
29 | class RTIMUSettings;
30 |
31 | class RTHumidityHTU21D : public RTHumidity
32 | {
33 | public:
34 | RTHumidityHTU21D(RTIMUSettings *settings);
35 | ~RTHumidityHTU21D();
36 |
37 | virtual const char *humidityName() { return "HTU21D"; }
38 | virtual int humidityType() { return RTHUMIDITY_TYPE_HTU21D; }
39 | virtual bool humidityInit();
40 | virtual bool humidityRead(RTIMU_DATA& data);
41 |
42 | private:
43 | bool processBackground();
44 |
45 | unsigned char m_humidityAddr; // I2C address
46 |
47 | int m_state;
48 | uint64_t m_startTime;
49 | RTFLOAT m_humidity; // the current humidity
50 | RTFLOAT m_temperature; // the current temperature
51 | bool m_humidityValid;
52 | bool m_temperatureValid;
53 |
54 | };
55 |
56 | #endif // _RTHUMIDITYHTU21D_H_
57 |
58 |
--------------------------------------------------------------------------------
/RTIMULib/IMUDrivers/RTIMUNull.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014-2015, richards-tech, LLC
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | // this software and associated documentation files (the "Software"), to deal in
9 | // the Software without restriction, including without limitation the rights to use,
10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | // Software, and to permit persons to whom the Software is furnished to do so,
12 | // subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #ifndef _RTIMUNULL_H
25 | #define _RTIMUNULL_H
26 |
27 | // IMUNull is a dummy IMU that assumes sensor data is coming from elsewhere,
28 | // for example, across a network.
29 | //
30 | // Call IMUInit in the normal way. Then for every update, call setIMUData and then IMURead
31 | // to kick the kalman filter.
32 |
33 | #include "RTIMU.h"
34 |
35 | class RTIMUSettings;
36 |
37 | class RTIMUNull : public RTIMU
38 | {
39 | public:
40 | RTIMUNull(RTIMUSettings *settings);
41 | ~RTIMUNull();
42 |
43 | // The timestamp parameter is assumed to be from RTMath::currentUSecsSinceEpoch()
44 |
45 | void setIMUData(const RTIMU_DATA& data);
46 |
47 | virtual const char *IMUName() { return "Null IMU"; }
48 | virtual int IMUType() { return RTIMU_TYPE_NULL; }
49 | virtual bool IMUInit();
50 | virtual int IMUGetPollInterval();
51 | virtual bool IMURead();
52 | virtual bool IMUGyroBiasValid() { return true; }
53 |
54 | private:
55 | uint64_t m_timestamp;
56 | };
57 |
58 | #endif // _RTIMUNULL_H
59 |
--------------------------------------------------------------------------------
/RTIMULib/IMUDrivers/RTHumidity.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014-2015, richards-tech, LLC
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | // this software and associated documentation files (the "Software"), to deal in
9 | // the Software without restriction, including without limitation the rights to use,
10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | // Software, and to permit persons to whom the Software is furnished to do so,
12 | // subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #ifndef _RTHUMIDITY_H
25 | #define _RTHUMIDITY_H
26 |
27 | #include "RTIMUSettings.h"
28 | #include "RTIMULibDefs.h"
29 | #include "RTHumidityDefs.h"
30 |
31 | class RTHumidity
32 | {
33 | public:
34 | // Humidity sensor objects should always be created with the following call
35 |
36 | static RTHumidity *createHumidity(RTIMUSettings *settings);
37 |
38 | // Constructor/destructor
39 |
40 | RTHumidity(RTIMUSettings *settings);
41 | virtual ~RTHumidity();
42 |
43 | // These functions must be provided by sub classes
44 |
45 | virtual const char *humidityName() = 0; // the name of the humidity sensor
46 | virtual int humidityType() = 0; // the type code of the humidity sensor
47 | virtual bool humidityInit() = 0; // set up the humidity sensor
48 | virtual bool humidityRead(RTIMU_DATA& data) = 0; // get latest value
49 |
50 | protected:
51 | RTIMUSettings *m_settings; // the settings object pointer
52 |
53 | };
54 |
55 | #endif // _RTHUMIDITY_H
56 |
--------------------------------------------------------------------------------
/RTIMULib/IMUDrivers/RTPressure.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014-2015, richards-tech, LLC
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | // this software and associated documentation files (the "Software"), to deal in
9 | // the Software without restriction, including without limitation the rights to use,
10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | // Software, and to permit persons to whom the Software is furnished to do so,
12 | // subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #ifndef _RTPRESSURE_H
25 | #define _RTPRESSURE_H
26 |
27 | #include "RTIMUSettings.h"
28 | #include "RTIMULibDefs.h"
29 | #include "RTPressureDefs.h"
30 |
31 | class RTPressure
32 | {
33 | public:
34 | // Pressure sensor objects should always be created with the following call
35 |
36 | static RTPressure *createPressure(RTIMUSettings *settings);
37 |
38 | // Constructor/destructor
39 |
40 | RTPressure(RTIMUSettings *settings);
41 | virtual ~RTPressure();
42 |
43 | // These functions must be provided by sub classes
44 |
45 | virtual const char *pressureName() = 0; // the name of the pressure sensor
46 | virtual int pressureType() = 0; // the type code of the pressure sensor
47 | virtual bool pressureInit() = 0; // set up the pressure sensor
48 | virtual bool pressureRead(RTIMU_DATA& data) = 0; // get latest value
49 |
50 | protected:
51 | RTIMUSettings *m_settings; // the settings object pointer
52 |
53 | };
54 |
55 | #endif // _RTPRESSURE_H
56 |
--------------------------------------------------------------------------------
/RTIMULib/RTFusionRTQF.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014-2015, richards-tech, LLC
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | // this software and associated documentation files (the "Software"), to deal in
9 | // the Software without restriction, including without limitation the rights to use,
10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | // Software, and to permit persons to whom the Software is furnished to do so,
12 | // subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 |
25 | #ifndef _RTFUSIONRTQF_H
26 | #define _RTFUSIONRTQF_H
27 |
28 | #include "RTFusion.h"
29 |
30 | class RTFusionRTQF : public RTFusion
31 | {
32 | public:
33 | RTFusionRTQF();
34 | ~RTFusionRTQF();
35 |
36 | // fusionType returns the type code of the fusion algorithm
37 |
38 | virtual int fusionType() { return RTFUSION_TYPE_RTQF; }
39 |
40 | // reset() resets the state but keeps any setting changes (such as enables)
41 |
42 | void reset();
43 |
44 | // newIMUData() should be called for subsequent updates
45 | // deltaTime is in units of seconds
46 |
47 | void newIMUData(RTIMU_DATA& data, const RTIMUSettings *settings);
48 |
49 | private:
50 | void predict();
51 | void update();
52 |
53 | RTVector3 m_gyro; // unbiased gyro data
54 | RTFLOAT m_timeDelta; // time between predictions
55 |
56 | RTQuaternion m_stateQ; // quaternion state vector
57 | RTQuaternion m_stateQError; // difference between stateQ and measuredQ
58 |
59 | int m_sampleNumber;
60 | };
61 |
62 | #endif // _RTFUSIONRTQF_H
63 |
--------------------------------------------------------------------------------
/RTHost/RTArduLinkHost/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #////////////////////////////////////////////////////////////////////////////
2 | #//
3 | #// This file is part of RTIMULib
4 | #//
5 | #// Copyright (c) 2014, richards-tech
6 | #//
7 | #// Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | #// this software and associated documentation files (the "Software"), to deal in
9 | #// the Software without restriction, including without limitation the rights to use,
10 | #// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | #// Software, and to permit persons to whom the Software is furnished to do so,
12 | #// subject to the following conditions:
13 | #//
14 | #// The above copyright notice and this permission notice shall be included in all
15 | #// copies or substantial portions of the Software.
16 | #//
17 | #// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | #// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | #// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | #// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | #// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | #// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #// The cmake support was based on work by Moritz Fischer at ettus.com.
25 | #// Original copyright notice:
26 | #
27 | # Copyright 2014 Ettus Research LLC
28 | #
29 |
30 | SET(ARDULINK_SRCS
31 | RTArduLinkHost.cpp
32 | RTArduLinkUtils.cpp)
33 |
34 | INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../RTSerialPort/src)
35 | SET(CMAKE_AUTOMOC ON)
36 |
37 | IF(DEFINED QT5)
38 | FIND_PACKAGE(Qt5Core REQUIRED)
39 | IF(WIN32)
40 | ADD_LIBRARY(RTArduLinkHost STATIC ${ARDULINK_SRCS})
41 | ELSE(WIN32)
42 | ADD_LIBRARY(RTArduLinkHost SHARED ${ARDULINK_SRCS})
43 | ENDIF(WIN32)
44 | qt5_use_modules(RTArduLinkHost Core)
45 | TARGET_LINK_LIBRARIES(RTArduLinkHost RTSerialPort)
46 | ELSE(DEFINED QT5)
47 | FIND_PACKAGE(Qt4 REQUIRED)
48 | INCLUDE(${QT_USE_FILE})
49 | ADD_DEFINITIONS(${QT_DEFINITIONS})
50 | IF(WIN32)
51 | ADD_LIBRARY(RTArduLinkHost STATIC ${ARDULINK_SRCS})
52 | ELSE(WIN32)
53 | ADD_LIBRARY(RTArduLinkHost SHARED ${ARDULINK_SRCS})
54 | ENDIF(WIN32)
55 | TARGET_LINK_LIBRARIES(RTArduLinkHost RTSerialPort ${QT_LIBRARIES})
56 | ENDIF(DEFINED QT5)
57 |
58 | INSTALL(TARGETS RTArduLinkHost DESTINATION lib)
59 |
--------------------------------------------------------------------------------
/RTHost/RTHostIMU/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #////////////////////////////////////////////////////////////////////////////
2 | #//
3 | #// This file is part of RTIMULib
4 | #//
5 | #// Copyright (c) 2014, richards-tech
6 | #//
7 | #// Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | #// this software and associated documentation files (the "Software"), to deal in
9 | #// the Software without restriction, including without limitation the rights to use,
10 | #// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | #// Software, and to permit persons to whom the Software is furnished to do so,
12 | #// subject to the following conditions:
13 | #//
14 | #// The above copyright notice and this permission notice shall be included in all
15 | #// copies or substantial portions of the Software.
16 | #//
17 | #// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | #// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | #// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | #// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | #// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | #// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #// The cmake support was based on work by Moritz Fischer at ettus.com.
25 | #// Original copyright notice:
26 | #
27 | # Copyright 2014 Ettus Research LLC
28 | #
29 |
30 | SET(HOST_SRCS
31 | ${CMAKE_CURRENT_SOURCE_DIR}/RTHostIMU.cpp
32 | ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp)
33 |
34 | INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
35 | INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
36 |
37 | SET(CMAKE_AUTOMOC ON)
38 |
39 | IF(DEFINED QT5)
40 | FIND_PACKAGE(Qt5Widgets)
41 | FIND_PACKAGE(Qt5Gui)
42 | qt5_wrap_ui(UI_HEADERS RTHostIMU.ui)
43 | ADD_EXECUTABLE(RTHostIMU ${HOST_SRCS} ${UI_HEADERS})
44 | TARGET_LINK_LIBRARIES(RTHostIMU
45 | RTIMULib
46 | RTHostIMUCommon
47 | RTArduLinkHost
48 | ${Qt5Core_QTMAIN_LIBRARIES})
49 | qt5_use_modules(RTHostIMU Widgets Gui)
50 | ELSE(DEFINED QT5)
51 | FIND_PACKAGE(Qt4 REQUIRED)
52 | INCLUDE(${QT_USE_FILE})
53 | ADD_DEFINITIONS(${QT_DEFINITIONS})
54 | QT4_WRAP_UI(UI_HEADERS RTHostIMU.ui)
55 | ADD_EXECUTABLE(RTHostIMU ${HOST_SRCS} ${UI_HEADERS})
56 | TARGET_LINK_LIBRARIES(RTHostIMU RTIMULib RTHostIMUCommon RTArduLinkHost ${QT_LIBRARIES})
57 | ENDIF(DEFINED QT5)
58 |
59 | INSTALL(TARGETS RTHostIMU DESTINATION bin)
60 |
61 |
--------------------------------------------------------------------------------
/RTIMULib/IMUDrivers/RTPressure.cpp:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014-2015, richards-tech, LLC
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | // this software and associated documentation files (the "Software"), to deal in
9 | // the Software without restriction, including without limitation the rights to use,
10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | // Software, and to permit persons to whom the Software is furnished to do so,
12 | // subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 |
25 | #include "RTPressure.h"
26 |
27 | #include "RTPressureBMP180.h"
28 | #include "RTPressureLPS25H.h"
29 | #include "RTPressureMS5611.h"
30 | #include "RTPressureMS5637.h"
31 |
32 | RTPressure *RTPressure::createPressure(RTIMUSettings *settings)
33 | {
34 | switch (settings->m_pressureType) {
35 | case RTPRESSURE_TYPE_BMP180:
36 | return new RTPressureBMP180(settings);
37 |
38 | case RTPRESSURE_TYPE_LPS25H:
39 | return new RTPressureLPS25H(settings);
40 |
41 | case RTPRESSURE_TYPE_MS5611:
42 | return new RTPressureMS5611(settings);
43 |
44 | case RTPRESSURE_TYPE_MS5637:
45 | return new RTPressureMS5637(settings);
46 |
47 | case RTPRESSURE_TYPE_AUTODISCOVER:
48 | if (settings->discoverPressure(settings->m_pressureType, settings->m_I2CPressureAddress)) {
49 | settings->saveSettings();
50 | return RTPressure::createPressure(settings);
51 | }
52 | return NULL;
53 |
54 | case RTPRESSURE_TYPE_NULL:
55 | return NULL;
56 |
57 | default:
58 | return NULL;
59 | }
60 | }
61 |
62 |
63 | RTPressure::RTPressure(RTIMUSettings *settings)
64 | {
65 | m_settings = settings;
66 | }
67 |
68 | RTPressure::~RTPressure()
69 | {
70 | }
71 |
--------------------------------------------------------------------------------
/Linux/python/tests/Fusion10.py:
--------------------------------------------------------------------------------
1 | import sys, getopt
2 |
3 | sys.path.append('.')
4 | import RTIMU
5 | import os.path
6 | import time
7 | import math
8 |
9 | SETTINGS_FILE = "RTIMULib"
10 |
11 | # computeHeight() - the conversion uses the formula:
12 | #
13 | # h = (T0 / L0) * ((p / P0)**(-(R* * L0) / (g0 * M)) - 1)
14 | #
15 | # where:
16 | # h = height above sea level
17 | # T0 = standard temperature at sea level = 288.15
18 | # L0 = standard temperatur elapse rate = -0.0065
19 | # p = measured pressure
20 | # P0 = static pressure = 1013.25
21 | # g0 = gravitational acceleration = 9.80665
22 | # M = mloecular mass of earth's air = 0.0289644
23 | # R* = universal gas constant = 8.31432
24 | #
25 | # Given the constants, this works out to:
26 | #
27 | # h = 44330.8 * (1 - (p / P0)**0.190263)
28 |
29 | def computeHeight(pressure):
30 | return 44330.8 * (1 - pow(pressure / 1013.25, 0.190263));
31 |
32 | print("Using settings file " + SETTINGS_FILE + ".ini")
33 | if not os.path.exists(SETTINGS_FILE + ".ini"):
34 | print("Settings file does not exist, will be created")
35 |
36 | s = RTIMU.Settings(SETTINGS_FILE)
37 | imu = RTIMU.RTIMU(s)
38 | pressure = RTIMU.RTPressure(s)
39 |
40 | print("IMU Name: " + imu.IMUName())
41 | print("Pressure Name: " + pressure.pressureName())
42 |
43 | if (not imu.IMUInit()):
44 | print("IMU Init Failed")
45 | sys.exit(1)
46 | else:
47 | print("IMU Init Succeeded");
48 |
49 | # this is a good time to set any fusion parameters
50 |
51 | imu.setSlerpPower(0.02)
52 | imu.setGyroEnable(True)
53 | imu.setAccelEnable(True)
54 | imu.setCompassEnable(True)
55 |
56 | if (not pressure.pressureInit()):
57 | print("Pressure sensor Init Failed")
58 | else:
59 | print("Pressure sensor Init Succeeded")
60 |
61 | poll_interval = imu.IMUGetPollInterval()
62 | print("Recommended Poll Interval: %dmS\n" % poll_interval)
63 |
64 | while True:
65 | if imu.IMURead():
66 | # x, y, z = imu.getFusionData()
67 | # print("%f %f %f" % (x,y,z))
68 | data = imu.getIMUData()
69 | (data["pressureValid"], data["pressure"], data["temperatureValid"], data["temperature"]) = pressure.pressureRead()
70 | fusionPose = data["fusionPose"]
71 | print("r: %f p: %f y: %f" % (math.degrees(fusionPose[0]),
72 | math.degrees(fusionPose[1]), math.degrees(fusionPose[2])))
73 | if (data["pressureValid"]):
74 | print("Pressure: %f, height above sea level: %f" % (data["pressure"], computeHeight(data["pressure"])))
75 | if (data["temperatureValid"]):
76 | print("Temperature: %f" % (data["temperature"]))
77 | time.sleep(poll_interval*1.0/1000.0)
78 |
79 |
--------------------------------------------------------------------------------
/RTHost/RTHostIMUCommon/RTArduLinkIMUDefs.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014, richards-tech
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | // this software and associated documentation files (the "Software"), to deal in
9 | // the Software without restriction, including without limitation the rights to use,
10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | // Software, and to permit persons to whom the Software is furnished to do so,
12 | // subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 |
25 | #ifndef RTARDULINKIMUDEFS_H_
26 | #define RTARDULINKIMUDEFS_H_
27 |
28 | #include "RTArduLinkDefs.h"
29 |
30 | // Defines for the format of the IMU record passed between the Arduino and the
31 | // host system. Both Arduino and host system should use identical copies of this file.
32 |
33 | // RTARDULINKIMU_MESSAGE is used to send messages to the host.
34 | // Note: the gyro bias and mag cal state come back in the messageParam field
35 |
36 | typedef struct
37 | {
38 | RTARDULINK_UC4 timestamp; // timestamp in mS
39 | float gyro[3]; // the de-biased gyro data in rads/sec
40 | float accel[3]; // raw accel data in gs
41 | float mag[3]; // magnetometer data in uT
42 | } RTARDULINKIMU_MESSAGE;
43 |
44 |
45 | // Message type
46 |
47 | #define RTARDULINK_MESSAGE_IMU (RTARDULINK_MESSAGE_CUSTOM + 1)
48 |
49 | // Defines for the messageParam field
50 |
51 | #define RTARDULINKIMU_STATE_GYRO_BIAS_VALID 1 // bit 0 set if bias is valid
52 | #define RTARDULINKIMU_STATE_MAG_CAL_VALID 2 // bit 1 set if mag calibration is valid
53 |
54 | #endif /* RTARDULINKIMUDEFS_H_ */
55 |
--------------------------------------------------------------------------------
/RTIMULib/IMUDrivers/RTHumidityHTS221.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014-2015, richards-tech, LLC
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | // this software and associated documentation files (the "Software"), to deal in
9 | // the Software without restriction, including without limitation the rights to use,
10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | // Software, and to permit persons to whom the Software is furnished to do so,
12 | // subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #ifndef _RTHUMIDITYHTS221_H_
25 | #define _RTHUMIDITYHTS221_H_
26 |
27 | #include "RTHumidity.h"
28 |
29 | class RTIMUSettings;
30 |
31 | class RTHumidityHTS221 : public RTHumidity
32 | {
33 | public:
34 | RTHumidityHTS221(RTIMUSettings *settings);
35 | ~RTHumidityHTS221();
36 |
37 | virtual const char *humidityName() { return "HTS221"; }
38 | virtual int humidityType() { return RTHUMIDITY_TYPE_HTS221; }
39 | virtual bool humidityInit();
40 | virtual bool humidityRead(RTIMU_DATA& data);
41 |
42 | private:
43 | unsigned char m_humidityAddr; // I2C address
44 |
45 | RTFLOAT m_humidity; // the current humidity
46 | RTFLOAT m_temperature; // the current temperature
47 | RTFLOAT m_temperature_m; // temperature calibration slope
48 | RTFLOAT m_temperature_c; // temperature calibration y intercept
49 | RTFLOAT m_humidity_m; // humidity calibration slope
50 | RTFLOAT m_humidity_c; // humidity calibration y intercept
51 | bool m_humidityValid;
52 | bool m_temperatureValid;
53 |
54 | };
55 |
56 | #endif // _RTHUMIDITYHTS221_H_
57 |
58 |
--------------------------------------------------------------------------------
/RTHost/RTHostIMUCommon/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #////////////////////////////////////////////////////////////////////////////
2 | #//
3 | #// This file is part of RTIMULib
4 | #//
5 | #// Copyright (c) 2014, richards-tech
6 | #//
7 | #// Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | #// this software and associated documentation files (the "Software"), to deal in
9 | #// the Software without restriction, including without limitation the rights to use,
10 | #// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | #// Software, and to permit persons to whom the Software is furnished to do so,
12 | #// subject to the following conditions:
13 | #//
14 | #// The above copyright notice and this permission notice shall be included in all
15 | #// copies or substantial portions of the Software.
16 | #//
17 | #// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | #// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | #// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | #// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | #// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | #// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #// The cmake support was based on work by Moritz Fischer at ettus.com.
25 | #// Original copyright notice:
26 | #
27 | # Copyright 2014 Ettus Research LLC
28 | #
29 |
30 | SET(IMUCOMMON_SRCS
31 | AccelCalDlg.cpp
32 | MagCalDlg.cpp
33 | RTHostIMUClient.cpp
34 | RTHostIMUThread.cpp
35 | SelectFusionDlg.cpp)
36 |
37 | SET(CMAKE_AUTOMOC ON)
38 |
39 | IF(DEFINED QT5)
40 | FIND_PACKAGE(Qt5Core REQUIRED)
41 | FIND_PACKAGE(Qt5Widgets)
42 | FIND_PACKAGE(Qt5Gui)
43 | IF(WIN32)
44 | ADD_LIBRARY(RTHostIMUCommon STATIC ${IMUCOMMON_SRCS})
45 | ELSE(WIN32)
46 | ADD_LIBRARY(RTHostIMUCommon SHARED ${IMUCOMMON_SRCS})
47 | ENDIF(WIN32)
48 | qt5_use_modules(RTHostIMUCommon Core Widgets Gui)
49 | TARGET_LINK_LIBRARIES(RTHostIMUCommon RTArduLinkHost RTIMULib)
50 | ELSE(DEFINED QT5)
51 | FIND_PACKAGE(Qt4 REQUIRED)
52 | INCLUDE(${QT_USE_FILE})
53 | ADD_DEFINITIONS(${QT_DEFINITIONS})
54 | IF(WIN32)
55 | ADD_LIBRARY(RTHostIMUCommon STATIC ${IMUCOMMON_SRCS})
56 | ELSE(WIN32)
57 | ADD_LIBRARY(RTHostIMUCommon SHARED ${IMUCOMMON_SRCS})
58 | ENDIF(WIN32)
59 | TARGET_LINK_LIBRARIES(RTHostIMUCommon RTArduLinkHost RTIMULib ${QT_LIBRARIES})
60 | ENDIF(DEFINED QT5)
61 | INSTALL(TARGETS RTHostIMUCommon DESTINATION lib)
62 |
63 |
--------------------------------------------------------------------------------
/RTHost/RTHostIMUCommon/RTHostIMUClient.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014, richards-tech
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | // this software and associated documentation files (the "Software"), to deal in
9 | // the Software without restriction, including without limitation the rights to use,
10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | // Software, and to permit persons to whom the Software is furnished to do so,
12 | // subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #ifndef _RTHOSTIMUCLIENT_H
25 | #define _RTHOSTIMUCLIENT_H
26 |
27 | #include "RTArduLinkHost.h"
28 | #include "IMUDrivers/RTIMU.h"
29 | #include "RTArduLinkIMUDefs.h"
30 |
31 | #include
32 | #include
33 |
34 | // setting keys for client data
35 |
36 | #define RTARDULINKHOST_SETTINGS_PORT "port"
37 | #define RTARDULINKHOST_SETTINGS_SPEED "speed"
38 |
39 | class RTIMUSettings;
40 |
41 | class RTHostIMUClient : public RTArduLinkHost, public RTIMU
42 | {
43 | Q_OBJECT
44 |
45 | public:
46 | RTHostIMUClient(RTIMUSettings *settings);
47 | ~RTHostIMUClient();
48 |
49 | virtual const char *IMUName() { return "RTArduLink"; }
50 | virtual int IMUType() { return 0; }
51 | virtual bool IMUInit();
52 | virtual bool IMURead();
53 | virtual int IMUGetPollInterval();
54 |
55 | signals:
56 | void updateInputStatus(int inputNumber, bool value);
57 |
58 | protected:
59 | void processCustomMessage(RTARDULINKHOST_PORT *portInfo, unsigned int messageAddress,
60 | unsigned char messageType, unsigned char messageParam, unsigned char *data, int dataLength);
61 |
62 | private:
63 | QQueue m_messageQ;
64 | QMutex m_lock;
65 | };
66 |
67 | extern BaudRateType speedMap[];
68 | extern const char *speedString[];
69 |
70 | #endif // _RTHOSTIMUCLIENT_H
71 |
--------------------------------------------------------------------------------
/RTHost/RTSerialPort/README:
--------------------------------------------------------------------------------
1 |
2 | = About QextSerialPort =
3 |
4 | QextSerialPort provides an interface to old fashioned serial ports for Qt-based applications. It currently supports Mac OS X, Windows, Linux, FreeBSD.
5 |
6 | http://code.google.com/p/qextserialport/
7 |
8 | == How to use (1) ==
9 |
10 | * Download the source code. Note: [http://mercurial.selenic.com/downloads/ Mercurial] is needed .
11 |
12 | hg clone https://code.google.com/r/dbzhang800-qextserialport/
13 |
14 |
15 | * Put the source code in any directory you like. For example, 3rdparty:
16 |
17 | |-- project.pro
18 | |-- ....
19 | |-- 3rdparty\
20 | | |-- qextserialport\
21 | | |
22 |
23 | * Add following line to your qmake project file:
24 |
25 | include(3rdparty/qextserialport/src/qextserialport.pri)
26 |
27 | * Using QextSerialPort in your code. Enjoy it!
28 |
29 | #include "qextserialport.h"
30 | ....
31 | QextSerialPort * port = new QextSerialPort();
32 | ....
33 |
34 | == How to use (2) ==
35 |
36 | It's very easy to compile QextSerialPort directly into your application(see above section), however, we would prefer to use it as a static or shared library.
37 |
38 | * Download the source code, and put it in any location you like.
39 |
40 | |-- yourpath\
41 | | |-- qextserialport\
42 | | |
43 |
44 | * Create a config.pri file, and put into qextserialport's directory.
45 |
46 | |-- yourpath\
47 | | |-- qextserialport\
48 | | | |-- config.pri
49 |
50 | * Contents of config_example.pri
51 |
52 | # uncomment the following line if you want to use qextserialport as library
53 | # QEXTSERIALPORT_LIBRARY = yes
54 |
55 | # uncomment the following line too if you want to use it as static library
56 | # QEXTSERIALPORT_STATIC = yes
57 |
58 | * Goto qextserialport/buildlib, and run following command to generate library.
59 |
60 | qmake
61 | make (or nmake)
62 |
63 | * Add following line to your qmake project file. Enjoy it!
64 |
65 | include(pathToQextserialport/src/qextserialport.pri)
66 |
67 | == Build (optional) ==
68 |
69 | * Run qmake from the toplevel directory.(If your has create a config.pri file properly, this will generate the library, and then all examples will use the library. Otherwise, qextserialport will be directly compiled into the examples)
70 |
71 | qmake (or qmake -r)
72 | make (or nmake)
73 |
74 | * Run qdoc3 from the doc directory.
75 |
76 | qdoc3 qextserialport.qdocconf
77 |
78 |
--------------------------------------------------------------------------------
/Linux/RTIMULibDemo/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #////////////////////////////////////////////////////////////////////////////
2 | #//
3 | #// This file is part of RTIMULib
4 | #//
5 | #// Copyright (c) 2014, richards-tech
6 | #//
7 | #// Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | #// this software and associated documentation files (the "Software"), to deal in
9 | #// the Software without restriction, including without limitation the rights to use,
10 | #// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | #// Software, and to permit persons to whom the Software is furnished to do so,
12 | #// subject to the following conditions:
13 | #//
14 | #// The above copyright notice and this permission notice shall be included in all
15 | #// copies or substantial portions of the Software.
16 | #//
17 | #// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | #// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | #// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | #// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | #// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | #// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #// The cmake support was based on work by Moritz Fischer at ettus.com.
25 | #// Original copyright notice:
26 | #
27 | # Copyright 2014 Ettus Research LLC
28 | #
29 |
30 | SET(DEMO_SRCS
31 | AccelCalDlg.cpp
32 | RTIMULibDemo.cpp
33 | IMUThread.cpp
34 | MagCalDlg.cpp
35 | SelectIMUDlg.cpp
36 | SelectFusionDlg.cpp
37 | main.cpp)
38 |
39 | INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
40 | INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
41 |
42 | SET(CMAKE_AUTOMOC ON)
43 |
44 | IF(DEFINED QT5)
45 | FIND_PACKAGE(Qt5Widgets)
46 | FIND_PACKAGE(Qt5Gui)
47 | qt5_wrap_ui(UI_HEADERS RTIMULibDemo.ui)
48 | ADD_EXECUTABLE(RTIMULibDemo ${DEMO_SRCS} ${UI_HEADERS})
49 | TARGET_LINK_LIBRARIES(RTIMULibDemo RTIMULib)
50 | qt5_use_modules(RTIMULibDemo Widgets Gui)
51 | INSTALL(TARGETS RTIMULibDemo DESTINATION bin)
52 | ELSE(DEFINED QT5)
53 | FIND_PACKAGE(Qt4)
54 | IF(QT4_FOUND)
55 | QT4_WRAP_UI(UI_HEADERS RTIMULibDemo.ui)
56 | INCLUDE(${QT_USE_FILE})
57 | ADD_DEFINITIONS(${QT_DEFINITIONS})
58 | ADD_EXECUTABLE(RTIMULibDemo ${DEMO_SRCS} ${UI_HEADERS})
59 | TARGET_LINK_LIBRARIES(RTIMULibDemo RTIMULib ${QT_LIBRARIES})
60 | INSTALL(TARGETS RTIMULibDemo DESTINATION bin)
61 | ELSE(QT4_FOUND)
62 | MESSAGE(STATUS "Qt4 not found")
63 | ENDIF(QT4_FOUND)
64 | ENDIF(DEFINED QT5)
65 |
66 |
--------------------------------------------------------------------------------
/RTIMULib/IMUDrivers/RTPressureMS5611.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014-2015, richards-tech, LLC
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | // this software and associated documentation files (the "Software"), to deal in
9 | // the Software without restriction, including without limitation the rights to use,
10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | // Software, and to permit persons to whom the Software is furnished to do so,
12 | // subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #ifndef _RTPRESSUREMS5611_H_
25 | #define _RTPRESSUREMS5611_H_
26 |
27 | #include "RTPressure.h"
28 |
29 | // State definitions
30 |
31 | #define MS5611_STATE_IDLE 0
32 | #define MS5611_STATE_TEMPERATURE 1
33 | #define MS5611_STATE_PRESSURE 2
34 |
35 | class RTIMUSettings;
36 |
37 | class RTPressureMS5611 : public RTPressure
38 | {
39 | public:
40 | RTPressureMS5611(RTIMUSettings *settings);
41 | ~RTPressureMS5611();
42 |
43 | virtual const char *pressureName() { return "MS5611"; }
44 | virtual int pressureType() { return RTPRESSURE_TYPE_MS5611; }
45 | virtual bool pressureInit();
46 | virtual bool pressureRead(RTIMU_DATA& data);
47 |
48 | private:
49 | void pressureBackground();
50 | void setTestData();
51 |
52 | unsigned char m_pressureAddr; // I2C address
53 | RTFLOAT m_pressure; // the current pressure
54 | RTFLOAT m_temperature; // the current temperature
55 |
56 | int m_state;
57 |
58 | uint16_t m_calData[6]; // calibration data
59 |
60 | uint32_t m_D1;
61 | uint32_t m_D2;
62 |
63 | uint64_t m_timer; // used to time coversions
64 |
65 | bool m_validReadings;
66 | };
67 |
68 | #endif // _RTPRESSUREMS5611_H_
69 |
70 |
--------------------------------------------------------------------------------
/RTIMULib/IMUDrivers/RTPressureMS5637.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014-2015, richards-tech, LLC
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | // this software and associated documentation files (the "Software"), to deal in
9 | // the Software without restriction, including without limitation the rights to use,
10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | // Software, and to permit persons to whom the Software is furnished to do so,
12 | // subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #ifndef _RTPRESSUREMS5637_H_
25 | #define _RTPRESSUREMS5637_H_
26 |
27 | #include "RTPressure.h"
28 |
29 | // State definitions
30 |
31 | #define MS5637_STATE_IDLE 0
32 | #define MS5637_STATE_TEMPERATURE 1
33 | #define MS5637_STATE_PRESSURE 2
34 |
35 | class RTIMUSettings;
36 |
37 | class RTPressureMS5637 : public RTPressure
38 | {
39 | public:
40 | RTPressureMS5637(RTIMUSettings *settings);
41 | ~RTPressureMS5637();
42 |
43 | virtual const char *pressureName() { return "MS5637"; }
44 | virtual int pressureType() { return RTPRESSURE_TYPE_MS5611; }
45 | virtual bool pressureInit();
46 | virtual bool pressureRead(RTIMU_DATA& data);
47 |
48 | private:
49 | void pressureBackground();
50 | void setTestData();
51 |
52 | unsigned char m_pressureAddr; // I2C address
53 | RTFLOAT m_pressure; // the current pressure
54 | RTFLOAT m_temperature; // the current temperature
55 |
56 | int m_state;
57 |
58 | uint16_t m_calData[6]; // calibration data
59 |
60 | uint32_t m_D1;
61 | uint32_t m_D2;
62 |
63 | uint64_t m_timer; // used to time coversions
64 |
65 | bool m_validReadings;
66 | };
67 |
68 | #endif // _RTPRESSUREMS5637_H_
69 |
70 |
--------------------------------------------------------------------------------
/RTIMULib/RTIMULibDefs.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014-2015, richards-tech, LLC
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | // this software and associated documentation files (the "Software"), to deal in
9 | // the Software without restriction, including without limitation the rights to use,
10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | // Software, and to permit persons to whom the Software is furnished to do so,
12 | // subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | // The MPU-9250 and SPI driver code is based on code generously supplied by
25 | // staslock@gmail.com (www.clickdrive.io)
26 |
27 | #ifndef _RTIMULIBDEFS_H
28 | #define _RTIMULIBDEFS_H
29 |
30 | #include "RTMath.h"
31 | #include "IMUDrivers/RTIMUDefs.h"
32 |
33 | // these defines describe the various fusion filter options
34 |
35 | #define RTFUSION_TYPE_NULL 0 // just a dummy to keep things happy if not needed
36 | #define RTFUSION_TYPE_KALMANSTATE4 1 // kalman state is the quaternion pose
37 | #define RTFUSION_TYPE_RTQF 2 // RT quaternion fusion
38 |
39 | #define RTFUSION_TYPE_COUNT 3 // number of fusion algorithm types
40 |
41 | // This is a convenience structure that can be used to pass IMU data around
42 |
43 | typedef struct
44 | {
45 | uint64_t timestamp;
46 | bool fusionPoseValid;
47 | RTVector3 fusionPose;
48 | bool fusionQPoseValid;
49 | RTQuaternion fusionQPose;
50 | bool gyroValid;
51 | RTVector3 gyro;
52 | bool accelValid;
53 | RTVector3 accel;
54 | bool compassValid;
55 | RTVector3 compass;
56 | bool pressureValid;
57 | RTFLOAT pressure;
58 | bool temperatureValid;
59 | RTFLOAT temperature;
60 | bool humidityValid;
61 | RTFLOAT humidity;
62 | } RTIMU_DATA;
63 |
64 | #endif // _RTIMULIBDEFS_H
65 |
--------------------------------------------------------------------------------
/RTHost/RTArduLinkHost/RTArduLinkUtils.h:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTArduLink
4 | //
5 | // Copyright (c) 2014 richards-tech
6 | //
7 | // Permission is hereby granted, free of charge,
8 | // to any person obtaining a copy of
9 | // this software and associated documentation files
10 | // (the "Software"), to deal in the Software without
11 | // restriction, including without limitation the rights
12 | // to use, copy, modify, merge, publish, distribute,
13 | // sublicense, and/or sell copies of the Software, and
14 | // to permit persons to whom the Software is furnished
15 | // to do so, subject to the following conditions:
16 | //
17 | // The above copyright notice and this permission notice
18 | // shall be included in all copies or substantial portions
19 | // of the Software.
20 | //
21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
22 | // ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
23 | // TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
24 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
25 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
26 | // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
28 | // IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29 | // DEALINGS IN THE SOFTWARE.
30 |
31 | #ifndef _RTARDULINKUTILS_H
32 | #define _RTARDULINKUTILS_H
33 |
34 | #include "RTArduLinkDefs.h"
35 |
36 | // Function defs
37 |
38 | void RTArduLinkRXFrameInit(RTARDULINK_RXFRAME *RXFrame, RTARDULINK_FRAME *frameBuffer); // initializes RTARDULINK_RXFRAME for a new frame
39 | bool RTArduLinkReassemble(RTARDULINK_RXFRAME *RXFrame, unsigned char data); // adds a byte to the reassembly, returns false if error
40 |
41 | // Checksum utilities
42 |
43 | void RTArduLinkSetChecksum(RTARDULINK_FRAME *frame); // sets the checksum field prior to transmission
44 | bool RTArduLinkCheckChecksum(RTARDULINK_FRAME *frame); // checks the checksum field after reception - returns true if ok, false if error
45 |
46 | // Type conversion utilities
47 |
48 | long RTArduLinkConvertUC4ToLong(RTARDULINK_UC4 uc4); // converts a 4 byte array to a signed long
49 | void RTArduLinkConvertLongToUC4(long val, RTARDULINK_UC4 uc4); // converts a long to a four byte array
50 | int RTArduLinkConvertUC2ToInt(RTARDULINK_UC2 uc2); // converts a 2 byte array to a signed integer
51 | unsigned int RTArduLinkConvertUC2ToUInt(RTARDULINK_UC2 uc2);// converts a 2 byte array to an unsigned integer
52 | void RTArduLinkConvertIntToUC2(int val, RTARDULINK_UC2 uc2);// converts an integer to a two byte array
53 | void RTArduLinkCopyUC2(RTARDULINK_UC2 destUC2, RTARDULINK_UC2 sourceUC2); // copies a UC2
54 |
55 | #endif // _RTARDULINKUTILS_H
56 |
--------------------------------------------------------------------------------
/Linux/RTIMULibGL/QtGLLib/QtGLFlatShader.cpp:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014, richards-tech
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | // this software and associated documentation files (the "Software"), to deal in
9 | // the Software without restriction, including without limitation the rights to use,
10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | // Software, and to permit persons to whom the Software is furnished to do so,
12 | // subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #include "QtGL.h"
25 |
26 | QtGLFlatShader::QtGLFlatShader(QObject *parent)
27 | : QtGLShader(parent)
28 | {
29 | #define PROGRAM_VERTEX_ATTRIBUTE 0
30 |
31 | m_type = QTGLSHADER_FLAT;
32 |
33 | m_vshader = new QGLShader(QGLShader::Vertex, parent);
34 | const char *vsrc =
35 | "attribute highp vec4 vertex;\n"
36 | "uniform mediump mat4 matrix;\n"
37 | "void main(void)\n"
38 | "{\n"
39 | " gl_Position = matrix * vertex;\n"
40 | "}\n";
41 | m_vshader->compileSourceCode(vsrc);
42 |
43 | m_fshader = new QGLShader(QGLShader::Fragment, parent);
44 | const char *fsrc =
45 | "uniform mediump vec4 color;\n"
46 | "void main(void)\n"
47 | "{\n"
48 | " gl_FragColor = color;\n"
49 | "}\n";
50 | m_fshader->compileSourceCode(fsrc);
51 |
52 | addShader(m_vshader);
53 | addShader(m_fshader);
54 | bindAttributeLocation("vertex", PROGRAM_VERTEX_ATTRIBUTE);
55 | link();
56 | setUniformValue("color", QVector4D(1.0f, 0, 0, 1.0f));
57 | }
58 |
59 | QtGLFlatShader::~QtGLFlatShader()
60 | {
61 |
62 | }
63 |
64 | void QtGLFlatShader::load(const QVector3D *vertices, const QColor& color)
65 | {
66 | bind();
67 | setUniformValue("matrix", globalTransforms.modelViewProjectionMatrix);
68 | setUniformValue("color", color);
69 | enableAttributeArray(PROGRAM_VERTEX_ATTRIBUTE);
70 | setAttributeArray(PROGRAM_VERTEX_ATTRIBUTE, vertices);
71 | }
72 |
--------------------------------------------------------------------------------
/RTHost/RTIMULibGL/QtGLLib/QtGLFlatShader.cpp:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014, richards-tech
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | // this software and associated documentation files (the "Software"), to deal in
9 | // the Software without restriction, including without limitation the rights to use,
10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | // Software, and to permit persons to whom the Software is furnished to do so,
12 | // subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #include "QtGL.h"
25 |
26 | QtGLFlatShader::QtGLFlatShader(QObject *parent)
27 | : QtGLShader(parent)
28 | {
29 | #define PROGRAM_VERTEX_ATTRIBUTE 0
30 |
31 | m_type = QTGLSHADER_FLAT;
32 |
33 | m_vshader = new QGLShader(QGLShader::Vertex, parent);
34 | const char *vsrc =
35 | "attribute highp vec4 vertex;\n"
36 | "uniform mediump mat4 matrix;\n"
37 | "void main(void)\n"
38 | "{\n"
39 | " gl_Position = matrix * vertex;\n"
40 | "}\n";
41 | m_vshader->compileSourceCode(vsrc);
42 |
43 | m_fshader = new QGLShader(QGLShader::Fragment, parent);
44 | const char *fsrc =
45 | "uniform mediump vec4 color;\n"
46 | "void main(void)\n"
47 | "{\n"
48 | " gl_FragColor = color;\n"
49 | "}\n";
50 | m_fshader->compileSourceCode(fsrc);
51 |
52 | addShader(m_vshader);
53 | addShader(m_fshader);
54 | bindAttributeLocation("vertex", PROGRAM_VERTEX_ATTRIBUTE);
55 | link();
56 | setUniformValue("color", QVector4D(1.0f, 0, 0, 1.0f));
57 | }
58 |
59 | QtGLFlatShader::~QtGLFlatShader()
60 | {
61 |
62 | }
63 |
64 | void QtGLFlatShader::load(const QVector3D *vertices, const QColor& color)
65 | {
66 | bind();
67 | setUniformValue("matrix", globalTransforms.modelViewProjectionMatrix);
68 | setUniformValue("color", color);
69 | enableAttributeArray(PROGRAM_VERTEX_ATTRIBUTE);
70 | setAttributeArray(PROGRAM_VERTEX_ATTRIBUTE, vertices);
71 | }
72 |
--------------------------------------------------------------------------------
/RTHost/RTSerialPort/src/qextserialenumerator.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | ** Copyright (c) 2000-2003 Wayne Roth
3 | ** Copyright (c) 2004-2007 Stefan Sander
4 | ** Copyright (c) 2007 Michal Policht
5 | ** Copyright (c) 2008 Brandon Fosdick
6 | ** Copyright (c) 2009-2010 Liam Staskawicz
7 | ** Copyright (c) 2011 Debao Zhang
8 | ** All right reserved.
9 | ** Web: http://code.google.com/p/qextserialport/
10 | **
11 | ** Permission is hereby granted, free of charge, to any person obtaining
12 | ** a copy of this software and associated documentation files (the
13 | ** "Software"), to deal in the Software without restriction, including
14 | ** without limitation the rights to use, copy, modify, merge, publish,
15 | ** distribute, sublicense, and/or sell copies of the Software, and to
16 | ** permit persons to whom the Software is furnished to do so, subject to
17 | ** the following conditions:
18 | **
19 | ** The above copyright notice and this permission notice shall be
20 | ** included in all copies or substantial portions of the Software.
21 | **
22 | ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 | ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 | ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 | ** NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
26 | ** LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 | ** OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 | ** WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 | **
30 | ****************************************************************************/
31 |
32 | #ifndef _QEXTSERIALENUMERATOR_H_
33 | #define _QEXTSERIALENUMERATOR_H_
34 |
35 | #include
36 | #include
37 | #include "qextserialport_global.h"
38 |
39 | struct QextPortInfo {
40 | QString portName; ///< Port name.
41 | QString physName; ///< Physical name.
42 | QString friendName; ///< Friendly name.
43 | QString enumName; ///< Enumerator name.
44 | int vendorID; ///< Vendor ID.
45 | int productID; ///< Product ID
46 | };
47 |
48 | class QextSerialEnumeratorPrivate;
49 | class QEXTSERIALPORT_EXPORT QextSerialEnumerator : public QObject
50 | {
51 | Q_OBJECT
52 | Q_DECLARE_PRIVATE(QextSerialEnumerator)
53 | public:
54 | QextSerialEnumerator(QObject * parent=0);
55 | ~QextSerialEnumerator();
56 |
57 | static QList getPorts();
58 | void setUpNotifications();
59 |
60 | Q_SIGNALS:
61 | void deviceDiscovered(const QextPortInfo & info);
62 | void deviceRemoved(const QextPortInfo & info);
63 |
64 | private:
65 | Q_DISABLE_COPY(QextSerialEnumerator)
66 | QextSerialEnumeratorPrivate *d_ptr;
67 | };
68 |
69 | #endif /*_QEXTSERIALENUMERATOR_H_*/
70 |
--------------------------------------------------------------------------------
/RTHost/RTSerialPort/src/qextserialport_global.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | ** Copyright (c) 2000-2003 Wayne Roth
3 | ** Copyright (c) 2004-2007 Stefan Sander
4 | ** Copyright (c) 2007 Michal Policht
5 | ** Copyright (c) 2008 Brandon Fosdick
6 | ** Copyright (c) 2009-2010 Liam Staskawicz
7 | ** Copyright (c) 2011 Debao Zhang
8 | ** All right reserved.
9 | ** Web: http://code.google.com/p/qextserialport/
10 | **
11 | ** Permission is hereby granted, free of charge, to any person obtaining
12 | ** a copy of this software and associated documentation files (the
13 | ** "Software"), to deal in the Software without restriction, including
14 | ** without limitation the rights to use, copy, modify, merge, publish,
15 | ** distribute, sublicense, and/or sell copies of the Software, and to
16 | ** permit persons to whom the Software is furnished to do so, subject to
17 | ** the following conditions:
18 | **
19 | ** The above copyright notice and this permission notice shall be
20 | ** included in all copies or substantial portions of the Software.
21 | **
22 | ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 | ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 | ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 | ** NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
26 | ** LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 | ** OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 | ** WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 | **
30 | ****************************************************************************/
31 |
32 | #ifndef QEXTSERIALPORT_GLOBAL_H
33 | #define QEXTSERIALPORT_GLOBAL_H
34 |
35 | #include
36 |
37 | #ifdef QEXTSERIALPORT_BUILD_SHARED
38 | # define QEXTSERIALPORT_EXPORT Q_DECL_EXPORT
39 | #elif defined(QEXTSERIALPORT_USING_SHARED)
40 | # define QEXTSERIALPORT_EXPORT Q_DECL_IMPORT
41 | #else
42 | # define QEXTSERIALPORT_EXPORT
43 | #endif
44 |
45 | // ### for compatible with old version. should be removed in QESP 2.0
46 | #ifdef _TTY_NOWARN_
47 | # define QESP_NO_WARN
48 | #endif
49 | #ifdef _TTY_NOWARN_PORT_
50 | # define QESP_NO_PORTABILITY_WARN
51 | #endif
52 |
53 | /*if all warning messages are turned off, flag portability warnings to be turned off as well*/
54 | #ifdef QESP_NO_WARN
55 | # define QESP_NO_PORTABILITY_WARN
56 | #endif
57 |
58 | /*macros for warning and debug messages*/
59 | #ifdef QESP_NO_PORTABILITY_WARN
60 | # define QESP_PORTABILITY_WARNING while(false)qWarning
61 | #else
62 | # define QESP_PORTABILITY_WARNING qWarning
63 | #endif /*QESP_NOWARN_PORT*/
64 |
65 | #ifdef QESP_NO_WARN
66 | # define QESP_WARNING while(false)qWarning
67 | #else
68 | # define QESP_WARNING qWarning
69 | #endif /*QESP_NOWARN*/
70 |
71 | #endif // QEXTSERIALPORT_GLOBAL_H
72 |
73 |
--------------------------------------------------------------------------------
/Linux/RTIMULibGL/QtGLLib/QtGLWireCubeComponent.cpp:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014, richards-tech
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | // this software and associated documentation files (the "Software"), to deal in
9 | // the Software without restriction, including without limitation the rights to use,
10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | // Software, and to permit persons to whom the Software is furnished to do so,
12 | // subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #include "QtGL.h"
25 |
26 | QtGLWireCubeComponent::QtGLWireCubeComponent()
27 | {
28 | }
29 |
30 | QtGLWireCubeComponent::~QtGLWireCubeComponent()
31 | {
32 |
33 | }
34 |
35 | void QtGLWireCubeComponent::generate(float width, float height, float depth)
36 | {
37 | float w2 = width / 2.0f;
38 | float h2 = height / 2.0f;
39 | float d2 = depth / 2.0f;
40 |
41 | reset();
42 |
43 | addVertex(QVector3D(-w2, h2, d2));
44 | addVertex(QVector3D(w2, h2, d2));
45 | addVertex(QVector3D(-w2, -h2, d2));
46 | addVertex(QVector3D(w2, -h2, d2));
47 |
48 | addVertex(QVector3D(w2, -h2, d2));
49 | addVertex(QVector3D(w2, h2, d2));
50 | addVertex(QVector3D(-w2, -h2, d2));
51 | addVertex(QVector3D(-w2, h2, d2));
52 |
53 | addVertex(QVector3D(-w2, h2, -d2));
54 | addVertex(QVector3D(w2, h2, -d2));
55 | addVertex(QVector3D(-w2, -h2, -d2));
56 | addVertex(QVector3D(w2, -h2, -d2));
57 |
58 | addVertex(QVector3D(w2, -h2, -d2));
59 | addVertex(QVector3D(w2, h2, -d2));
60 | addVertex(QVector3D(-w2, -h2, -d2));
61 | addVertex(QVector3D(-w2, h2, -d2));
62 |
63 | addVertex(QVector3D(-w2, -h2, -d2));
64 | addVertex(QVector3D(-w2, -h2, d2));
65 | addVertex(QVector3D(w2, -h2, -d2));
66 | addVertex(QVector3D(w2, -h2, d2));
67 |
68 | addVertex(QVector3D(-w2, h2, -d2));
69 | addVertex(QVector3D(-w2, h2, d2));
70 | addVertex(QVector3D(w2, h2, -d2));
71 | addVertex(QVector3D(w2, h2, d2));
72 |
73 | }
74 |
75 | void QtGLWireCubeComponent::draw()
76 | {
77 | QtGLComponent::draw(GL_LINES);
78 | }
79 |
--------------------------------------------------------------------------------
/RTHost/RTIMULibGL/QtGLLib/QtGLWireCubeComponent.cpp:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014, richards-tech
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | // this software and associated documentation files (the "Software"), to deal in
9 | // the Software without restriction, including without limitation the rights to use,
10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | // Software, and to permit persons to whom the Software is furnished to do so,
12 | // subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #include "QtGL.h"
25 |
26 | QtGLWireCubeComponent::QtGLWireCubeComponent()
27 | {
28 | }
29 |
30 | QtGLWireCubeComponent::~QtGLWireCubeComponent()
31 | {
32 |
33 | }
34 |
35 | void QtGLWireCubeComponent::generate(float width, float height, float depth)
36 | {
37 | float w2 = width / 2.0f;
38 | float h2 = height / 2.0f;
39 | float d2 = depth / 2.0f;
40 |
41 | reset();
42 |
43 | addVertex(QVector3D(-w2, h2, d2));
44 | addVertex(QVector3D(w2, h2, d2));
45 | addVertex(QVector3D(-w2, -h2, d2));
46 | addVertex(QVector3D(w2, -h2, d2));
47 |
48 | addVertex(QVector3D(w2, -h2, d2));
49 | addVertex(QVector3D(w2, h2, d2));
50 | addVertex(QVector3D(-w2, -h2, d2));
51 | addVertex(QVector3D(-w2, h2, d2));
52 |
53 | addVertex(QVector3D(-w2, h2, -d2));
54 | addVertex(QVector3D(w2, h2, -d2));
55 | addVertex(QVector3D(-w2, -h2, -d2));
56 | addVertex(QVector3D(w2, -h2, -d2));
57 |
58 | addVertex(QVector3D(w2, -h2, -d2));
59 | addVertex(QVector3D(w2, h2, -d2));
60 | addVertex(QVector3D(-w2, -h2, -d2));
61 | addVertex(QVector3D(-w2, h2, -d2));
62 |
63 | addVertex(QVector3D(-w2, -h2, -d2));
64 | addVertex(QVector3D(-w2, -h2, d2));
65 | addVertex(QVector3D(w2, -h2, -d2));
66 | addVertex(QVector3D(w2, -h2, d2));
67 |
68 | addVertex(QVector3D(-w2, h2, -d2));
69 | addVertex(QVector3D(-w2, h2, d2));
70 | addVertex(QVector3D(w2, h2, -d2));
71 | addVertex(QVector3D(w2, h2, d2));
72 |
73 | }
74 |
75 | void QtGLWireCubeComponent::draw()
76 | {
77 | QtGLComponent::draw(GL_LINES);
78 | }
79 |
--------------------------------------------------------------------------------
/RTHost/RTHostIMUCommon/RTHostIMUThread.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014, richards-tech
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | // this software and associated documentation files (the "Software"), to deal in
9 | // the Software without restriction, including without limitation the rights to use,
10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | // Software, and to permit persons to whom the Software is furnished to do so,
12 | // subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 |
25 | #ifndef _RTHOSTIMUTHREAD_H
26 | #define _RTHOSTIMUTHREAD_H
27 |
28 | #include
29 | #include
30 |
31 | #include "RTIMULib.h"
32 |
33 | class RTHostIMUThread : public QObject
34 | {
35 | Q_OBJECT
36 |
37 | public:
38 | RTHostIMUThread();
39 | virtual ~RTHostIMUThread();
40 |
41 | // resumeThread() is called when init is complete
42 |
43 | void resumeThread();
44 |
45 | // exitThread is called to terminate and delete the thread
46 |
47 | void exitThread() { emit internalEndThread(); }
48 |
49 | RTIMUSettings *getSettings() { return m_settings; }
50 | RTIMU *getIMU() { QMutexLocker lock(&m_lock); return m_imu; }
51 |
52 | public slots:
53 | void internalRunLoop() { initThread(); emit running();}
54 | void cleanup() {finishThread(); emit internalKillThread(); }
55 | void newIMU();
56 |
57 | signals:
58 | void running(); // emitted when everything set up and thread active
59 | void internalEndThread(); // this to end thread
60 | void internalKillThread(); // tells the QThread to quit
61 |
62 | void IMURunning(); // emitted when a new IMU is running
63 | void newIMUData(const RTIMU_DATA& data); // this contains the latest data from the IMU
64 |
65 | protected:
66 | void initThread();
67 | void finishThread();
68 | void timerEvent(QTimerEvent *event);
69 |
70 | private:
71 | int m_timer;
72 | RTIMUSettings *m_settings;
73 |
74 | RTIMU *m_imu;
75 |
76 | QThread *m_thread;
77 |
78 | QMutex m_lock;
79 | };
80 |
81 | #endif // _RTHOSTIMUTHREAD_H
82 |
--------------------------------------------------------------------------------
/RTHost/RTSerialPort/src/qextwineventnotifier_p.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | ** Copyright (c) 2000-2003 Wayne Roth
3 | ** Copyright (c) 2004-2007 Stefan Sander
4 | ** Copyright (c) 2007 Michal Policht
5 | ** Copyright (c) 2008 Brandon Fosdick
6 | ** Copyright (c) 2009-2010 Liam Staskawicz
7 | ** Copyright (c) 2011 Debao Zhang
8 | ** All right reserved.
9 | ** Web: http://code.google.com/p/qextserialport/
10 | **
11 | ** Permission is hereby granted, free of charge, to any person obtaining
12 | ** a copy of this software and associated documentation files (the
13 | ** "Software"), to deal in the Software without restriction, including
14 | ** without limitation the rights to use, copy, modify, merge, publish,
15 | ** distribute, sublicense, and/or sell copies of the Software, and to
16 | ** permit persons to whom the Software is furnished to do so, subject to
17 | ** the following conditions:
18 | **
19 | ** The above copyright notice and this permission notice shall be
20 | ** included in all copies or substantial portions of the Software.
21 | **
22 | ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 | ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 | ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 | ** NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
26 | ** LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 | ** OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 | ** WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 | **
30 | ****************************************************************************/
31 |
32 | #ifndef QEXTWINEVENTNOTIFIER_P_H_
33 | #define QEXTWINEVENTNOTIFIER_P_H_
34 |
35 | //
36 | // W A R N I N G
37 | // -------------
38 | //
39 | // This file is not part of the QESP API. It exists for the convenience
40 | // of other QESP classes. This header file may change from version to
41 | // version without notice, or even be removed.
42 | //
43 | // We mean it.
44 | //
45 |
46 | #include
47 | #include
48 | #include "qextserialport_global.h"
49 |
50 | class QextWinEventNotifierPrivate;
51 | class QEXTSERIALPORT_EXPORT QextWinEventNotifier : public QObject
52 | {
53 | Q_OBJECT
54 | Q_DECLARE_PRIVATE(QextWinEventNotifier)
55 |
56 | public:
57 | explicit QextWinEventNotifier(QObject *parent = 0);
58 | explicit QextWinEventNotifier(HANDLE hEvent, QObject *parent = 0);
59 | ~QextWinEventNotifier();
60 |
61 | void setHandle(HANDLE hEvent);
62 | HANDLE handle() const;
63 |
64 | bool isEnabled() const;
65 |
66 | public Q_SLOTS:
67 | void setEnabled(bool enable);
68 |
69 | Q_SIGNALS:
70 | void activated(HANDLE hEvent);
71 |
72 | protected:
73 | bool event(QEvent * e);
74 |
75 | private:
76 | Q_DISABLE_COPY(QextWinEventNotifier)
77 | QextWinEventNotifierPrivate * d_ptr;
78 | };
79 |
80 | #endif // QEXTWINEVENTNOTIFIER_P_H_
81 |
--------------------------------------------------------------------------------
/RTHost/RTArduLinkHost/RTArduLinkDemoDefs.h:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTArduLink
4 | //
5 | // Copyright (c) 2014 richards-tech
6 | //
7 | // Permission is hereby granted, free of charge,
8 | // to any person obtaining a copy of
9 | // this software and associated documentation files
10 | // (the "Software"), to deal in the Software without
11 | // restriction, including without limitation the rights
12 | // to use, copy, modify, merge, publish, distribute,
13 | // sublicense, and/or sell copies of the Software, and
14 | // to permit persons to whom the Software is furnished
15 | // to do so, subject to the following conditions:
16 | //
17 | // The above copyright notice and this permission notice
18 | // shall be included in all copies or substantial portions
19 | // of the Software.
20 | //
21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
22 | // ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
23 | // TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
24 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
25 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
26 | // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
28 | // IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29 | // DEALINGS IN THE SOFTWARE.
30 |
31 | #ifndef RTARDULINKDEMODEFS_H_
32 | #define RTARDULINKDEMODEFS_H_
33 |
34 | #include "RTArduLinkUtils.h"
35 |
36 | #define SERVO_COUNT 2 // 2 servo channels
37 | #define PWM_COUNT 3 // 3 pwm channels
38 | #define INPUT_COUNT 2 // 2 inputs
39 | #define OUTPUT_COUNT 2 // 2 outputs
40 |
41 | #define SERVO_MIN_VALUE 1000 // min servo value
42 | #define SERVO_CTR_VALUE 1500 // center servo value
43 | #define SERVO_MAX_VALUE 2000 // max servo value
44 |
45 | #define PWM_MIN_VALUE 0 // min pwm value
46 | #define PWM_CTR_VALUE 128 // center pwm value
47 | #define PWM_MAX_VALUE 255 // max pwm value
48 |
49 | // The command structure is sent from the host to the subsystem
50 |
51 | typedef struct
52 | {
53 | RTARDULINK_UC2 servoPos[SERVO_COUNT]; // the servo positions
54 | unsigned char pwmValue[PWM_COUNT]; // PWM values
55 | unsigned char outputValue[OUTPUT_COUNT]; // the output pin values (true=high, false=low)
56 | } RTARDULINKDEMO_COMMAND;
57 |
58 | // the response structure is sent from the subsystem to the host
59 |
60 | typedef struct
61 | {
62 | unsigned char inputValue[INPUT_COUNT]; // the input pin values (true=high, false=low)
63 | } RTARDULINKDEMO_RESPONSE;
64 |
65 |
66 | #endif /* RTARDULINKDEMODEFS_H_ */
67 |
--------------------------------------------------------------------------------
/Linux/RTIMULibGL/QtGLLib/QtGLShader.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014, richards-tech
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | // this software and associated documentation files (the "Software"), to deal in
9 | // the Software without restriction, including without limitation the rights to use,
10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | // Software, and to permit persons to whom the Software is furnished to do so,
12 | // subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | // This file contains OpenGL and Qt includes. This file should be included first
25 | // and the order of includes is very important (especially on Linux).
26 |
27 | #ifndef QTGLSHADER_H
28 | #define QTGLSHADER_H
29 |
30 | typedef enum
31 | {
32 | QTGLSHADER_FLAT,
33 | QTGLSHADER_TEXTURE,
34 | QTGLSHADER_ADS,
35 | QTGLSHADER_ADSTEXTURE,
36 | QTGLSHADER_COUNT
37 | } QTGLSHADER_TYPE;
38 |
39 | class QtGLShader : public QGLShaderProgram
40 | {
41 | public:
42 | QtGLShader(QObject *parent) : QGLShaderProgram(parent) {};
43 | virtual ~QtGLShader() { removeAllShaders(); };
44 |
45 | inline QTGLSHADER_TYPE getType() {return m_type;};
46 |
47 | // virtual void load(const QVector3D *vertices, const QVector2D *textureCoords);
48 | virtual void load(const QVector3D *, const QVector2D *) { qDebug() << "No shader load";};
49 |
50 | // virtual void load(const QVector3D *vertices, const QColor& color);
51 | virtual void load(const QVector3D *, const QColor&) {qDebug() << "No shader load";};
52 |
53 | // virtual void load(const QVector3D *vertices, const QVector3D *normals, const COMPONENT_MATERIAL& material);
54 | virtual void load(const QVector3D *, const QVector3D *, const COMPONENT_MATERIAL& ) {qDebug() << "No shader load";};
55 |
56 | // virtual void load(const QVector3D *vertices, const QVector3D *normals,
57 | // const QVector2D *textureCoords, const COMPONENT_MATERIAL& material);
58 | virtual void load(const QVector3D *, const QVector3D *, const QVector2D*, const COMPONENT_MATERIAL& ) {qDebug() << "No shader load";};
59 |
60 | protected:
61 | QGLShader *m_vshader;
62 | QGLShader *m_fshader;
63 | QTGLSHADER_TYPE m_type;
64 | };
65 |
66 | #endif // QTGLSHADER_H
67 |
--------------------------------------------------------------------------------
/RTHost/RTIMULibGL/QtGLLib/QtGLShader.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014, richards-tech
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | // this software and associated documentation files (the "Software"), to deal in
9 | // the Software without restriction, including without limitation the rights to use,
10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | // Software, and to permit persons to whom the Software is furnished to do so,
12 | // subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | // This file contains OpenGL and Qt includes. This file should be included first
25 | // and the order of includes is very important (especially on Linux).
26 |
27 | #ifndef QTGLSHADER_H
28 | #define QTGLSHADER_H
29 |
30 | typedef enum
31 | {
32 | QTGLSHADER_FLAT,
33 | QTGLSHADER_TEXTURE,
34 | QTGLSHADER_ADS,
35 | QTGLSHADER_ADSTEXTURE,
36 | QTGLSHADER_COUNT
37 | } QTGLSHADER_TYPE;
38 |
39 | class QtGLShader : public QGLShaderProgram
40 | {
41 | public:
42 | QtGLShader(QObject *parent) : QGLShaderProgram(parent) {};
43 | virtual ~QtGLShader() { removeAllShaders(); };
44 |
45 | inline QTGLSHADER_TYPE getType() {return m_type;};
46 |
47 | // virtual void load(const QVector3D *vertices, const QVector2D *textureCoords);
48 | virtual void load(const QVector3D *, const QVector2D *) { qDebug() << "No shader load";};
49 |
50 | // virtual void load(const QVector3D *vertices, const QColor& color);
51 | virtual void load(const QVector3D *, const QColor&) {qDebug() << "No shader load";};
52 |
53 | // virtual void load(const QVector3D *vertices, const QVector3D *normals, const COMPONENT_MATERIAL& material);
54 | virtual void load(const QVector3D *, const QVector3D *, const COMPONENT_MATERIAL& ) {qDebug() << "No shader load";};
55 |
56 | // virtual void load(const QVector3D *vertices, const QVector3D *normals,
57 | // const QVector2D *textureCoords, const COMPONENT_MATERIAL& material);
58 | virtual void load(const QVector3D *, const QVector3D *, const QVector2D*, const COMPONENT_MATERIAL& ) {qDebug() << "No shader load";};
59 |
60 | protected:
61 | QGLShader *m_vshader;
62 | QGLShader *m_fshader;
63 | QTGLSHADER_TYPE m_type;
64 | };
65 |
66 | #endif // QTGLSHADER_H
67 |
--------------------------------------------------------------------------------
/RTEllipsoidFit/RTEllipsoidFit.m:
--------------------------------------------------------------------------------
1 | %//
2 | %// Copyright (c) 2014, richards-tech
3 | %//
4 | %// This file is part of RTEllipsoidFit
5 | %//
6 | %// RTEllipsoidFit is free software: you can redistribute it and/or modify
7 | %// it under the terms of the GNU General Public License as published by
8 | %// the Free Software Foundation, either version 3 of the License, or
9 | %// (at your option) any later version.
10 | %//
11 | %// RTEllipsoidFit is distributed in the hope that it will be useful,
12 | %// but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | %// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | %// GNU General Public License for more details.
15 | %//
16 | %// You should have received a copy of the GNU General Public License
17 | %// along with RTEllipsoidFit. If not, see .
18 | %//
19 |
20 | %// Parts of this file are based on original code as below:
21 |
22 | %******************************************************************************************
23 | % Magnetometer Calibration Skript for Razor AHRS v1.4.2
24 | % 9 Degree of Measurement Attitude and Heading Reference System
25 | % for Sparkfun "9DOF Razor IMU" and "9DOF Sensor Stick"
26 | %
27 | % Released under GNU GPL (General Public License) v3.0
28 | % Copyright (C) 2013 Peter Bartz [http://ptrbrtz.net]
29 | % Copyright (C) 2012 Quality & Usability Lab, Deutsche Telekom Laboratories, TU Berlin
30 | % Written by Peter Bartz (peter-bartz@gmx.de)
31 | %
32 | % Infos, updates, bug reports, contributions and feedback:
33 | % https://github.com/ptrbrtz/razor-9dof-ahrs
34 | %******************************************************************************************
35 |
36 | % RTEllipsoidFit
37 |
38 | % read in data from saved file
39 |
40 | magFile = fopen('magRaw.dta', 'r');
41 | magCalDataMat = fscanf(magFile, '%f %f %f', [3, inf]);
42 | fprintf('Mat size = %d\n', size(magCalDataMat));
43 | fclose(magFile);
44 |
45 | % open output file
46 |
47 | corrFile = fopen('magCorr.dta', 'w');
48 |
49 | % create the vectors
50 |
51 | x = magCalDataMat(1, :)';
52 | y = magCalDataMat(2, :)';
53 | z = magCalDataMat(3, :)';
54 |
55 | [center, radii, evecs, v] = ellipsoid_fit( [x y z ] );
56 |
57 | scaleMat = inv([radii(1) 0 0; 0 radii(2) 0; 0 0 radii(3)]) * min(radii);
58 | correctionMat = evecs * scaleMat * evecs';
59 |
60 | % now correct the data to show that it works
61 |
62 | magVector = [x - center(1), y - center(2), z - center(3)]'; % take off center offset
63 | %magVector = correctionMat * magVector; % do rotation and scale
64 | magVector = evecs * magVector; % do rotation and scale
65 | xCorr = magVector(1, :); % get corrected vectors
66 | yCorr = magVector(2, :);
67 | zCorr = magVector(3, :);
68 |
69 | fprintf(corrFile, '%f %f %f %f %f %f %f %f %f %f %f %f\n',
70 | center(1), center(2), center(3),
71 | correctionMat(1, 1), correctionMat(1, 2), correctionMat(1, 3),
72 | correctionMat(2, 1), correctionMat(2, 2), correctionMat(2, 3),
73 | correctionMat(3, 1), correctionMat(3, 2), correctionMat(3, 3));
74 |
75 | fclose(corrFile);
76 |
77 |
--------------------------------------------------------------------------------
/Linux/python/setup.py:
--------------------------------------------------------------------------------
1 | #////////////////////////////////////////////////////////////////////////////
2 | #//
3 | #// This file is part of RTIMULib
4 | #//
5 | #// Copyright (c) 2014-2015, richards-tech
6 | #// Copyright (c) 2014, avishorp
7 | #//
8 | #// Permission is hereby granted, free of charge, to any person obtaining a copy of
9 | #// this software and associated documentation files (the "Software"), to deal in
10 | #// the Software without restriction, including without limitation the rights to use,
11 | #// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
12 | #// Software, and to permit persons to whom the Software is furnished to do so,
13 | #// subject to the following conditions:
14 | #//
15 | #// The above copyright notice and this permission notice shall be included in all
16 | #// copies or substantial portions of the Software.
17 | #//
18 | #// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
19 | #// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
20 | #// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
21 | #// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
22 | #// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23 | #// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 |
25 | from distutils.core import setup, Extension
26 | import os.path
27 |
28 | RTIMU_sources = [
29 | "RTMath.cpp",
30 | "RTIMUHal.cpp",
31 | "RTFusion.cpp",
32 | "RTFusionKalman4.cpp",
33 | "RTFusionRTQF.cpp",
34 | "RTIMUSettings.cpp",
35 | "IMUDrivers/RTIMU.cpp",
36 | "IMUDrivers/RTIMUNull.cpp",
37 | "IMUDrivers/RTIMUMPU9150.cpp",
38 | "IMUDrivers/RTIMUMPU9250.cpp",
39 | "IMUDrivers/RTIMUGD20HM303D.cpp",
40 | "IMUDrivers/RTIMUGD20HM303DLHC.cpp",
41 | "IMUDrivers/RTIMUGD20M303DLHC.cpp",
42 | "IMUDrivers/RTIMULSM9DS0.cpp",
43 | "IMUDrivers/RTIMULSM9DS1.cpp",
44 | "IMUDrivers/RTIMUBMX055.cpp",
45 | "IMUDrivers/RTIMUBNO055.cpp",
46 | "IMUDrivers/RTPressure.cpp",
47 | "IMUDrivers/RTPressureBMP180.cpp",
48 | "IMUDrivers/RTPressureLPS25H.cpp",
49 | "IMUDrivers/RTPressureMS5611.cpp",
50 | "IMUDrivers/RTPressureMS5637.cpp",
51 | "IMUDrivers/RTHumidity.cpp",
52 | "IMUDrivers/RTHumidityHTS221.cpp",
53 | "IMUDrivers/RTHumidityHTU21D.cpp",
54 | ]
55 | RTIMU_sourcedir = "../../RTIMULib"
56 |
57 | mod = Extension('RTIMU',
58 | sources = ['PyRTIMU.cpp', 'PyRTIMU_Settings.cpp', 'PyRTIMU_RTIMU.cpp',
59 | 'PyRTIMU_RTPressure.cpp', 'PyRTIMU_RTHumidity.cpp'] +
60 | [ os.path.join(RTIMU_sourcedir, sr) for sr in RTIMU_sources],
61 | include_dirs = [RTIMU_sourcedir],
62 | extra_compile_args = ['-std=c++0x'],
63 | define_macros = [("HAL_QUIET", None)]
64 | )
65 |
66 | setup (name = 'RTIMULib',
67 | version = '7.2.1',
68 | description = 'richards-tech IMU Sensor Fusion Library',
69 | ext_modules = [mod])
70 |
--------------------------------------------------------------------------------
/Linux/RTIMULibDemo/SelectFusionDlg.cpp:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // This file is part of RTIMULib
4 | //
5 | // Copyright (c) 2014-2015, richards-tech, LLC
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | // this software and associated documentation files (the "Software"), to deal in
9 | // the Software without restriction, including without limitation the rights to use,
10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 | // Software, and to permit persons to whom the Software is furnished to do so,
12 | // subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in all
15 | // copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 | // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #include "SelectFusionDlg.h"
25 | #include "RTIMUSettings.h"
26 | #include "RTFusion.h"
27 |
28 | #include
29 | #include
30 |
31 | SelectFusionDlg::SelectFusionDlg(RTIMUSettings *settings, QWidget *parent)
32 | : QDialog(parent, Qt::WindowCloseButtonHint | Qt::WindowTitleHint)
33 | {
34 | m_settings = settings;
35 | layoutWindow();
36 | setWindowTitle("Select Fusion algorithm");
37 | connect(m_buttons, SIGNAL(accepted()), this, SLOT(onOk()));
38 | connect(m_buttons, SIGNAL(rejected()), this, SLOT(onCancel()));
39 | }
40 |
41 | SelectFusionDlg::~SelectFusionDlg()
42 | {
43 | }
44 |
45 | void SelectFusionDlg::onOk()
46 | {
47 | m_settings->m_fusionType = m_selectFusion->currentIndex();
48 | m_settings->saveSettings();
49 |
50 | accept();
51 | }
52 |
53 | void SelectFusionDlg::onCancel()
54 | {
55 | reject();
56 | }
57 |
58 | void SelectFusionDlg::layoutWindow()
59 | {
60 | QVBoxLayout *mainLayout;
61 | QFormLayout *form;
62 |
63 | setModal(true);
64 |
65 | mainLayout = new QVBoxLayout(this);
66 | mainLayout->setSpacing(20);
67 | mainLayout->setContentsMargins(11, 11, 11, 11);
68 |
69 | form = new QFormLayout();
70 | mainLayout->addLayout(form);
71 |
72 | m_selectFusion = new QComboBox();
73 |
74 | for (int i = 0; i < RTFUSION_TYPE_COUNT; i++)
75 | m_selectFusion->addItem(RTFusion::fusionName(i));
76 |
77 | m_selectFusion->setCurrentIndex(m_settings->m_fusionType);
78 |
79 | form->addRow("Select Fusion algorithm type: ", m_selectFusion);
80 |
81 | m_buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, this);
82 | m_buttons->setCenterButtons(true);
83 |
84 | mainLayout->addWidget(m_buttons);
85 | }
86 |
87 |
88 |
--------------------------------------------------------------------------------