Ultrasonic Radar icon Ultrasonic Radar — Ultrasonic on a servo sweeps 180°; radar shows distances and obstacles, integrates with movement panels for automatic avoidance, scriptable GetPing Try it →
 

Index

Every group of Python commands in ARCx at a glance: what each group is for, and every command in it. Click a group to open its page, or a command to jump straight to it. There are 307 commands in 24 groups.

Commands are written as the group, a dot and the command, such as Servo.SetPosition(d0, 90). The commands in Built-in need no group name. The Python page under Scripting explains the language, how the commands are written, and has examples to start from.

Where to find it: the same list is in the ARCx API view of the script editor


Groups

Group What it covers
Built-in The commands every Python script can use without naming a group, the port names, and the list of connected controllers.
ADC Read the analog (ADC) ports of an EZB.
Audio Make the robot speak and play sounds, set the volume, and wait for the person to say one of a list of phrases.
Browser Open web pages, dashboards, video calls and kiosk screens in browser windows on the monitors of the computer ARCx runs on, and control them: move them between monitors, go full screen, run JavaScript inside the page, and pass messages between the page and your script.
Bus Share data with the rest of the robot through the Robot Bus: publish messages on topics and read them back, call services that robot skills, ARCx and other programs provide, look up where one frame is from another, and record topics to play back later.
COM Use the serial (COM) ports of the computer ARCx runs on, such as a USB to serial adapter or an Arduino plugged in by USB.
Console Write to the script console, in the style of a web browser's console, and measure how long things take.
Digital Read and set the digital ports of an EZB.
EZB Information about the EZB controllers: whether one is connected, its battery voltage and its processor temperature, and the levels at which it warns about them.
File Read and write files on the computer ARCx runs on.
Gamepad Read gamepads and joysticks plugged into the computer ARCx runs on: the sticks and triggers as axes, the buttons, the hat (d-pad), motion sensors and battery, and make them rumble.
I2C Talk to I2C devices connected to an EZB, such as sensors, displays and expansion boards.
Kinematics Move robot arms by where the end of the arm (the end effector) should go, rather than joint by joint.
Log Write entries to the ARCx debug log (Side menu → Views → Debug Log), which keeps a record after the script console has been cleared.
Movement Drive the robot through whichever movement panel robot skill the project has, such as a continuous rotation servo panel, an H-bridge panel or a robot's own driver.
Navigation Feed the robot's position and sensor scans to ARCx's navigation system, which navigation robot skills use to build maps and plan routes, and set whether navigation is running, paused or cancelled.
Net Talk to the network: download a web page or call a web service (HTTP GET), post data to one (HTTP POST), check whether the internet can be reached, and send UDP messages to other devices.
Ping Read HC-SR04 style ultrasonic distance sensors connected to an EZB.
PWM Set the pulse width modulation (PWM) of a digital port, from 0 to 100 percent.
Servo Move servos and read them.
UART Talk to serial devices connected to an EZB.
UI Talk to the person at the browser and change what they see: show popup notices and messages, ask questions and wait for the answer, bring a robot skill or a workspace to the front, and show and navigate Custom UI screens.
Utility Everything else: random numbers, converting a value from one range to another, working with bits, waiting until a time of day, running a program or opening a web page on the computer, loading a project, checking for an ARCx update, and shutting down or sleeping the computer.
Vision Ask what a camera sees, one frame at a time: count and find colors, read the average color and the brightness. Plain numbers come back; a script never holds a camera image.

Commands by group

Built-in

The commands every Python script can use without naming a group, the port names, and the list of connected controllers.

print · printHex · sleep · sleepRandom · halt · getVar · setVar · setVarObject · varExists · deleteVar · controlCommand · showControl · showDesktop

ADC

Read the analog (ADC) ports of an EZB. An analog port measures a voltage, such as from a potentiometer, a light sensor or a battery divider, as a number from 0 (0 volts) to 255 (5 volts), or 0 to 4095 with the 12 bit commands. The wait commands pause the script until a reading crosses a value.

ADC.Get · ADC.Get12Bit · ADC.WaitForBetween · ADC.WaitForEquals · ADC.WaitForHigher · ADC.WaitForLower

Audio

Make the robot speak and play sounds, set the volume, and wait for the person to say one of a list of phrases. Speech and sound come out of whichever speaker the project plays audio through, the computer or an EZB, which is chosen on the EZB Connection robot skill. Speech uses the project's text to speech robot skill, and listening uses its speech to text robot skill.

Audio.GetOutput · Audio.GetVolume · Audio.IsConnected · Audio.Say · Audio.SayWait · Audio.SetVolume · Audio.SoundNote · Audio.Stop · Audio.WaitForAnySpeech · Audio.WaitForSpeech · Audio.WaitForSpeechRange

Browser

Open web pages, dashboards, video calls and kiosk screens in browser windows on the monitors of the computer ARCx runs on, and control them: move them between monitors, go full screen, run JavaScript inside the page, and pass messages between the page and your script. Each window has a name you choose, so a script can open several and control each one.

Browser.Back · Browser.ClearMessages · Browser.Close · Browser.CloseAll · Browser.Evaluate · Browser.ExecuteScript · Browser.Focus · Browser.Forward · Browser.GetLastMessage · Browser.GetMonitorCount · Browser.GetMonitors · Browser.GetStatus · Browser.GetTitle · Browser.GetUrl · Browser.GetWindowNames · Browser.Hide · Browser.Home · Browser.IsAvailable · Browser.IsLoading · Browser.IsOpen · Browser.MoveToMonitor · Browser.Navigate · Browser.Open · Browser.OpenCustomUI · Browser.OpenFullscreen · Browser.OpenKiosk · Browser.OpenWithOptions · Browser.Reload · Browser.SaveScreenshot · Browser.SendMessage · Browser.SetAlwaysOnTop · Browser.SetBounds · Browser.SetDisplayMode · Browser.SetFullscreen · Browser.SetMediaPermissions · Browser.SetMuted · Browser.SetZoom · Browser.Show · Browser.ShowDevTools · Browser.Stop · Browser.WaitForLoad · Browser.WaitForMessage

Bus

Share data with the rest of the robot through the Robot Bus: publish messages on topics and read them back, call services that robot skills, ARCx and other programs provide, look up where one frame is from another, and record topics to play back later. The same topics and services are open to robot skills, AI assistants and programs outside ARCx, such as Python programs and ROS nodes.

Bus.Call · Bus.Exists · Bus.GetAge · Bus.GetField · Bus.GetFrames · Bus.GetLatest · Bus.GetRate · Bus.GetServices · Bus.GetTopics · Bus.LookupTransform · Bus.Publish · Bus.SetTransform · Bus.StartPlayback · Bus.StartRecording · Bus.StopPlayback · Bus.StopRecording · Bus.TransformPoint · Bus.WaitForMessage

COM

Use the serial (COM) ports of the computer ARCx runs on, such as a USB to serial adapter or an Arduino plugged in by USB. Open the port with its name and speed, write text or bytes, read what comes back, and close it when done. For the serial ports of an EZB, use the UART group instead.

COM.Available · COM.AvailablePorts · COM.ClearInputBuffer · COM.Close · COM.IsPortOpen · COM.Open · COM.Read · COM.ReadAllText · COM.ReadByte · COM.ReadLine · COM.Write · COM.WriteString · COM.WriteStringNewLine

Console

Write to the script console, in the style of a web browser's console, and measure how long things take. log, info, warn and error print a line; time and timeEnd time a piece of the script; count counts how many times a line runs. Unlike other groups, these command names start lower case, except LogToARC.

Console.count · Console.error · Console.info · Console.log · Console.LogToARC · Console.time · Console.timeEnd · Console.warn

Digital

Read and set the digital ports of an EZB. A digital port is either on (true, a voltage) or off (false). Set one to turn an LED or a relay on and off; read one to check a button or a switch. The wait command pauses the script until a port changes.

Digital.Get · Digital.Set · Digital.SetRandom · Digital.Toggle · Digital.Wait

EZB

Information about the EZB controllers: whether one is connected, its battery voltage and its processor temperature, and the levels at which it warns about them. EZB 0 is the first controller in the project.

EZB.GetCPUTemp · EZB.GetVoltage · EZB.IsConnected · EZB.SetCPUTemp · EZB.SetVoltage

File

Read and write files on the computer ARCx runs on. Writing adds to the end of a file and creates it if needed. Reading can take the whole file at once, or a line, a character or a byte at a time from a read position that moves forward as you read. Use full paths, such as C:\Robot\log.txt on Windows.

File.Append · File.AppendString · File.AppendStringLine · File.Delete · File.Exists · File.GetLength · File.GetReadPosition · File.IsFileOpenForReading · File.IsReadEnd · File.ReadAllText · File.ReadByte · File.ReadChar · File.ReadClose · File.ReadLine · File.ReadRandomLine · File.ReadReset · File.SetReadPosition

Gamepad

Read gamepads and joysticks plugged into the computer ARCx runs on: the sticks and triggers as axes, the buttons, the hat (d-pad), motion sensors and battery, and make them rumble. Controller 0 is the first one plugged in. Standard names such as "LeftX" or "A" work for gamepads; the raw commands read any joystick by number.

Gamepad.GetAccelerometer · Gamepad.GetAxis · Gamepad.GetAxisNames · Gamepad.GetBattery · Gamepad.GetButton · Gamepad.GetButtonNames · Gamepad.GetControllerType · Gamepad.GetCount · Gamepad.GetGyro · Gamepad.GetHat · Gamepad.GetHatCount · Gamepad.GetName · Gamepad.GetNames · Gamepad.GetRawAxis · Gamepad.GetRawAxisCount · Gamepad.GetRawButton · Gamepad.GetRawButtonCount · Gamepad.IsConnected · Gamepad.IsGamepad · Gamepad.Rumble · Gamepad.RumbleMotors · Gamepad.SetLED · Gamepad.StopRumble · Gamepad.WaitForButton

I2C

Talk to I2C devices connected to an EZB, such as sensors, displays and expansion boards. Each device has an address; write bytes or text to it and read bytes back. The clock speed sets how fast the I2C bus runs.

I2C.Read · I2C.ReadByte · I2C.ReadString · I2C.SetClockSpeed · I2C.Write · I2C.WriteString

Kinematics

Move robot arms by where the end of the arm (the end effector) should go, rather than joint by joint. Each arm is a kinematic chain, named in the project; positions are in millimetres from the arm's base (+X forward), and orientation is roll, pitch and yaw in degrees. ARCx works out the joint angles and moves the servos.

Kinematics.Exists · Kinematics.GetChains · Kinematics.GetDescription · Kinematics.GetJointAngles · Kinematics.GetJointCount · Kinematics.GetLastMessage · Kinematics.GetPitch · Kinematics.GetPose · Kinematics.GetPosition · Kinematics.GetProvider · Kinematics.GetRoll · Kinematics.GetX · Kinematics.GetY · Kinematics.GetYaw · Kinematics.GetZ · Kinematics.IsMoving · Kinematics.MoveLinear · Kinematics.MoveLinearAndWait · Kinematics.MoveRelative · Kinematics.MoveRelativeAndWait · Kinematics.MoveTo · Kinematics.MoveToAndWait · Kinematics.MoveToPose · Kinematics.Stop · Kinematics.StopAll · Kinematics.SupportsOrientation · Kinematics.WaitForMoveComplete · Kinematics.WasLastMoveReachable

Log

Write entries to the ARCx debug log (Side menu → Views → Debug Log), which keeps a record after the script console has been cleared.

Log.Add

Movement

Drive the robot through whichever movement panel robot skill the project has, such as a continuous rotation servo panel, an H-bridge panel or a robot's own driver. Movements keep going until another movement or a stop, so a script can start the robot driving and carry on. Speeds run from 0 (stopped) to 255 (full speed). The wait commands pause until something, such as a joystick or another script, moves the robot that way.

Movement.Down · Movement.Forward · Movement.FromString · Movement.GetSpeed · Movement.GetSpeedLeft · Movement.GetSpeedRight · Movement.Land · Movement.Left · Movement.Reverse · Movement.Right · Movement.RollLeft · Movement.RollRight · Movement.SetSpeed · Movement.SetSpeedLeft · Movement.SetSpeedRight · Movement.Stop · Movement.Takeoff · Movement.Up · Movement.WaitForDown · Movement.WaitForForward · Movement.WaitForLeft · Movement.WaitForReverse · Movement.WaitForRight · Movement.WaitForStop · Movement.WaitForUp

Feed the robot's position and sensor scans to ARCx's navigation system, which navigation robot skills use to build maps and plan routes, and set whether navigation is running, paused or cancelled. Most projects let their sensor robot skills do this; these commands are for sensors and position sources a script reads itself.

Navigation.SetNavigationStatusToNavigating · Navigation.SetNavigationStatusToPause · Navigation.SetNavigationStatusToStopCancel · Navigation.UpdatePose · Navigation.UpdateScan

Net

Talk to the network: download a web page or call a web service (HTTP GET), post data to one (HTTP POST), check whether the internet can be reached, and send UDP messages to other devices.

Net.HTTPGet · Net.HTTPPost · Net.IsInternetAvailable · Net.SendUDP

Ping

Read HC-SR04 style ultrasonic distance sensors connected to an EZB. Each sensor uses two ports, trigger and echo. Distances are a number from 0 to 255, larger meaning farther. The wait commands pause the script until something comes closer or moves away.

Ping.Get · Ping.WaitForBetween · Ping.WaitForEquals · Ping.WaitForHigher · Ping.WaitForLower

PWM

Set the pulse width modulation (PWM) of a digital port, from 0 to 100 percent. PWM switches a port on and off very quickly, so the share of time it is on sets an LED's brightness or a motor driver's speed.

PWM.Get · PWM.Set · PWM.SetRandom

Servo

Move servos and read them. Positions normally run from 1 to 180, kept inside each servo's minimum and maximum limits. Velocity sets how fast a servo moves to its next position and acceleration how gently it starts; release lets a servo go limp. Servos on an EZB's d0 to d23 ports and virtual ports v0 and up (used by servo driver robot skills such as Dynamixel) are moved the same way.

Servo.Decrement · Servo.GetAcceleration · Servo.GetFineTuneOffset · Servo.GetPosition · Servo.GetPositionRealtime · Servo.GetVelocity · Servo.Increment · Servo.IsReleased · Servo.Release · Servo.ReleaseAll · Servo.SetAcceleration · Servo.SetFineTuneOffset · Servo.SetMaxPositionLimit · Servo.SetMinPositionLimit · Servo.SetPosition · Servo.SetPositionRandom · Servo.SetVelocity · Servo.WaitForMove · Servo.WaitForPositionEquals · Servo.WaitForPositionHigher · Servo.WaitForPositionLower

UART

Talk to serial devices connected to an EZB. The hardware UART commands open one of the EZB's serial ports at a speed, write to it and read what has arrived. The send serial commands send bytes or text out of any digital port as software serial, without needing a hardware UART. For the serial ports of the computer itself, use the COM group.

UART.HardwareUartAvailable · UART.HardwareUartRead · UART.HardwareUartReadAvailable · UART.HardwareUartReadString · UART.HardwareUartReadStringAvailable · UART.HardwareUartWrite · UART.HardwareUartWriteString · UART.InitHardwareUart · UART.SendSerial · UART.SendSerialString

UI

Talk to the person at the browser and change what they see: show popup notices and messages, ask questions and wait for the answer, bring a robot skill or a workspace to the front, and show and navigate Custom UI screens.

UI.CustomUIBack · UI.CustomUIHome · UI.GetCustomUIScreen · UI.GetCustomUIScreens · UI.IsWebClientConnected · UI.NavigateTo · UI.PromptForAnyNumber · UI.PromptForChoices · UI.PromptForNumberRange · UI.PromptForUserInput · UI.ShowControl · UI.ShowCustomUI · UI.ShowDesktop · UI.ShowDialogMessage · UI.ShowPopupMessage · UI.ShowTextInputPrompt

Utility

Everything else: random numbers, converting a value from one range to another, working with bits, waiting until a time of day, running a program or opening a web page on the computer, loading a project, checking for an ARCx update, and shutting down or sleeping the computer.

Utility.Browser · Utility.CheckForUpdate · Utility.ClearGlobalVariable · Utility.ControlCommand · Utility.Exec · Utility.GetBit · Utility.GetRandom · Utility.GetRandomUnique · Utility.LoadProject · Utility.Map · Utility.SetBits · Utility.ShutdownPC · Utility.SleepPCHibernate · Utility.SleepPCSuspend · Utility.WaitUntilTime

Vision

Ask what a camera sees, one frame at a time: count and find colors, read the average color and the brightness. Plain numbers come back; a script never holds a camera image.

Vision.AverageColor · Vision.Brightness · Vision.ColorPercent · Vision.CountColor · Vision.FindColor · Vision.GetSources