OpenInterface for Arduino – create without a Create

Having spent a couple of weeks playing with ROS on and off and getting robot vision, speech and a couple of other robot basics working a basic thought struck me.

Why don’t I look at the basic robots provided by ROS and see if it’s easier to reverse engineer them?

This probably should have struck me earlier, but I’d got involved with getting face detection working and was really quite enjoying it.

It turns out that the ROS Turtlebot used in the basic tutorials, has a physical counter part, also call turtlebot and is (will soon be in Europe) for sale. This platform is based on the iRobot Roomba (500 series?) vacuum cleaners.

Now I also don’t have a Roomba, and I’m not going to spend (well let’s face it, the wife wouldn’t sign it off) £200 odd on a robotic vacuum cleaner to then hack it apart for an experiment.

However the Roomba and Create both use Open Interface which handily has a pdf Protocol Document available.
I did a bit of searching online, and could find a few Arduino based libraries to control Roombas, but not to emulate them.

So off I went and wrote this Open Interface Arduino Library.

Today it is a pretty complete implementation, it handles communication with a controller that thinks it’s talking to a iRobot device using callbacks to allow a developer to handle the driving, song playing and sensor interaction in their own way.

I’ve tested this with my own bot, which is based on a 1984 Tomy/Tandy Omnibot/Robbie Snr toy robot. I have it driving around controlled by the ROS Turtlebot vanilla implementation, no problems at all :-)

Now I’m not a C++ coder by any standard, so if someone would like to comment/code review/tear to shreds, please do so. I won’t be offended (much).

Posted in Development, Hacking, hardware, Robots, Software | Tagged , , , | 6 Comments

Getting Sound to work on ROS

I was following the ROS.org wiki on trying to setup sound for it’s not immediately obvious to a n00b how to do this.

Installing sound

sudo apt-get install ros-diamondback-sound-drivers

Then I could start the tutorial correctly.

Then due to some weirdness with alsa and ubuntu asoundconf

wget http://ubuntu.mirror.cambrium.nl/ubuntu//pool/main/a/alsa-utils/alsa-utils_1.0.15-3ubuntu2_i386.deb
sudo dpkg -i alsa-utils_1.0.15-3ubuntu2_i386.deb
sudo cp /usr/bin/asoundconf /usr/
sudo apt-get upgrade
sudo cp /usr/asoundconf /usr/bin/

You now have a copy asoundconf in /usr/ to use

I could then run:

asoundconf is-active
asoundconf set-default-card 0
sudo cp ~/.asoundrc.asoundconf /etc/asound.conf

This generated errors when running asoundconf but the sound-play scripts ran properly.

rosrun sound_play soundplay_node.py
rosrun sound_play say.py "hello world"

soundplay_node.py was reporting “no sound card found” but then went on to say, “ready to play”

Text to speech worked okay.

Installing extra voices

Install a British English male voice rather than the default American one.

sudo apt-get install festvox-rablpc16k

I haven’t yet looked at how to set this as the default voice.

Posted in Development, Hacking, hardware, Robots, Software | Tagged , , | Leave a comment

First experiences using ROS

I’ve been doing a stock take of what robotics components I have available. I think now I should bite the bullet and go for the build of my Omnibot based robot.

These are the steps I took to setup a VMWare image ready to run ROS.

Planned Hardware

  • Acer Aspire One Netbook (1.6GHz Atom, 1Gb RAM, 160Gb HDD)
  • Arduino (or clone, possibly Arduino MEGA for the I/O)
  • DAGU 4Channel Motor controller (handles a 4Amp stall current)
  • Gutted Tomy Omibot/Robbie Snr. (Circa 1984)

Install Ubuntu 10.10 (Maverick)

  • 512Mb Ram
  • 20Gb disk space

Configure package manager

sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu maverick main" > /etc/apt/sources.list.d/ros-latest.list'
wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
sudo apt-get update

Install ROS Desktop Full Install

sudo apt-get install ros-diamondback-desktop-full
echo "source /opt/ros/diamondback/setup.bash" >> ~/bin/.bashrc_ford
source ~/bin/.bashrc_ford

Other neat fixes

sudo su - root
echo 'SUBSYSTEMS=="usb", KERNEL=="ttyUSB[0-9]*", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", SYMLINK+="sensors/ftdi_%s{serial}"' > /etc/udev/rules.d/52-ftdi.rules

Will create symlinks to the /dev/ttyUSB[0-9] device in /dev/sensors for all FTDI chips connected. (i.e. Arduinos) This is very useful to make sure you always connect to the same Arduino after a system restart if you have multiple devices.

$ ls /dev/sensors
/dev/sensors/ftdi_A60078HS -> ../ttyUSB0
Posted in Development, Hacking, hardware, Maker, Robots, Software | Tagged , | Leave a comment

Charities, trading arms and CICs (oh my!)

This evening the Great Ashby Community Centre Management Association (the charity of which I am a trustee and treasurer) had a meeting with Sara the CIC Regulator to discuss with us whether we should set up a CIC as part of our extension to the Community Centre.

This post is a bit of a memory dump after the meeting whilst it’s still fresh. Not all of the points have been validated/or referenced, so I may follow up when I know more.

So what is a CIC?

Basically a CIC is exactly the same a normal limited company. Either limited by guarantee (CLG) or limited by shares (CLS).

A CIC however has several clauses added to the Memorandum and Articles of the company that ensure that it’s not being run solely for the personal gain of the founders or directors. Basically the clue is in the name, the company must be run in the interest of a community.

It also has several other clauses that enforce the above and prevent the company from being asset stripped should it be sold or taken over (or fold).

These are:

  • Any shares purchase in the company cannot appreciate in value.
  • A maximum of 35% of net profits can be used in dividend payments.
  • A maximum of 20% of the share value can be paid as a dividend
  • The companies assets are locked, and can only be transferred to another CIC or charity for community purposes
  • Investors wishing to loan the CIC money on a performance related interest rate is limited to 10%

If the charity is the sole share holder in the CIC, however there are no limits on dividend payments.

How do you set up CIC?

The company is registered via Companies House as any normal company but has accompanying forms that are processed and forwarded to the CIC Regulator, there is also a further charge made to register as a CIC. (£35)

CIC Regulator will then approve your CIC status within 15 days.

Annual returns are then also submitted to Companies House, with an additional form that lists what the company has been doing in respect to its community aims, what issues it’s had and a couple of other questions. Very similar to what we already do for the Charity Commission.

I raised a question about directors renumeration. Sara said that her team scrutinise the annual returns and if, for instance, your turnover was £100K and your directors renumeration was £75K, you would be requested to justify that to regulator.

Why are we interested in a CIC?

The benefit from our point of view here is that we, the trustees, want to appoint a manager/director of the company to run a coffee shop in our new extension and this manager will have full autonomy over the running of the business.

However we have paid for the extension and outfitted the coffee shop. The outfitting is costing us approximately £40K which we have obtained the funding for and ordered from the outfitters already. (This was grant money and had a deadline to be spent.)

The trustees are concerned that a director with full autonomy could pass resolutions, set their own pay/dividends however they chose, such that the charity would not benefit from the coffee shop and be left only being able to reclaim rent/utilities, etc.

A CIC would allow us to do this. Protecting any assets the CIC acquires whilst allowing a director to be appointed to run the business as they see fit. The manager/director would be able to benefit financially from their entrepreneurial skills and the charity would maintain a revenue stream from the CIC without the trustees needing to maintain a presence on the board of the coffee shop company.

The charity’s investment and revenue stream would still be protect should the new enterprise be sold/bought out by a rival. Should the business fail, all assets revert back the charity as well.

What are the alternatives

Setup a CLG/CLS Social Enterprise. Lease the equipment to the company and charge for rent on the space and a proportion of the utilities

What happens next

The trustees need to decide whether a CIC is the right type of company to set up. Start the proceedings to set up that company with Companies House and assign several members of the charity trustees as and interim board.

CIC Regulator have example Memorandum and Articles for CICs that should need a minimum of work doing on them.

Other things we need to start looking at

We need to start writing a business plan containing, amongst other things:

  • How long will it take to establish clientele base?
  • How long will it take to start covering our costs/make profit?
  • Where will money come from to bank roll up until that point?
  • How to attract clientele, unique selling point.
  • Risks: e.g. Competition opening a coffee shop in an adjacent unit?

If consider a bank loan to start the company initially (buy stock, pay wages etc.) talk banks that specialise in charities. Unity Trust etc..

Sunlight Social Enterprise, talk to them/look them up.

There is/are CICs that supply coffee, try and find them. Fair-trade?

Another local CIC ANLP based in Hemel Hempstead recently won some awards (Business Woman of the Year or something) and may be a interesting person to talk to about CICs

Posted in Charities | Tagged , | Leave a comment

Using Jenkins for PHP CI

After a while of being completely absorbed in my (paid) work for the last six months or so, I’ve decided to kick back and revisit some old projects.

Before I get started I thought I ought to refresh my CI setup.

In my day job at the BBC we use Hudson with Maven as our build/CI setup. Hudson has now been forked into Jenkins (Oracle woes!) and whilst at the PHP developers conference earlier this year Sebastien Bergman talked about Jenkins-PHP

Setting up is pretty easy, I created an AWS EC2 Micro instance (free for a year with a new account, go go go) then follow the guide on Jenkins-PHP.

I did have a couple of issues getting the graphing to display on my instance, as no X console is installed (everything runs headless) a bit of googling later and a quick

yum install dejavu-fonts-common fontconfig

all was good. (Although some people seemed to need to remove and reinstall java for it to pick up the fonts).

Things I want to look into next are
• python django tools
• cucumber testing

Posted in Development, Software | Tagged | Leave a comment