Custom Commands and Telemetry
When opening the ArxRobot application, the first thing to notice is the Direction-Pad (D-Pad), or the arrow keys, on the screen. The ArxRobot application will be used to completely control the 3DoT robot manually. What about the commands specific to the robot being programmed? How can an LED be turned on manually? How can the stance of the robot be set to appear aggressive or defensive? In this section, it will discuss how to create custom commands and type of custom commands available on the ArxRobot. For more information on Arxterra Custom Commands and Telemetry, check out the Arxterra YouTube Channel. The video below covers creating custom commands and telemetry in great depth.
This section assumes that the basic set up with the ArxRobot application has been reviewed. If not, start with the section “03 – Getting Started with Arxterra”. Start with opening up the ArxRobot on a mobile device. Enable “Developer Mode”, which allows the user to edit the interface of the control panel. Open the developer options, located on the left of the “Developer Mode” represented as a gear. Click on the option “Custom Command & Telemetry Configuration”, which will direct the user to a screen titled “Custom Entity Definitions” as shown in Figure 10.1. On this screen, it is possible to create all user custom commands.
In the following sections, we will look at each of these seven (7) Arxterra custom command data types.
|Arxterra Data Type||Command Widget||Telemetry Widget|
|● Select||Radio Button or Drop Down Menu|
|● Byte and Unsigned Byte||Slider or Stepper||Text Box|
|● Short and Unsigned Short||Slider or Stepper|
Figure 10.7: Command set to appear on both the control panel (Figure 10.6) and Phone App.
In this next example, we look at a drop-down widget as it would appear with a “Telemetry” flow protocol (left image above) on the control panel and a “Command and Telemetry” protocol (right image).
Figure 10.9 Drop down list Example with Telemetry (left) and Command and Telemetry (right) flow protocols
Byte and Unsigned Byte Command and Telemetry
The Byte and Unsigned Byte will be covered together as both command and telemetry types are very similar to one another with only one major difference between them. The Byte and Unsigned Byte command offers the ability to select or display any integer value between specified ranges. The Byte offers ranges from -128 to 127 while the Unsigned Byte offers ranges from 0 to 255. The main difference between the two is solely the range. As the developer of your robot, choose the most appropriate values for your design. An example on how to choose is by asking yourself if your custom command will be needing values in the negative range. Again, this type of command will only give one output, but of many options.
Data entry is by a slider or a stepper widget. As a telemetry channel data is displayed as gauge (default) or in a box.
Figure 10.11: Byte Data Type implemented as Slider (left) and Stepper (right) widgets
Short and Unsigned Short Command
The purpose of the heading or separator is to create a more user-friendly custom command interface for the user. The heading acts as a title to show a grouping of certain custom commands. The separator is an empty bar to create a more visual separation between two commands.
The figure below shows the difference between the Heading and a Separator. The Separator is essentially a heading without any text in it.
Figure 10.13: Difference between a Heading and a Setting.
Properties for Heading/Separator
- Label: Give the command a name. Leaving an empty label will cause the heading to function as an unlabeled Separator.
- Tip: Include a hover over tip for the control panel if desired.
The example shown in Figure 10.14 creates a separator named “Types of Slider.” Notice that in order to create a separation between custom commands, you have to change the position of the command in the Custom Entity Definitions window. Also keep in mind, there is no command ID sent to the microcontroller when using a Heading/Separator. This header/separator is only used for cosmetic purposes, hence the reason the heading is given an entity ID beyond the custom command ID limits of 0x40 to 0x5F.
Figure 10.14: Example of a Separator
Design your Control Panel
Now that we have covered all the types of custom commands available, think about what type of custom commands or telemetry will your system be using. Keep in mind that some of the custom commands or telemetry may have already been included by the 3DoT library, so take a look at what is already defined in the Commands and Telemetry table located in the Configure.h file of the Robot3DoTBoard folder. A good example of redundant custom commands is creating a custom turn command. Since the ArxRobot app already provides a D-pad for movement, simply modifying the move command in the 3DoT library is a more logical choice. A good example of this can be found in the Robot3DoTBoard folder under the examples folder as “Robot_3DoT_TeleComm”. Fortunately, the ArxRobot mobile app has made creating custom commands a very user-friendly process as there is minimal coding knowledge required. While you are creating your custom commands, refer to this chart for identifying the appropriate command type.