|
|
DriveWorks SDK Reference| 0.6.67 Release |
The IMU Logger sample works with any serial port (UART) based IMU sensor. The logger requires the IMU sensor to deliver messages in NMEA format.
Test the applications using consumer grade off-the-shelve IMU sensors.
Usually, these IMUs are connected over USB and implement a serial-to-USB connection with the help of FTDI devices. On Linux, these sensors can then be reached over the /dev/ttyUSB or /dev/ttyACM devices.
Check the status of IMU first. For example:
sudo stty -F /dev/ttyUSB0 raw -echo -echoe -echok [Optional baud rate, like 115200] sudo cat /dev/ttyUSB0
You should see raw NMEA sentences with the cat before continuing.
The sample requires the name of the tty device of the IMU sensor, for example:
./sample_imu_logger --driver=imu.uart --params=device=/dev/ttyUSB0,baud=115200
For every valid IMU message that the sample receives, it prints to the console data such as:
Where the first number indicates the timestamp of the received IMU message in microseconds and the rest of the line indicates the IMU information of the sensor.
If no parameters are provided, the sample starts a virtual IMU sensor and interprets the content from the file located at data/samples/sensors/imu/imu.txt as IMU input. Or give it a file:
./sample_imu_logger --driver=imu.virtual --params=file=[pathToData]/imu.txt
Per default, if no baud parameter has been provided imu.uart driver assumes a baudrate of 9600. In order to change the baudrate provide baud argument as:
./sample_imu_logger --driver=imu.uart --params=device=/dev/ttyUSB0,baud=115200
The sample support reading IMU packets from a Xsens device through the imu.xsens driver. The driver expects Xsens device to deliver packets in Xsens proprietary format. To run the sample using Xsens device use:
./sample_imu_logger --driver=imu.xsens --params=device=0,frequency=100
Where device=0 parameter sets the index of the Xsens device (usually 0 if only one device is installed) and frequency=100 sets the frequency in [Hz] this device should operate with.
imu.xsens driver.