Connect with users of Wolfram technologies to learn, solve problems and share ideas
Mark as an Answer
9 Total Likes
Follow this post
Share this post:
Augmented and Virtual Realities
Connection to Sphero robot from Mathematica
Phil Ngo, Wolfram Research
11 years ago
I have been an intern at Wolfram Research for the summer and ended up writing
for connecting to a
robot. Sphero is a little spherical robot that you can drive on land or in water from your iPhone, iPad, Android, tablet and (now) from Mathematica.
The package uses
and Bluetooth to connect to Sphero. I included a sample notebook to help people get started that shows how to load the package, connect via bluetooth, etc. I embedded the SerialIO package as well.
You'll need to find figure out which virtual serial port was opened by Bluetooth, but once you do so, this command gets you up and running. I've only done this on Mac, so if anyone succeeds on a Windows or Linux machine, would you post how you did it?
mySphero = SpheroDeviceConnect["/dev/tty.Sphero-BWR-RN-SPP"]
The package is in its infancy, but already lets you do some pretty cool stuff. My favorite uses Sphero to control a Graphics3D object - twist and turn Sphero in your hand and watch your Graphics3D object mimic its twists and turns on the screen. If you find some other cool ways to interact with Sphero from within Mathematica, please post.
Access Sphero's data with this command, which returns a List of rules that can be used to access the various data fields that Sphero streams.
I would love feedback on how to improve the package. By the way, Sphero 2.0 (looks very cool) came out today - not sure if this package will still work with it, but let me know if it does.
10 years ago
Thanks for developing such a cool package Phil! I was able to get things working on Windows 7 with a minor modification to SerialIO. The solution for me was to remove the unsupported LinkProtocol. The steps that I took appear below.
open the SerialIO init.m file
SpheroConnector \\ SerialIO \\ Kernel \\ init.m
find the following code
Install["SerialIO", LinkProtocol -> "Pipes"]
delete the LinkProtocol option (this was causing an error on my system since Pipes is not supported)
[b][color=#555555][font=Courier][size=2]LinkProtocol -> "Pipes"[/size][/font][/color][/b]
your final code should look likeInstall["SerialIO"]
Now, SpheroConnector.nb should work as expected. Note that windows serial ports are specified as "COM#" (where # is replaced by the actual number of the COM port), the connection code should appear like the following.
mySphero = SpheroDeviceConnect["COM5"]
Moderation Team, WOLFRAM
10 years ago
Dear author of the last Comment, could you please reply here with your full name you use on Community so we can fix "Updating Name" status on your comment?
Rodrigo Murta, Looqbox
11 years ago
This is very cool!..
You could try to use Cristopher's Mathematica leap motion
to control Sphero (also with Mathematica).
Reply to this discussion
in reply to
Community posts can be styled and formatted using the
Tag limit exceeded
Note: Only the first five people you tag will receive an email notification; the other tagged names will appear as links to their profiles.
Add a file to this post
Follow this discussion
Be respectful. Review our
to understand your role and responsibilities.
Wolfram|Alpha Notebook Edition
Volume & Site Licensing
Enterprise Private Cloud
Service Plans Benefits
Wolfram Language Documentation
Wolfram Language Introductory Book
Get Started with Wolfram
Fast Introduction for Programmers
Fast Introduction for Math Students
Webinars & Training
Connected Devices Project
Wolfram Data Drop
Wolfram + Raspberry Pi
. All rights reserved.
Learn how »