Link Search Menu Expand Document (external link)

Motor Requests


GET

/motor

List all motor information.

Example

localhost:50000/motor

Response

{
  "data": [
    {
      "id": 0,
      "name": "left-foot",
      "description": "foot tilt in/out",
      "position": 0,
      "min": 115,
      "max": 140,
      "default": 127,
      "inverted": true
    },
	...
    {
      "id": 24,
      "name": "head",
      "description": "look up/down",
      "position": 0,
      "min": 70,
      "max": 160,
      "default": 127,
      "inverted": false
    }
  ],
  "message": "getAllMotors"
}

GET

/motor?id=

Returns status of motor.

Argument Description Range
id Motor id 0-24

Example

Return the status of motor 23

localhost:50000/motor?id=23

Response

{
  "data": {
    "id": 23,
    "name": "neck",
    "description": "look left/right",
    "position": 0,
    "min": 1,
    "max": 254,
    "default": 127,
    "inverted": false
  },
  "message": "getMotorInfo"
}

GET

/motor?id=&position=

Moves motor to position and returns motor status.

Argument Description Range
id Motor id 0-24
position Motor position 0-100

Example

Set motor 23 to position 100 and return status

localhost:50000/motor?id=23&position=100

Response

{
  "data": {
    "id": 23,
    "name": "neck",
    "description": "look left/right",
    "position": 0,
    "min": 1,
    "max": 254,
    "default": 127,
    "inverted": false
  },
  "message": "setMotorPos",
  "smartPosition": "1",
  "rawPosition": 4
}

GET

/motor?id=&position=&torq=

Moves motor to position with torque of torq and returns motor status.

Argument Description Range
id Motor id 0-24
position Motor position 0-100
torq Motor torque 0-4

Example

Set motor 23 to position 100 with a torque of 4 and return status

localhost:50000/motor?id=23&position=100&torq=4

Response

{
  "data": {
    "id": 23,
    "name": "neck",
    "description": "look left/right",
    "position": 0,
    "min": 1,
    "max": 254,
    "default": 127,
    "inverted": false
  },
  "message": "setMotorPos",
  "smartPosition": "1",
  "rawPosition": 4
}