2016 will likely be the year of IoT and after Christmas the new cool kid in town is definitely the Sphero BB8 bluetooth controlled Droid! So walking in Kean's footsteps who controls that robot from AutoCAD, I decided to have a play with it and integrate it with our View & Data API.
Being not much of a designer, I picked a free BB8 model on our Fusion gallery, credits and to thanks Farhan Suhaime. As Fusion model, this translate pretty good material-wise in View & Data API, see translated model.
What took me the most time to implement in that first version is the UI for the panel in the web page in order to control the droid. The virtual joystick allows to send 2d movements commands at specified speed and heading. The LED light can be set to any color and programmatically blinked:
This allows a user to interact with a REST API that controls the actual droid. The implementation is very basic at the moment:The full sample is available from that github repository. Below is a quick video that demo the sample in action, it illustrates controlling the LED light and movement of the droid.
The interest as far as View & Data is concerned is limited at the moment: the 3D model is translated but doesn't get any feedback from the real droid. It however sets the ground for more advanced usage. Having our droids represented in the viewer could allow the user to easily select one and let it perform actions in case we are dealing with more units and more complex environments. The droid can also stream to the controller information about velocity, so it could potentially update the UI by providing feedback.
In the next chapter I will implement a more useful approach where the droid can be controlled remotely from a cloud hosted application. A local node client will connect to that server and send commands to the droid. I'm also thinking taking advantage of the collision detection feature and implement some basic AI to handle obstacles and move around. Stay tuned...
Posted by: Drillep | 04/19/2016 at 06:13 PM
Thanks. The BLE is definitely clunky... what I noticed is that if fails to connect, I use the App from my phone to connect to BB8, then try again with the API and it works fine.
I wrote a 2nd part to that tutorial that you may want to check:
Hope that helps,
Posted by: Philippe Leefsma | 04/19/2016 at 07:15 PM