Overview#
The Python module imu_py exposes IMUDriver; its public C++ header is imu_driver.hpp. The supported driver is HIPNUC.
Create the interface#
IMUDriver.create_imu(imu_id, interface_type, interface, imu_type, baudrate=0)| Parameter | Meaning |
|---|---|
imu_id |
Device ID; the C++ type is uint16_t |
interface_type |
The HIPNUC implementation supports serial or can |
interface |
Actual serial device path or CAN interface name |
imu_type |
This factory implementation accepts HIPNUC |
baudrate |
Defaults to 0; the actual setting must suit the communication interface and be supported by the implementation |
The factory creates the corresponding communication object; it does not merely parse an offline configuration. Other imu_type values throw IMU type not supported.
Read state#
| Method | Return value and conventions |
|---|---|
get_imu_id() |
Device ID |
get_quat() |
Quaternion [w,x,y,z] |
get_ang_vel() |
[x,y,z], rad/s |
get_lin_acc() |
[x,y,z], m/s² |
get_temperature() |
Temperature; feedback depends on the protocol and device |
Getters read the asynchronously parsed cache. There is no generic synchronous read() or feedback timestamp. Serial parsing converts angular velocity from degrees to radians and acceleration to m/s². Check communication and feedback updates when determining whether the device is online, rather than relying only on initial zeros or repeated identical values.
Coordinate transformations#
Driver output is not automatically expressed in the body frame. The repository's IMU example uses extrinsic_R and SciPy for the transformation, converts wxyz to xyzw at the SciPy boundary, and converts it back afterward. That matrix applies only to the mounting orientation assumed by the example; verify the extrinsics in robot.yaml against the actual body orientation.
For an example that reads the raw cache, see Minimal integration examples. The complete upstream example also depends on NumPy and SciPy.