This wit-motion module implements a WitMotion imu movement sensor, including the HWT905-TTL IMU model using the rdk:component:movement_sensor
API.
The imu-wit
movement sensor model supports the following IMUs manufactured by :
- BWT61CL
- BWT901CL
- HWT901B-TTL
The imu-wit-hwt905
movement sensor model supports the HWT905-TTL IMU manufactured by WitMotion.
Other WitMotion IMUs that communicate over serial may also work with this model but have not been tested.
Note
Before configuring your movement_sensor, you must create a machine.
Navigate to the CONFIGURE tab of your machine in the Viam app. Add movement_sensor / wit-motion:imu-wit to your machine.
To configure a wit-motion movement sensor, you must set the serial path. To find your serial device path, first connect the serial device to your machine:
- On Linux, run
ls /dev/serial/by-path/
to show connected serial devices, or look for your device in the output ofsudo dmesg | grep tty
. Example:"/dev/serial/by-path/usb-0:1.1:1.0"
. - On macOS, run
ls /dev/tty* | grep -i usb
to show connected USB serial devices,ls /dev/tty*
to browse all devices, or look for your device in the output ofsudo dmesg | grep tty
. Example:"/dev/ttyS0"
.
{
"serial_path": "<your-port>",
"serial_baud_rate": <int>
}
The following attributes are available for viam:wit-motion:imu-wit
movement_sensors:
Attribute | Type | Required? | Description |
---|---|---|---|
serial_path |
string | Required | The full filesystem path to the serial device, starting with `/dev/ |
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 |
{
"serial_path": "/dev/serial/by-path/usb-0:1.1:1.0",
"serial_baud_rate": 115200
}
{
"serial_path": "/dev/serial/by-path/usb-0:1.1:1.0",
"serial_baud_rate": 115200
}
- To test your movement_sensor, expand the TEST section of its configuration pane or go to the CONTROL tab.
- To write code against your movement_sensor, use one of the available SDKs.
- To view examples using a movement_sensor component, explore these tutorials.