How I connected Wonder Workshop’s Dash to a Kano Computer, and impressed my three year olds

posted in Corepox
Published July 25, 2019 Imported
Advertisement

At last, success, I have inspired my children with a technological marvel. I’ve combined their two favourite tech toys. I’ve improved usability, and exposed the kids to what makes computers special.

8d0e2231-dash_side_rgb-1024x975.jpg

One toy is Dash the robot by Wonder Workshop. Dash is operated through a mobile app. Its a good tool to teach basic programming concepts, my kids enjoyed the lessons, but they could not get the hang of the manual touch controls.

0b2b07f5-3e07c0e4-ba05-4893-af1e-683e69f

The other popular tech toy we have is the Kano Computer Kit. Its an attractively packaged raspberry PI which has very child friendly educational apps for young kids.

What’s cool with Kano, is that not very far under the hood, is a real Linux system. You can call Terminal from the homescreen, and it’s internet connected.

So here is the story of when I thought it would be great if they could control their robot from their computer. We wrote a couple of programs together, and built a pretty rugged self-contained programmable robotics system too. And here is how we did it!

Install Morseapi dependancies

Getting dependancies installed and working was painful. Damn you numpy! This is the worst bit. Anyway, get into a shell on the Kano (classic > K > Code > Terminal) and

> sudo apt-get install bluez python-setuptools libatlas3-base libatlas3 libc-dev python-dev libbluetooth-dev

Then install a load of python packages

> pip install wheel pybluez numpy

I had problems with numpy so built from source at some point. Maybe helpful?

> pip install numpy --upgrade --no-binary :all:

I also had problems with pygatt manifesting as connection problems which a downgrade fixed

> pip install pygatt==3.1.1

Find Dash’s Bluetooth device ID

bluetoothctlr
> scan on

Find out your Dash’s bluetooth ID by scanning it using Linux tooling. You need this for setting up the API.

Prepare workspace

Obtain the Corepox fork of the Morseapi API (the fork adds concurrent driving and steering)

I did not setup ssh keys so I downloaded the zip

> wget https://github.com/Corepox/morseapi/archive/master.zip
> unzip master.zip

Run Morseapi’s setup

> python setup.py -e .

Open a code editor

> geany . &

GATHER THE CHILDREN!

Now it gets fun! Prepare the children for failure, but give them hope that the next time they press enter, it might work. Success is born of failure. You know, life.

First up, get the test program working. Put the collected device id in a variable for later use. Then try the test program

> DASH="32:E3:54:20:60"
> python examples/clock.py $DASH # raise hope here

Once you have the connection working, now to try your own SDK client. I started with something super simple, glitch.py. This is easy to type, and, it makes the robot act very weird, seizing my kids focus.

Run with, get your kids to press enter. Don’t forget to update the device ID in the source.

> python glitch.py

ACT II

The next program took several hours to develop. I wanted to give the kids greater control than the touch joysticks. My idea was to drive Dash using the arrow keys, which is something they already learned from one of Kano’s games. The life lesson: programming is genuinely useful.

It took a few attempts to get right, but the code is fairly simple in the end. You can move the robot around by holding down the relevant direction like a gamepad. You can also press the spacebar to make Dash say “Hi”.

> python drive.py

The proof that this was not a waste of time, my children immediately took to the keyboard controls. It’s renewed interest in Dash, and, for the first time, they are able to deliberately direct Dash. Most importantly, the process of setting it up has given them a little hint of the power of computers!


Read the full article at corepox.net

0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement