This dimensionengineering module implements a dimensionengineering sabertooth motor using the rdk:component:motor API.
Note
Before configuring your motor, you must create a machine.
Navigate to the CONFIGURE tab of your machine in the Viam app. Add motor / dimensionengineering:sabertooth to your machine.
To configure a sabertooth motor, you must configure the serial_address, motor_channel, and set the serial_path of the motor. To find your serial device path, first connect the serial device to your machine, then :
- 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 usbto 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": "<serial-path-to-your-motor>",
"serial_address": <int>,
"motor_channel": <int>
}The following attributes are available for viam:dimensionengineering:sabertooth motors:
| Attribute | Type | Required? | Description |
|---|---|---|---|
serial_path |
string | Required | The full filesystem path to the serial device, starting with /dev. |
address |
int | Required | Serial address of the controller. |
motor_channel |
int | Required | Channel the motor is connected to on the controller. |
{
"serial_path": "/dev/serial/by-path/your_device",
"serial_address": 127,
"motor_channel": 1
}- To test your motor, expand the TEST section of its configuration pane or go to the CONTROL tab.
- To write code against your motor, use one of the available SDKs.
- To view examples using a motor component, explore these tutorials.