Motor
{"cmd":"motor", ...}
This command is used to turn the motors on or off. The user can turn motors off to either save power while the robot is not operational or to place the robot in a predetermined location as a homing process, or to hand train the robot by moving it to different locations manually and saving the positions of those points. This command is submitted to the high priority queue. In response to this command the current state of the motors after the command was applied is returned.
Please note that when the motors are off, the robot still tracks positions of the motors, and as soon as the motors are on again, the motors can continue receiving motion commands as usuall.
Key, value pairs
Key | Value | Required | Description |
---|---|---|---|
"cmd" | "motor" | Yes | Turns motors on or off. The response will be the current state of the motors. |
"id" | Int (>0) | No | Id can be any positive integer. If id is not provided, status of the command will not be returned from the controller. |
"motor" | 0 / 1 | No | 0 will turn all motors off and 1 will turn them on. If this parameter is not present, motors state will not change. |
Response
Key | Value | Description |
---|---|---|
"cmd" | "motor" | In response to motor command a message is returned with cmd field set to motor which includes the current state of the motors. |
"id" | Int (>0) | Same id as the original command. |
"motor" | 0 / 1 | 0 means the motors are off and 1 means the motors are on. |
Example
{"cmd":"motor","id":1, "motor":0}
This command will turn all motors off. The response will include the current state of the motors after the command was applied:
{"cmd":"motor","id":1, "motor":0}
Error codes
Stat | Value |
---|---|
-300 | Halt already in process |
-400 | Alarm activated |