Dorna Document

Dorna Document

  • GitHub
  • Dorna.ai

›Commands

Commands

  • Introduction
  • JSON format
  • Messages
  • Order of commands
  • Joint move
  • Rapid move
  • Line move
  • Circle move
  • Halt
  • Alarm
  • Sleep
  • Input
  • Probe
  • Output
  • PWM
  • ADC
  • Joint
  • Motor
  • Tool length
  • Version

Messages

Controller sends, three types of messages to the user. These messages are positions, inputs and command status values, command responses and alarms. Next, we will explain each of these messages in detail.

Positions

These messages are sent periodically to the user and report the position of the robot in real time with a rate of approximately 30 times a second. Each message has the value of all joints of the robot and Cartesian coordinates of the head of the toolhead. In addition to that, each of these messages has the velocity and acceleration of the robot in the space of motion. Here is an example of such a message:

{"j0":3.4 , "j1":1.2 , "j2":97.3 , "j3":22 , "j4": 32.76 , "j5":0 , "j6":0 , "j7":0 , "x":122.3 , "y":674.3 , "z":95.4 , "a":342 , "b":32.6 , "c":0 , "d":0 , "e":0, "vel":120.43, "accel": 804.11}

Note that velocity and acceleration are reported in the space of the motion. For instance if the robot is moving with lmove command, the space is Cartesian space, whereas for jmove command, it is joints space.

Inputs

Upon change in any of the input pins value a message is sent that includes the input values for all 16 input pins. Here is an example of such a message:

{"in0":0 , "in1":0 , "in2":1 , "in3":1 , "in4": 0 , "in5":0 , "in6":1 , "in7":0 , "in8":1 , "in9":0 , "in10":1 , "in11":0 , "in12":1 , "in13":0 , "in14":0 , "in15":0}

Command status

These messages report the status of each command that is sent to the controller, from the time that the command is submitted, to the time that the execution of the command is completed. These messages will only be sent to the user if the corresponding command has an "id" field with a positive integer value. The returned message will have the same id as the command itself. An example of such a message is as follows:

{"id":12, "stat":2}

It means that the command with "id":12, is in status 2. The "stat" field can take different values with the following interpretations:

  • 0: the command has been received by the controller and has no error.
  • 1: the command execution has begun. Note that after commands are received and processed by the controller, they will be submitted to a queue. Depending on the queue type and the position of the command in the queue, the actual execution of the command will be at a later time. When "stat":1 is received, it indicates that the command execution has just started by the controller.
  • 2 : the execution of the command is now completed. Some commands run almost instantly. For those commands there is no delay between receiving "stat":1 and "stat":2 of the command. For example reading an input value will be executed instantly. However, for some other commands, such as move commands or pause commands, the time that the command starts and the time that the command is completed, are different. Users can use the "stat":2 indicator, to sync different events with the completion of certain commands.
  • Negative values : it means that the command has an error and it will not be executed. The stat value represents the type of error that has happened.

If the command sent by the user does not have an "id" field with positive integer value, the command will still be executed, but no status from that command will be returned by the controller.

Command responses

Certain commands will return a response with information about the current state of the controller. These messages are returned by the controller with the same "id" as the original command. They also have a "cmd" field which is the same as the original command. For example, when user needs to read the values of the ADC pins, a message is returned with the values of the ADC pins. We will explain the content of these messages in the section for each command.

Alarms

If the robot hits into some obstacles such that it stops moving on the path that is planned by the controller, the robot will move into the alarm state (read more about alarm state in the alarm section.)

As soon as the robot goes into the alarm state, an alarm message is sent to the user which looks as the following message:

{"cmd":"alarm","alarm":1,"err0":-1046,"err1":-1,"err2":0,"err3":-1,"err4":0,"err5":0,"err6":0,"err7":0}

The alarm message has alarm field set to 1. The message has also err0 to err7 fields which are the errors in the readings of the encoders for motors 0 to 7 of the robot. By inspecting the error values, you can identify the motors that have been stopped moving and have caused the alarm state. In the example above, motor 0 (base motor of the robot), has caused the alarm state.

Last updated on 7/12/2022
← JSON formatOrder of commands →
  • Positions
  • Inputs
  • Command status
  • Command responses
  • Alarms
Dorna website →
Copyright © 2022 Dorna Robotics