model imu, gps, and ins/gps
sensor fusion and tracking toolbox™ enables you to model inertial measurement units (imu), global positioning systems (gps), and inertial navigation systems (ins). you can model specific hardware by setting properties of your models to values from hardware datasheets. you can tune environmental and noise properties to mimic real-world environments. you can use these models to test and validate your fusion algorithms or as placeholders while developing larger applications.
this tutorial provides an overview of inertial sensor and gps models in sensor fusion and tracking toolbox.
to learn how to generate the ground-truth motion that drives the sensor models, see and . for a tutorial on fusing inertial sensor data, see .
inertial measurement unit
an imu is an electronic device mounted on a platform. the imu consists of individual sensors that report various information about the platform's motion. imus combine multiple sensors, which can include accelerometers, gyroscopes, and magnetometers.
with this toolbox, measurements returned from an imu model use the following unit and coordinate conventions.
output | description | units | coordinate system |
---|---|---|---|
acceleration | current accelerometer reading | m/s2 | sensor body |
angular velocity | current gyroscope reading | rad/s | sensor body |
magnetic field | current magnetometer reading | μt | sensor body |
usually, the data returned by imus is fused together and interpreted as roll, pitch, and yaw of the platform. real-world imu sensors can have different axes for each of the individual sensors. the models provided by sensor fusion and tracking toolbox assume that the individual sensor axes are aligned.
to create an imu sensor model, use the system object™.
imu = imusensor
imu = imusensor with properties: imutype: 'accel-gyro' samplerate: 100 temperature: 25 accelerometer: [1×1 accelparams] gyroscope: [1×1 gyroparams] randomstream: 'global stream'
the default imu model contains an ideal accelerometer and an ideal gyroscope. the
accelparams
and gyroparams
objects define the
accelerometer and gyroscope configuration. you can set the properties of these
objects to mimic specific hardware and environments. for more information on imu
parameter objects, see , , and .
to model receiving imu sensor data, call the imu model with the ground-truth acceleration and angular velocity of the platform:
trueacceleration = [1 0 0]; trueangularvelocity = [1 0 0]; [accelerometerreadings,gyroscopereadings] = imu(trueacceleration,trueangularvelocity)
accelerometerreadings = -1.0000 0 9.8100 gyroscopereadings = 1 0 0
you can generate the ground-truth trajectories that you input to the imu model using and .
global positioning system
a global positioning system (gps) provides 3-d position information for platforms (receivers) on the surface of the earth.
gps consists of a constellation of satellites that continuously orbit the earth. the satellites maintain a configuration such that a platform is always within view of at least four satellites. by measuring the flight time of signals from the satellites to the platform, the position of the platform can be trilaterated. satellites timestamp a broadcast signal, which is compared to the platform's clock upon receipt. three satellites are required to trilaterate a position in three dimensions. the fourth satellite is required to correct for clock synchronization errors between the platform and satellites.
the gps simulation provided by sensor fusion and tracking toolbox models the platform (receiver) data that has already been processed and interpreted as altitude, latitude, longitude, velocity, groundspeed, and course.
measurements returned from the gps model use the following unit and coordinate conventions.
output | description | units | coordinate system |
---|---|---|---|
lla | current global position reading in geodetic coordinates, based on wgs84ellipsoid earth model | degrees (latitude), degrees (longitude), meters (altitude) | lla |
velocity | current velocity reading from gps | m/s | local ned |
groundspeed | current groundspeed reading from gps | m/s | local ned |
course | current course reading from gps | degrees | local ned |
the gps model enables you to set high-level accuracy and noise parameters, as well as the receiver update rate and a reference location.
to create a gps model, use the system object.
gps = gpssensor
gps = gpssensor with properties: updaterate: 1 hz referencelocation: [0 0 0] [deg deg m] horizontalpositionaccuracy: 1.6 m verticalpositionaccuracy: 3 m velocityaccuracy: 0.1 m/s randomstream: 'global stream' decayfactor: 0.999
to model receiving gps sensor data, call the gps model with the ground-truth position and velocity of the platform:
trueposition = [1 0 0]; truevelocity = [1 0 0]; [lla,velocity,groundspeed,course] = gps(trueposition,truevelocity)
lla = 0.0000 0.0000 0.3031 velocity = 1.0919 -0.0008 -0.1308 groundspeed = 1.0919 course = 359.9566
you can generate the ground-truth trajectories that you input to the gps model using and .
inertial navigation system and global positioning system
an inertial navigation system (ins) uses inertial sensors like those found on an imu: accelerometers, gyroscopes, and magnetometers. an ins fuses the inertial sensor data to calculate position, orientation, and velocity of a platform. an ins/gps uses gps data to correct the ins. typically, the ins and gps readings are fused with an extended kalman filter, where the ins readings are used in the prediction step, and the gps readings are used in the update step. a common use for ins/gps is dead-reckoning when the gps signal is unreliable.
"ins/gps" refers to the entire system, including the filtering. the ins/gps simulation provided by sensor fusion and tracking toolbox models an ins/gps and returns the position, velocity, and orientation reported by the inertial sensors and gps receiver based on a ground-truth motion.
measurements returned from the ins/gps use the following unit and coordinate conventions.
output | description | units | coordinate system |
---|---|---|---|
position | current position reading from the ins/gps | meters | local ned |
velocity | current velocity reading from the ins/gps | m/s | local ned |
orientation | current orientation reading from the ins/gps | quaternion or rotation matrix | n/a |
to create a ins/gps model, use the system object. you can model a real-world ins/gps system by tuning the accuracy of your fused data: roll, pitch, yaw, position, and velocity.
ins = inssensor
ins = inssensor with properties: rollaccuracy: 0.2 deg pitchaccuracy: 0.2 deg yawaccuracy: 1 deg positionaccuracy: 1 m velocityaccuracy: 0.05 m/s randomstream: 'global stream'
to model receiving ins/gps sensor data, call the ins/gps model with the ground-truth position and velocity and orientation of the platform:
truemotion = struct( ... 'position',[0 0 0], ... 'velocity',[0 0 0], ... 'orientation',quaternion(1,0,0,0)); measurement = ins(truemotion)
measurement = struct with fields: orientation: [1×1 quaternion] position: [0.2939 -0.7873 0.8884] velocity: [-0.0574 -0.0534 -0.0405]
see also
| |