Live Stream Receiver icon Live Stream Receiver Play live web video and audio streams inside ARC from Chrome/Firefox, streaming directly to ARC camera control; network configuration may be needed. Try it →
Asked
ControlCommand for Sphero from script

Controlcommand For Sphero From Script

I’ve got a Sphero paired over Bluetooth to my Windows laptop and the Sphero Movement Panel in ARC drives it fine (forward/turn/stop from the UI all work). I want to trigger precise moves from a JavaScript skill (for timed routines) and also map some onscreen Dpad buttons to it. I tried calling ControlCommand on the Sphero Movement Panel but I’m not sure what the valid command names/parameters are. Examples I tested:

ControlCommand("Sphero Movement Panel", "Forward")
Sleep(1000)
ControlCommand("Sphero Movement Panel", "Stop")

ControlCommand("Sphero Movement Panel", "SetSpeed", 60)
ControlCommand("Sphero Movement Panel", "Left")

// also tried a heading-style attempt
ControlCommand("Sphero Movement Panel", "Move", 90, 50, 1000)

The panel name matches what I see in the control’s title bar, but either nothing happens or I get an "Unknown command" in the Debug window. I checked the Cheat Sheet for that control and didn’t see Sphero-specific commands listed. As a reference, I noticed the Wowwee Rovio Movement Panel documents ControlCommands like Forward/Reverse/Left/Right/Stop/SetSpeed, which is what I tried to mirror above. Is there a definitive list of ControlCommand names (and any parameters like heading/speed/duration) that the Sphero Movement Panel supports, or should I be using the generic Movement commands instead?

Bonus: I briefly added the Wowwee Rovio panel just to use its big arrow buttons as a Dpad, but they disable when not connected to a Rovio-Is there a generic Dpad style control I can keep active and wire to Sphero via ControlCommand?



Related Hardware (view all EZB hardware)
Sphero by Sphero
Control the Bluetooth Sphero with Synthiam ARC to add speech recognition, scripting and PandoraBot AI via the Sphero Movement Panel.
Bluetooth
Servos
Camera
Audio
UART
I2C
ADC
Digital

Related Robot Skills (view all robot skills)
Create touchscreen robot control panels with buttons, joysticks, sliders, camera views and scripts; multi-page fullscreen UIs for PC and mobile.
Control Sphero via Bluetooth in ARC. Detects two COM ports (one connects); requires deleting and re-pairing after disconnects or reboots.

ARC Pro

Upgrade to ARC Pro

With Synthiam ARC Pro, you're not just programming a robot; you're shaping the future of automation, one innovative idea at a time.

Author Avatar
PRO
Canada
Twitter YouTube GitHub
#1  

Yes - for Sphero you should generally use the generic Movement commands, not ControlCommand() to the Sphero Movement Panel.

Use the Movement API instead of ControlCommand()

Since the Sphero Movement Panel is already the active Movement Panel in the project, these script commands will drive it:

  • Movement.forward(speed, timeOut)
  • Movement.reverse(speed, timeOut)
  • Movement.left(speed, timeOut)
  • Movement.right(speed, timeOut)
  • Movement.stop()
  • Movement.setSpeed(speed)

These are the supported project-level movement commands documented by ARC’s Movement Panel system: https://synthiam.com/Support/ARC-Overview/movement-panels

Example: timed routine in JavaScript

Movement.setSpeed(60);
Movement.forward(60);
sleep(1000);
Movement.stop();

Or with a timed command:

Movement.forward(60, 1000);
Movement.stop();

If you want a turn:

Movement.setSpeed(50);
Movement.left(50, 500);
Movement.stop();

Why ControlCommand("Sphero Movement Panel", ...) is failing

ControlCommand() only works with commands that the specific robot skill exposes. The Sphero Movement Panel typically doesn’t expose the same kind of Forward / Left / SetSpeed control commands that some other skills do. That’s why you’re seeing Unknown command.

You can read more about how ControlCommand() works here: https://synthiam.com/Support/Programming/control-command

For on-screen D-pad buttons

The best option is to use Interface Builder and add a Joystick Pad or buttons that call the generic movement commands.

Option A: Joystick Pad

Add:

Project Add robot skill Interface Builder

Then in the skill’s settings, add a Joystick Pad and set it to control the Movement Panel. That way it will drive Sphero through the project’s active movement system.

Option B: Buttons mapped to script

Create buttons in Interface Builder and assign scripts like:

Movement.forward(60);
Movement.left(50);
Movement.right(50);
Movement.stop();

About using the Rovio panel as a D-pad

That’s not a good fit because some Movement Panel UI elements are tied to their specific robot skill and may disable when disconnected. For a generic, always-available D-pad, use Interface Builder instead: https://synthiam.com/Support/Skills/Remote-Control/Interface-Builder?id=16063

If you want precise heading control on Sphero

For heading-style moves, the Sphero Movement Panel may expose its own settings in the kebab menu / skill configuration, but scripting should still be done through the generic movement functions unless the skill documentation explicitly lists a ControlCommand.

If you want, I can help you build:

  1. a JavaScript timed routine for Sphero, or
  2. a custom Interface Builder D-pad with button scripts.

If you’d like, paste the exact name of your Sphero Movement Panel title bar and I can help map the buttons correctly.

I am a customer support AI and still learning. Please verify important answers in our support documentation. For advanced AI features, use the AI Script Agent built into ARC.