Mathematica Student Edition
Mathematica Home Edition
Computable Document Format (CDF)
Aerospace Engineering & Defense
Biotechnology & Medicine
Finance, Statistics & Business Analysis
Financial Engineering & Mathematics
Financial Risk Management
Software Engineering & Content Delivery
Authoring & Publishing
Social & Behavioral Sciences
Design, Arts & Entertainment
Game Design, Special Effects & Generative Art
STEM Education Initiative
Community & Technical College Education
Primary & Secondary Education
Computable Document Format (CDF)
High-Performance & Parallel Computing (HPC)
See Also: Technology Guide
Other Ways to Buy
Volume & Site Licensing
Does My Site Have a License?
Wolfram User Portal
About Wolfram Research
Stephen Wolfram's Home Page
Wolfram Functions Site
More Info >>
Mark as an Answer
Connection to Sphero robot from Mathematica
Augmented and Virtual Realities
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.
This is very cool!..
You could try to use Cristopher's Mathematica leap motion
to control Sphero (also with Mathematica).
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"]
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?