Programming the Bittle via its mobile App
The mobile apps of Petoi have a simple yet powerful interface to teach adults and kids how to program robots.
Petoi Mobile App
We were part of the Kickstarter campaign of Petoi Bittle robot and first wrote about it in March 2021. We have seen how the Bittle has become popular amongst in research and industrial use cases.
However, one powerful feature of Bittle that is often overlooked is its ease of use as a platform to learn the mechanics of robots, specifically quadruped robots. While there are a lot of home robots in the marketplace, we at ‘Learn With A Robot’ strive to identify those that can be programmed easily, and thereby used as a tool to learn. And we are happy to report that the Bittle gets very high scores in this regard.
Since the Bittle was originally released, Petoi has been working hard on it, and released a slew of software to make programming the Bittle easy. In this article, we will discuss one of the ways to program the Bittle, via its mobile app.
The Petoi mobile app is a neat way to connect to the Petoi robots (Nybble and Bittle) with a Bluetooth connection. Two main functionalities of the mobile app are: (i) To provide a way to easily calibrate the Bittle, and (ii) To provide a replacement to the physical remote control. With the help of the mobile app, you can easily move the Bittle or maneuver its postures. In this article, our main focus will be on an additional functionality in the mobile app: sending commands to the Bittle via the serial communication protocol.
Steps
The process of sending short commands to the Bittle is relatively straightforward and consists of three steps:
Open the Petoi App and connect to your Bittle robot via bluetooth. Prior to this step, you must attach the Petoi bluetooth Dongle to NyBoard. Petoi has excellent and detailed documentation here. Thereafter, you can power on the Bittle and connect the app to it via bluetooth.
After connecting, you will be asked to choose your robot (out of Nybble and Bittle). Once you choose Bittle, you will be taken to the control panel. The control panel is the equivalent to the physical remote control of the robot. You could make Bittle walk, sit, or do pushups from the control panel.
Specifically, for doing customized things on the Bittle, we will use the section on Customized commands. You can define your own command, which will be transmitted to Bittle, and then Bittle will act on it. Here is a screenshot…
Decide your command. Petoi has an extensive page where they define the serial communication protocol and the commands it supports. There are four different types of commands: i) Tokens, 2) Gaits, 3) Postures, and 4) Behaviors. The page above has good references, but discussing these types of commands is beyond the scope of this tutorial.
You can test your command. If it works successfully, you can save it and reuse it.
Remember, that we are just scratching the surface of what could be done with the Bittle. The mobile app interface is simply the easiest way to program the Bittle. The serial communication protocol is inherently limited: (i)You can only send a single command, and (ii) The command needs to be short. Petoi does provide you options for more advanced programing for the Bittle, as an example, you could code your own gait via the open source OpenCat software.
Examples
Using the serial protocol, we were able to make Bittle do shoulder exercises. The command is:
m 9 -120 9 45 8 -120 8 45
Make sure that your Bittle is sitting before you send this command, else it is likely to topple over. Here is a video on how this looks like:
You can also ask Bittle to do a back flip using the following command:
kbf
And here is a video showing how the Bittle backflips.
In summary, we see a lot of potential for Bittle to be used as a STEM learning gadget. If you are interested in learning with the Bittle, make sure to subscribe to ‘Learn With A Robot’. If you have experience writing programs for Bittle, please add your feedback to this post.