After a few false starts and more or less total rewrites, I have decided that the core functionality of r2_control deserves a 1.0 release.
The last few updates have added some much needed core functionality that makes this code work well for basic driving at events. Future versions will improve on this and add extra modules for more fancy items.
With this release, the following functionality is working, having been tested at a number of events over the last few months.
- Sounds – 486 MP3 tracks installed, and easy to add more.
- Servo control – Can add Adafruit 16 channel PWM controllers and control many servos for opening doors, etc.
- Web control – Built in web interface to do basic controls and testing
- PS3 controller – The PS3 controller is working well, interfacing with the r2_control API to trigger sounds, servos, scripts, etc. It also interfaces directly to the motor controllers for movement.
There is also some WIP functionality that I don’t class as core.
- Monitoring – got a POC of system monitoring (voltages, currents, etc.)
- Telegram – Communication and control over instant messenger
I’ve many plans for future expansion of r2_control for version 2.0, which I will hopefully get time to do in the coming months. These are just some of them:
- Refactor of PWM code using updated Adafruit I2C libraries
- Add modules for rseries logics and flthy HP systems.
- Finish the monitoring system
- Switch the dome control to packet serial rather than PWM servo control
- Move dome control into core r2_control, rather than direct from PS3 controller
- Auto dome (auto center, turn, etc.)
For now, there are too many events coming up to be able to risk taking R2 out of commission, so most of the work will be on tweaking the actual droid and tidying things up.
So, whilst waiting for parts to turn up and paint to dry, I thought I’d make a start on the controls for R2. Simplest would be to just have the drive wheels, dome, and a couple of other bits controlled from a standard hobby RC controller. I’ve got a eight channel one and a few spare receivers so it would’ve been trivial to do that. However, I wanted something a bit more fancy. I’m wanting to have the panels on the dome to be controllable, as well as various controls for the main body panels, arms, fire extinguisher, etc.
My thoughts for this is to use a Raspberry Pi, along with a bunch of peripherals on an i2c bus. Adafruit do a nice i2c 16 channel servo board which a couple of should give enough channels to control everything I want. I will be putting one of these in the dome for all the various flaps, and another in the body for speed controllers and door mechanisms. Using a Pi will give me lots of power for doing controlling the servos and playing sounds, and hopefully I won’t need a real time OS. Future plans will involve voice recognition and maybe even facial recognition!
I’m also wanting to do this as modularly as possible, so to this end my first bit of programming was a daemon to run that listens for commands and sends signals over i2c to the servo controllers. My thinking behind this is that I can write many different interfaces for controls, from a simple web/PHP interface for testing and such like, to another interface to translate bluetooth signals from a PS3 controller. I’ll also be able to write a scripting system to do preset motions.
I’ve put the code for my R2 Control software up on github to keep track of changes and such like. If anyone else feels the urge to use it, or even contribute, they are more than welcome to. I’m no programmer, so I may be going down the wrong path for all this, but its a learning experience. The code seems to work pretty well for now, but still needs to be tested in R2. Theres still a couple of things I need to add before I start doing any of the other programs. Currently the servos will move as fast as possible to their new position so I need to add a loop in there to allow different speeds. I also need to add support for multiple i2c addresses. I should have these things coded in fairly soon hopefully, and once my hinges for the dome turn up I can start installing it all and testing.