...
Inertial Measurement Unit (IMU)
LPMS-IG1P needs to be installled installed in the vehicle in a known orientation ideally with the coordinate axes of the IMU arranged in parallel to the vehicle coordinate system. As vehicle reference frame we are using the VW coordinate system shown in the image below. Connect the USB connector of LPMS-IG1P to the host computer. If needed an active or passive USB extension can be used. Make sure to check data integrity with the LpmsControl 2 data acquisition tool, we have noticed communication issues with some passive USB extensions.
...
Low-dynamics Filter (Odometry + GPS + (some) IMU)
The low dynamics (LD) filter combines odometry, GPS and IMU data to calculate the global position of a vehicle. This filter was initially concipated to work only with odometry and GPS data to calculate the 2D position and yaw angle of a vehicle. It is therefore suitable for simple tracking scenarios. For more complicated, for example augmented reality, applications we recommed using the HD filter as it outputs globally referenced 3D orientation additionally to globally referenced position. This filter relies heavily on the wheel velocity data of the car published on the car’s CAN bus. Therefore the quality of the output of this filter depends on the accuracy of this information.
Configuration Block
Insert the following configuration block into your config.json
file to activate the LD filter. The filter's node name is vehicularFusion
.
...
LPVR-POS Sensor Fusion Filter
Filter Inputs
Both the LD and the HD filter need the following sources as input. One option is to operate the filter with our LPMS-IG1P sensor that contains IMU and a GPS receiver. This allows for standard GPS absolute position accuracy. Relative accuracy and update rate are higher, based on odometry and IMU data. The other option is to use a separate RTK-GPS unit to get high accuracy RTK-GPS readings. We will look at how to set up an RTK-GPS system for LPVR-POS in a following chapter.
Option 1 - LPMS-IG1P data source for IMU and GPS data
LPMS-IG1P Source
Code Block |
---|
"imuP": { "echoFusedPosetype": false, "endpoint": "tcp://*:8801"DualRtk", "fusersettings": { "fitModelsensor1": "SimpleCarModel", { "driveModel": "Differential", "velError": 0.277777778, // If specification needed, insert first IG1 sensor name here //"omegaErrorname": 0.5,"ig1p232800650050", "measurementErrorautodetectType": 0.1,"ig1p" "smoothFit": true}, "useImuTurnRatertcm": true, "imuTurnRateAxisimuEndpoint": { "x": 1,"tcp://*:8802" "y": 0, "z": 0 } } } |
See below a description of the parameter options of the LD filter.
...
Parameter name
}
} |
Parameter name | Description | Default |
---|
echoFusedPose
fusedVehiclePose output is printed to command line
false
endpoint
Output port for the fusion result
8801
fitModel
Model to use for fusion. At the moment only SimpleCarModel
is supported.
SimpleCarModel
driveModel
Model used to calculate the car trajectory from CAN bus data. If the steering wheel data and steering model are provided, Ackermann
model can be used.
Differential
velError
Velocity error for Kalman filter. Keep default value.
0.277777778
omegaError
Omega error for Kalman filter. Keep default value.
0.5
measurementError
Measurement error for Kalman filter. Keep default value.
0.1
smoothFit
Enable this option to prevent filter output from jumping between odometry data and GPS measurement. Keep enabled.
true
useImuTurnRate
If enabled the IMU turn rate is used instead of the wheel velocity based turn rate. Recommended.
false
imuTurnRateAxis
The IMU axis to use for the Turn rate if useImuTurnRate
is enabled.
1, 0, 0
Filter Inputs
This filter needs the following sources as input. One option is to operate the filter with our LPMS-IG1P sensor that contains IMU and a GPS receiver. This allows for standard GPS absolute position accuracy. Relative accuracy and update rate are higher, based on odometry and IMU data. The other option is to use a separate RTK-GPS unit to get high accuracy RTK-GPS readings. We will look at how to set up an RTK-GPS system for LPVR-POS in a following chapter.
Option 1 - LPMS-IG1P data source for IMU and GPS data
LPMS-IG1P Source
...
type | Type of GPS receiver. Currently only | DualRTK |
name | The name of the LPMS-IG1P sensor used in this setup. This parameter is optional. If FusionHub is operated at the same time with LPVR-DUO, we recommend specifying the sensor name. Look up the sensor name in LpmsControl 2. | n/a |
autodetectType | Type of sensor to be autodetcted | ig1p |
rtcm | Set to true if RTCM input is to be received eg. from an NTRIP source. | false |
imuEndpoint | Output endpoint of IMU data. This parameter is optional. | tcp://*:8802 |
Option 2 - Separate LPMS-IG1 IMU and RTK GPS sources (with NTRIP caster for RTK correction)
LPMS-IG1 Source
Code Block |
---|
"imu": {
"type": "OpenZen",
"settings": {
"autodetectType": "ig1"
}
} |
Parameter name | Description | Default |
---|---|---|
type | Type of IMU. At the moment only OpenZen IMUs are supported. | OpenZen |
name | The name of the LPMS-IG1 sensor used in this setup. This parameter is optional. If FusionHub is operated at the same time with LPVR-DUO, we recommend specifying the sensor name. Look up the sensor name in LpmsControl 2. | n/a |
autodetectType | Type of sensor to be autodetcted | ig1 |
imuEndpoint | Output endpoint of IMU data. This parameter is optional. | tcp://*:8802 |
RTCM Source
Code Block |
---|
"RTCM": { "type": "DualRtkNTRIP", "settings": { "sensor1host": {"some-host-name", "port": "2101", // If specification needed"mountpoint": "some-mount-point", insert first IG1 sensor name here "user": "some-user", //"namepassword": "ig1p232800650050some-password", "autodetectTypeuserAgent": "ig1pLPVR", }"initialLatitude": 35.65736, "rtcminitialLongitude": true139.73239, "imuEndpointforwardGnss": "tcp://*:8802" true } } |
Parameter name | Description | Default |
---|---|---|
type | Type of |
RTCM correction data source. Currently only |
DualRtk
|
NTRIP |
name
The name of the LPMS-IG1P sensor used in this setup. This parameter is optional. If FusionHub is operated at the same time with LPVR-DUO, we recommend specifying the sensor name. Look up the sensor name in LpmsControl 2.
n/a
autodetectType
Type of sensor to be autodetcted
ig1p
rtcm
Set to true if RTCM input is to be received eg. from an NTRIP source.
false
imuEndpoint
Output endpoint of IMU data. This parameter is optional.
tcp://*:8802
Option 2 - Separate LPMS-IG1 IMU and RTK GPS sources (with NTRIP caster for RTK correction)
LPMS-IG1 Source
...
host | NTrip caster host. | 192.168.1.1 |
port | NTrip caster port. | 2101 |
mountpoint | NTrip mountpoint or stream to receive rtcm correction data. | |
user | NTrip caster username. | |
password | NTrip caster password. | |
userAgent | Name of user agent when connecting to NTrip caster. | LPVR-POS |
initialLatitude | Latitude to forward to Ntrip caster on first connect. | 0.0 |
initialLongitude | Longitude to forward to Ntrip caster on first connect. | 0.0 |
forwardGnss | Set true if gnss data from gnss source is to be forwarded to NTRIP caster. This is useful if Ntrip caster offers dynamic switching of RTCM correction data based on forwarded location. | false |
GNSS Source
Code Block |
---|
"gnss": { "type": "OpenZenNMEA", "settings": { "autodetectTypeport": "ig1"/dev/ttyUSB0", } } |
...
Parameter name
...
Description
...
Default
...
type
...
Type of IMU. At the moment only OpenZen IMUs are supported.
...
OpenZen
...
name
...
The name of the LPMS-IG1 sensor used in this setup. This parameter is optional. If FusionHub is operated at the same time with LPVR-DUO, we recommend specifying the sensor name. Look up the sensor name in LpmsControl 2.
...
n/a
...
autodetectType
...
Type of sensor to be autodetcted
...
ig1
...
imuEndpoint
...
Output endpoint of IMU data. This parameter is optional.
...
tcp://*:8802
RTCM Source
Code Block |
---|
"RTCM "baudrate": 115200, "rtcm": true } } |
Parameter name | Description | Default |
---|---|---|
type | Data output format for gnss data source. Currently only | NMEA |
port | Serial port number for gnss source. | |
baudrate | Serial port baudrate to connect to gnss source. For Linux this parameter needs to be in format /dev/tty with | |
rtcm | Set true to enable RTCM correction data forwarding from RTCM source to gnss module. | false |
CAN bus and vehicle decoder source
Code Block |
---|
"vehicle": { "type": "NTRIPAutomotive", "settingsvehicleStateEndpoint": { "host": "some-host-name", "tcp://*:8999", "portsettings": "2101",{ "mountpointcanInterface": "some-mount-pointPeakCAN", "uservehicleType": "some-userR56", "password": "some-password", "userAgent": "LPVR", "initialLatitude": 35.65736, "initialLongitude": 139.73239, "forwardGnss": true } } |
...
Parameter name
...
Description
...
Default
...
type
...
Type of RTCM correction data source. Currently only NTRIP
is allowed.
...
NTRIP
...
host
...
NTrip caster host.
...
192.168.1.1
...
port
...
NTrip caster port.
...
2101
...
mountpoint
...
NTrip mountpoint or stream to receive rtcm correction data.
...
user
...
NTrip caster username.
...
password
...
NTrip caster password.
...
userAgent
...
Name of user agent when connecting to NTrip caster.
...
LPVR-POS
...
initialLatitude
...
Latitude to forward to Ntrip caster on first connect.
...
0.0
...
initialLongitude
...
Longitude to forward to Ntrip caster on first connect.
...
0.0
...
forwardGnss
...
Set true if gnss data from gnss source is to be forwarded to NTRIP caster. This is useful if Ntrip caster offers dynamic switching of RTCM correction data based on forwarded location.
...
false
GNSS Source
Code Block |
---|
"gnss": {
"type": "NMEA",
"settings": {
"port": "/dev/ttyUSB0",
"baudrate": 115200,
"rtcm": true
}
} |
...
Parameter name
...
Description
...
Default
...
type
...
Data output format for gnss data source. Currently only NMEA
is allowed.
...
NMEA
...
port
...
Serial port number for gnss source.
...
baudrate
...
Serial port baudrate to connect to gnss source.
...
rtcm
...
Set true to enable RTCM correction data forwarding from RTCM source to gnss module.
...
false
CAN bus and vehicle decoder source
Code Block |
---|
"vehicle} } |
Parameter name | Description | Default |
---|---|---|
type | Type of vehicle. Currently only | Automotive |
vehicleStateEndpoint | Endpoint for vehicle state output | tcp://*:8999 |
canInterface | CAN interface used for readin odometry data. Allowed options:
| PeakCAN |
vehicleType | Type of vehicle. Currently supported vehicles have to be manually added. Contact us for details. | R56 (BMW Mini) |
Low-dynamics Filter
General
The low dynamics (LD) filter combines odometry, GPS and IMU data to calculate the global position of a vehicle. This filter was initially concipated to work only with odometry and GPS data to calculate the 2D position and yaw angle of a vehicle. It is therefore suitable for simple tracking scenarios. For more complicated, for example augmented reality, applications we recommed using the HD filter as it outputs globally referenced 3D orientation additionally to globally referenced position. This filter relies heavily on the wheel velocity data of the car published on the car’s CAN bus. Therefore the quality of the output of this filter depends on the accuracy of this information.
Notes on Data Output
The LD filter outputs fusedVehiclePose
. The FusedVehiclePose contains a 3D acceleration vector. The acceleration is defined in the following manner: There's a configuration flag imuToCarRotation which takes a quaternion used to rotate vectors in the IMU frame to the car frame. By default it is the identity quaternion. For the LD model, the measured IMU acceleration is simply rotated by the imuToCarRotation
and written to the output.
In the LD filter, pitch and roll has to be derived from the acceleration data based on a model of the stiffness of the chassis. That assumes a flat surface. The HD model offers the full 6-DOF, and we are planning to unify them to have all data available at all times.
Notes on IMU Arrangement
LPMS-IG1P needs to be installed in the vehicle in a known orientation ideally with the coordinate axes of the IMU arranged in parallel to the vehicle coordinate system. The LD filter uses the imuTurnRateAxis
parameter to determine which axis it should use to calculate the vehicle’s orientation. For example if the IMU is installed in the car so that the Z axis is pointing upwards, imuTurnRateAxis
should be set to 0, 0, 1
.
Configuration Block
Insert the following configuration block into your config.json
file to activate the LD filter. The filter's node name is vehicularFusion
.
Code Block |
---|
"vehicularFusion": { "typeechoFusedPose": "Automotive"false, "vehicleStateEndpointendpoint": "tcp://*:89998801", "settingsfuser": { "canInterfacefitModel": "PeakCANSimpleCarModel", "vehicleTypedriveModel": "R56Differential", } } |
...
Parameter name
...
Description
...
Default
...
type
...
Type of vehicle. Currently only Automotive
allowed.
...
Automotive
...
vehicleStateEndpoint
...
Endpoint for vehicle state output
...
tcp://*:8999
...
canInterface
...
CAN interface used for readin odometry data. Allowed options:
PeakCAN
Vector
...
PeakCAN
...
vehicleType
...
Type of vehicle. Currently supported vehicles have to be manually added. Contact us for details.
...
R56 (BMW Mini)
Filter Outputs
The LD filter outputs fusedVehiclePose
. The FusedVehiclePose contains a 3D acceleration vector. The acceleration is defined in the following manner: There's a configuration flag imuToCarRotation which takes a quaternion used to rotate vectors in the IMU frame to the car frame. By default it is the identity quaternion. For the LD model, the measured IMU acceleration is simply rotated by the imuToCarRotation and written to the output.
In the LD filter, pitch and roll has to be derived from the acceleration data based on a model of the stiffness of the chassis. That assumes a flat surface. The HD model offers the full 6-DOF, and we are planning to unify them to have all data available at all times.
...
"velError": 0.277777778,
"omegaError": 0.5,
"measurementError": 0.1,
"smoothFit": true,
"useImuTurnRate": true,
"imuTurnRateAxis": {
"x": 1,
"y": 0,
"z": 0
},
"imuToCarRotation": {
"w": 1,
"x": 0,
"y": 0,
"z": 0
}
}
} |
See below a description of the parameter options of the LD filter.
Parameter name | Description | Default |
---|---|---|
echoFusedPose | fusedVehiclePose output is printed to command line | false |
endpoint | Output port for the fusion result | 8801 |
fitModel | Model to use for fusion. At the moment only | SimpleCarModel |
driveModel | Model used to calculate the car trajectory from CAN bus data. If the steering wheel data and steering model are provided, | Differential |
velError | Velocity error for Kalman filter. Keep default value. | 0.277777778 |
omegaError | Omega error for Kalman filter. Keep default value. | 0.5 |
measurementError | Measurement error for Kalman filter. Keep default value. | 0.1 |
smoothFit | Enable this option to prevent filter output from jumping between odometry data and GPS measurement. Keep enabled. | true |
useImuTurnRate | If enabled the IMU turn rate is used instead of the wheel velocity based turn rate. Recommended. | false |
imuTurnRateAxis | The IMU axis to use for the Turn rate if | 1, 0, 0 |
imuToCarRotation | Rotation that is applied to accelerometer data from IMU before output | 1, 0, 0, 0 |
Output Format
See a technical description of FusionHub’s communication interface in one of the following chapters.
JSON
Code Block |
---|
{
"fusedVehiclePose": {
"acceleration": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"globalPosition": {
"x": 0.0,
"y": 0.0
},
"lastDataTime": {
"timestamp": 0
},
"position": {
"x": 0,
"y": 0
},
"timestamp": {
"timestamp": 0
},
"utmZone": "31T",
"yaw": 0
}
} |
Protobuf
Code Block |
---|
syntax = "proto3";
package Fusion.proto;
message Vector2 {
double x = 2;
double y = 3;
}
message Vector {
double x = 2;
double y = 3;
double z = 4;
}
message FusedVehiclePose {
int64 timestamp = 1;
Vector2 position = 2;
Vector2 global_position = 3;
double yaw = 4;
string utm_zone = 5;
int64 timecode = 6; // Optional: if 0 not set.
Vector acceleration = 7;
}
message StreamData {
int32 sequence_number = 1;
FusedVehiclePose fused_vehicle_pose = 9;
} |
Parameter name | Description | Unit |
---|---|---|
acceleration | 3D acceleration vector as measured by IMU. Describes the orientation of the vehicle in the vehicle coordinate system. | m/s^2 |
globalPosition | Longitude and latitude in degrees | degrees |
lastDataTime | Unused | s |
position | Position relative to starting point with X pointing North and Y pointing East in the current UTM frame | m |
timestamp | Timestamp of data acquisition | ns |
utmZone | UTM zone | UTM string |
yaw | Globally referenced yaw angle | rad |
Info |
---|
After starting FusionHub, while the car is static, the filter will not deliver a correct yaw angle. The angle will be adjusted to the correct direction after a few seconds of driving |
...
Code Block |
---|
{
"fusedVehiclePose": {
"acceleration": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"globalPosition": {
"x": 0.0,
"y": 0.0
},
"lastDataTime": {
"timestamp": 0
},
"position": {
"x": 0,
"y": 0
},
"timestamp": {
"timestamp": 0
},
"utmZone": "31T",
"yaw": 0
}
} |
...
Parameter name
...
Description
...
Unit
...
acceleration
...
3D acceleration vector as measured by IMU. Describes the orientation of the vehicle in the vehicle coordinate system.
...
m/s^2
...
globalPosition
...
Longitude and latitude in degrees
...
degrees
...
lastDataTime
...
Unused
...
s
...
position
...
Position relative to starting point with X pointing North and Y pointing East in the current UTM frame
...
m
...
timestamp
...
Timestamp of data acquisition
...
ns
...
utmZone
...
UTM zone
...
UTM string
...
yaw
...
Globally referenced yaw angle
...
rad
High-Dynamics Filter (IMU + GPS)
Node name: gnssImuFusion
Configuration block example (in sinks
section)
Code Block |
---|
"gnssImuFusion": {
"echoFusedPose": false,
"endpoint": "tcp://*:8803",
"fuser": {
"fitModel": "ModelGnssImu",
"accelError": 0.01,
"omegaError": 0.02,
"measurementError": 0.05,
"imuToCarRotation": {
"w": 1,
"x": 0,
"y": 0,
"z": 0
}
}
} |
...
Parameter name
...
Description
...
Default
...
echoFusedPose
...
fusedVehiclePose
output is printed to command line
...
false
...
endpoint
...
Output port for the fusion result
...
8801
...
fitModel
...
Model to use for fusion.
...
ModelGnssImu
...
accelError
...
Acceleration error for Kalman filter. Keep default value.
...
0.01
...
omegaError
...
Omega error for Kalman filter. Keep default value.
...
0.02
...
measurementError
...
Measurement error for Kalman filter. Keep default value.
...
0.05
...
imuToCarRotation
...
Orientation quaternion of IMU relative to car frame
...
1, 0, 0, 0
...
smoothFit
...
Enable this option to prevent filter output from jumping between IMU data and GPS measurement. Keep enabled.
...
true
Setting up the ImuToCarRotation parameter
The used car frame is VW coordinate frame,
Code Block |
---|
VW frame
x: back
y: right
z: up |
...
The IMU sensor can be mounted in any way but the ImuToCarRotation
quaternion need to be provided to transform the IMU data into VW frame.
Example
If the IMU is mounted like follows,
Code Block |
---|
IMU mounting
x: forward
y: left
z: up |
To match the VW frame, we need a 180° rotation around the z axis (clockwise). Therefore, the rotation matrix would be,
Code Block |
---|
[ -1, 0, 0;
0, -1, 0;
0, 0, 1 ] |
And the orientation quaternion woud be [x, y, z, w] = [ 0, 0, 1, 0 ]
which can be specified in the configuration like below,
Code Block |
---|
"imuToCarRotation": {
"w": 0,
"x": 0,
"y": 0,
"z": 1
} the vehicle. The exact output data format is described below. |
High-Dynamics Filter
General
The high dynamics filter combines IMU and GPS data to calculate the global position of a vehicle. Instead of using the odometry it uses IMU data to determine the orientation changes of a car on the X, Y and Z axis. The direction of the vehicle is globally referenced from the GPS system. For increasing the direction reference quality a dual-antenna GPS system can be used.
The high dynamics filter works well for scenarios with agressive driving maneuvers such as drifting and cornering. During such maneuvers the turning motion of the wheels generally doesn’t directly correspond with the direction of the vehicle. Therefore for this filter don’t rely on wheel velocity measurements. This filter uses information from the wheels only to determine if the car has come to a full stop.
As the filter relies heavily on GPS measurements it doesn’t deliver good results indoors. The better GPS reception, the better the resulting output of the filter. In it’s current state it therefore only works outdoors. In a future version that combines LD and HD filters, this issue will be resolved.
Notes on Filter Output
This Filter outputs:
fusedVehiclePose
(2D pose): Output equivalent to the LD filter output. Includes position in meters relative to starting point, global position (lon, lat) and heading.fusedPose
(3D pose): relative to starting point, x, y (in meters) + z (height) + 3D orientation quaternionglobalFusedPose:
globally referenced 3D position (longitude, latitude, height) + 3D orientation quaternion in ENU frame
IMU Arrangement
The used car frame is the Volkswagen (VW) coordinate frame convention:
|
The IMU sensor can be mounted in any way but the ImuToCarRotation
quaternion needs to be provided to transform the IMU data into VW frame. For example, if the IMU is mounted like follows:
Code Block |
---|
IMU mounting
x: forward
y: left
z: up |
To match the VW frame, we need a 180° rotation around the z axis (clockwise). Therefore, the rotation matrix would be:
Code Block |
---|
[ -1, 0, 0;
0, -1, 0;
0, 0, 1 ] |
And the orientation quaternion woud be [x, y, z, w] = [ 0, 0, 1, 0 ]
which can be specified in the configuration like below:
Code Block |
---|
"imuToCarRotation": {
"w": 0,
"x": 0,
"y": 0,
"z": 1
} |
Check this page for more information on how to calculate the orientation quaternion.
Configuration Block
Insert the following configuration block into your config.json
file to activate the HD filter. The filter's node name is gnssImuFusion
.
Code Block |
---|
"gnssImuFusion": {
"echoFusedPose": false,
"endpoint": "tcp://*:8803",
"fuser": {
"fitModel": "ModelGnssImu",
"accelError": 0.01,
"omegaError": 0.02,
"measurementError": 0.05,
"imuToCarRotation": {
"w": 1,
"x": 0,
"y": 0,
"z": 0
}
}
} |
See below a description of the parameter options for the HD filter.
Parameter name | Description | Default |
---|---|---|
echoFusedPose |
| false |
endpoint | Output port for the fusion result | 8801 |
fitModel | Model to use for fusion. | ModelGnssImu |
accelError | Acceleration error for Kalman filter. Keep default value. | 0.01 |
omegaError | Omega error for Kalman filter. Keep default value. | 0.02 |
measurementError | Measurement error for Kalman filter. Keep default value. | 0.05 |
imuToCarRotation | Orientation quaternion of IMU relative to car frame | 1, 0, 0, 0 |
smoothFit | Enable this option to prevent filter output from jumping between IMU data and GPS measurement. Keep enabled. | true |
Setting up the ImuToCarRotation parameter
This filter needs as input:
...
Code Block |
---|
"vehicle": { "type": "Automotive", "vehicleStateEndpoint": "tcp://*:8999", "settings": { "canInterface": "PeakCAN", "vehicleType": "R56" } } |
This Filter outputs:
...
fusedVehiclePose (2D pose):
Output equivalent to the LD filter output. Includes position in meters relative to starting point, global position (lon, lat) and heading.
...
fusedPose (3D pose):
relative to starting point, x, y (in meters) + z (height) + 3D orientation quaternion
...
Output data format
FusedVehiclePose
...