readIMU
Description
reads all the inertial measurement unit (IMU) data from the Ouster® PCAP file, and returns a structure that contains accelerometer and gyroscope
measurements.imuData
= readIMU(ousterReader
)
[
additionally returns the transformation matrix from the IMU coordinate frame to the lidar
coordinate frame. imuData
,tform
] = readIMU(ousterReader
)
Examples
Read IMU Data from Ouster PCAP File
Download a ZIP file containing an Ouster packet capture (PCAP) file and the corresponding calibration file, and then unzip the file.
zipFile = matlab.internal.examples.downloadSupportFile("lidar","data/ouster_RoadIntersection.zip"); saveFolder = fileparts(zipFile); pcapFileName = [saveFolder,filesep,'ouster_RoadIntersection',filesep,'ouster_RoadIntersection.pcap']; calibFileName = [saveFolder,filesep,'ouster_RoadIntersection',filesep,'OS1-128U.json']; if ~(exist(pcapFileName,"file") && exist(calibFileName,"file")) unzip(zipFile,saveFolder); end
Create an ousterFileReader
object using the PCAP and calibration files, and read the IMU data.
ousterReader = ousterFileReader(pcapFileName,calibFileName); imuData = readIMU(ousterReader);
Display the first three accelerometer readings.
imuData.AccelerometerReadings(1:3,:)
ans=3×1 timetable
Time Acceleration
__________ _______________________________
576.64 sec 0.21555 0.58917 9.7837
576.65 sec 0.22992 -0.40955 9.8387
576.66 sec 0.23471 -0.16286 9.719
Display the first three gyroscope readings.
gyroReadings = imuData.GyroscopeReadings(1:3,:)
gyroReadings=3×1 timetable
Time AngluarVelocity
__________ ______________________________________
576.64 sec -0.0099869 0.033689 -0.012117
576.65 sec -0.0082558 0.025167 -0.0066579
576.66 sec -0.0049268 0.025167 -0.010919
Input Arguments
ousterReader
— Ouster file reader
ousterFileReader
object
Ouster file reader, specified as ousterFileReader
object.
Output Arguments
imuData
— IMU data
structure
IMU data, returned as a structure with these fields:
Field | Description |
---|---|
AccelerometerReadings | Raw accelerometer readings, returned as an
M-by-1 |
GyroscopeReadings | Raw gyroscope readings, returned as an M-by-1
|
tform
— IMU-to-lidar coordinate transformation
rigidtform3d
object
IMU-to-lidar coordinate transformation, returned as a rigidtform3d
object.
Version History
Introduced in R2024b
See Also
ousterFileReader
| reset
| velodyneFileReader
| hesaiFileReader
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)