Default Variables

JavaScript and Python variables are private to the namespace of each script engine. That means a variable created in a JavaScript or Python script does not exist in other JavaScript or Python scripts. For example, if you have variables declared in the JavaScript or Python of the Camera control, the variables are not accessible in the JavaScript or Python of the WiiMote control. However, you can share variables across scripts using global variable storage.

Access Public Variables

Public variables use ARC’s global variable storage manager, which is global across all robot skills and compilers. Public variables are accessed to JavaScript and Python using the getVar(), setVar(), and setVarObject() commands. Check the manual for either JavaScript or Python for the syntax of these commands.

Blockly

Blockly generates JavaScript, which means the variables will be private by default. The variables can start with a $ (dollar sign) to be public.

Default Variables

A few global variables are available for specific functions of the ARC internal framework. These variables are populated when ARC initializes and modified when particular components are changed within the framework, such as current movement direction, speed, audio playback, and speech status.

  • $Direction - The current direction in which the robot has been instructed to move. The movement manager handles this variable. When any robot skill instructs a movement, the current movement panel will respond by having the robot move in that direction. This variable is also set with the direction.
  • $EZBPlayingAudio - This variable will be set to true when the ezb is playing audio via the audio stream, such as an MP3 or WAV from a soundboard. Otherwise, when there is no audio playing, this variable is false.
  • $IsSpeaking - This variable will be set to true when the Say() or SayEZB() commands are executed. Otherwise, it will be set to false.
  • $NavigationStatus - When the navigation manager system (NMS) is navigating, the navigation status is stored here. This is used by navigation skills, such as The Better Navigator, which is for SLAM way-point navigation.
  • $SpeakingText - Complimenting the $IsSpeaking variable, this will hold the current text being spoken. When no text is speaking, this variable is cleared and set to an empty string ("").