Configure a WitMotion IMU
An inertial measurement unit (IMU) provides data for the AngularVelocity
, Orientation
, CompassHeading
, LinearAcceleration
, and GetAccuracy
methods.
Acceleration and magnetometer data are available by using the sensor GetReadings
method, which IMUs wrap.
The imu-wit
movement sensor model supports the following IMUs manufactured by WitMotion:
- BWT61CL
- BWT901CL
- HWT901B-TTL
Info
Other WitMotion IMUs that communicate over serial may also work with this model but have not been tested.
If you are using WitMotion’s HWT905 IMU, configure an imu-wit-hwt905
.
Navigate to the CONFIGURE tab of your machine’s page in the Viam app.
Click the + icon next to your machine part in the left-hand menu and select Component.
Select the movement-sensor
type, then select the imu-wit
model.
Enter a name or use the suggested name for your movement sensor and click Create.
Then fill in the attributes as applicable to your movement sensor, according to the table below.
{
"components": [
{
"name": "<your-sensor-name>",
"model": "imu-wit",
"type": "movement_sensor",
"namespace": "rdk",
"attributes": {
"serial_path": "<your-port>",
"serial_baud_rate": <int>
},
"depends_on": []
}
]
}
{
"components": [
{
"name": "myIMU",
"model": "imu-wit",
"type": "movement_sensor",
"namespace": "rdk",
"attributes": {
"serial_path": "/dev/serial/by-path/usb-0:1.1:1.0",
"serial_baud_rate": 115200
},
"depends_on": []
}
]
}
The "serial_path"
filepath used in this example is specific to serial devices connected to Linux systems.
The "serial_path"
filepath on a macOS system might resemble
Attributes
Name | Type | Required? | Description |
---|---|---|---|
serial_path | string | Required | The full filesystem path to the serial device, starting with
|
serial_baud_rate | int | Optional | The rate at which data is sent from the sensor over the serial connection. Valid rates are 9600 and 115200 . The default rate will work for all models. Only the HWT901B can have a different serial baud rate. Refer to your model’s data sheet.Default: 115200 |
Test the movement sensor
After you configure your movement sensor, open the movement sensor’s TEST panel on the CONFIGURE or CONTROL tabs. This panel presents the data collected by the movement sensor. The sections in the panel include the orientation, angular velocity and linear acceleration.
Have questions, or want to meet other people working on robots? Join our Community Discord.
If you notice any issues with the documentation, feel free to file an issue or edit this file.
Was this page helpful?
Glad to hear it! If you have any other feedback please let us know:
We're sorry about that. To help us improve, please tell us what we can do better:
Thank you!