Snap icon indicating copy to clipboard operation
Snap copied to clipboard

Controlling Thymio robot with Snap!

Open nathalierun opened this issue 7 years ago • 17 comments

Hi,

Thymio (https://www.thymio.org) is a robot often used in european schools. telechargement

We have twenty in our school and I would like to make students pilot those robots with Snap! There is already a way to program Thymio with Scratch. (here : https://www.thymio.org/en:scratchprogramming)

Have you heard about someone working on this ? Thank you.

nathalierun avatar Apr 05 '17 16:04 nathalierun

There is something about this here : https://dm1r.inria.fr/t/piloter-thymio-avec-snap/483 but I don't understand anything. Specially this ... Il y a dans snap un pdf qui renvoie via http://localhost:30006 vers ext_basic.json et ext_scratch.json, pour ensuite utiliser asebahttp api puis asebascratch api.De là, via aseba-ser:tcp: on envoie vers thymio_motion.aesl et aseba firmware.

nathalierun avatar Apr 05 '17 16:04 nathalierun

Yep, it seems they're just using HTTP to control the robot. It should be entirely possible (and easy, as in a couple hours) to port to Snap!, but I don't have any of those around.

Maybe you should give it a try yourself. Here's their documentation: https://github.com/davidjsherman/inirobot-scratch-thymioII/blob/master/README.md

And the whole HTTP protocol is here: https://github.com/davidjsherman/aseba/tree/master/switches/http

You just need to create blocks that use the ( http:// [ ] ) block, like so:

image

Which gives you this block:

image

You'll first need to install their middleware and fire it up to test these blocks.

bromagosa avatar Apr 05 '17 17:04 bromagosa

Thank you @bromagosa for your answer.

It is not a small matter ! I need enough time to work on it.

I give the information to someone who works on it. https://dm1r.inria.fr/t/piloter-thymio-avec-snap/483

nathalierun avatar Apr 06 '17 07:04 nathalierun

Hi @nathalierun , I think I've seen engineers at INRIA controlling a large-scale simulation of the Rotterdam harbor that used several Poppy Ergo Jr. robots as well as several Thymios all with a single Snap project last summer in Bordeaux. Let's ping @pierre-rouanet about this, he was one! Maybe (some of) the work can be reused. It would be wonderful to control Thymios with Snap, they're fantastic and very popular robots!

jmoenig avatar Apr 06 '17 07:04 jmoenig

@jmoenig : ok, I'll contact @pierre-rouanet . Thanks.

nathalierun avatar Apr 06 '17 07:04 nathalierun

Hello all, Well, i can try bromagosa's method .... lot of work and time to spend for all blocks .... tell you later how it goes on... Thanks for the new idea.

Albidochon avatar Apr 07 '17 08:04 Albidochon

Hey! It's not so much work, just take a look at the Scratch extension and replicate it.

Here's the list of blocks: https://github.com/davidjsherman/inirobot-scratch-thymioII/blob/master/doc/scratch-blocks.md

And here are all the HTTP calls: https://github.com/davidjsherman/inirobot-scratch-thymioII/blob/master/ext-basic-thymioII.json

Seriously, it's just a matter of copy-pasting :)

bromagosa avatar Apr 07 '17 08:04 bromagosa

Hi all,

Indeed as @jmoenig said we already did the blocks a while ago... and I can't remember where they are. I keep digging and let you know as soon as I find them back!

pierre-rouanet avatar Apr 07 '17 08:04 pierre-rouanet

hello all ... I've in my directory the files you're talking about. Blocks and json file. Something miss me. The path in the json file : "nodes/thymio-II/scratch_move" for example. I don't have nodes and thymio-II directories.... Do i have to rebuilt the tree to reach this target ? There is something that i can't understand in this json file. Thanks for the reply

Albidochon avatar Apr 07 '17 08:04 Albidochon

Hi all, Here are the blocks @pierre-rouanet and I used for a demo with multiple Thymios. If you have multiple Thymios conneted with the same asebahttp, they will have each a different node id (but there is always a default node called 'thymio-II'), that's why certain blocks have a node input.

You need to start asebahttp which will start a local web server to answer Snap requests to the robot. I had a Linux binary but I don't find it anymore...

show0k avatar Apr 07 '17 08:04 show0k

Bonjour, You will find on this page the Thymio's blocks for snap : http://dm1r.fr/thymio-scratch-sim/ The file is called thymio-scratch-snap-base.zip, just have a look over the page to find it. in the zip,you'll find the file thymio_snap_15052017.xml you have to import int the snap GUI, this file will build all the blocks for Thymio. The snap's file are xml formatted. So so, hope you will find usefull this new link.

Albidochon avatar May 30 '17 11:05 Albidochon

Yay!! thank you, @Albidochon !

jmoenig avatar May 30 '17 12:05 jmoenig

Nice.

But, we only have Linux stations in my establishment. And, unfortunately, the patchs given are only for Mac and Windows. Our students have all a computer under Linux, offered by our district in their first entry in high school. Do you have any idea of what we have to do under Linux ? I don't understand why we have to install first a patch for Scratch.

nathalierun avatar May 31 '17 13:05 nathalierun

Hi @nathalierun,

if I got it right, it's not a patch for Scratch, it's the middleware they're using to communicate with the robot.

It seems there's a package for Ubuntu too, but I'm not sure it's the same thing: https://github.com/davidjsherman/inirobot-scratch-thymioII/releases

Sorry, I don't have a Thymio myself so I can't test it :(

bromagosa avatar Jun 12 '17 10:06 bromagosa

hi all, @nathalierun , #bromagosa is right, you've got a Ubuntu release on this page...

Albidochon avatar Jun 12 '17 18:06 Albidochon

You can use ThymioSNAP : https://snap.berkeley.edu/snap/snap.html#present:Username=gist&ProjectName=ThymioSNAP&editMode&noRun Have FUN :-)

habib256 avatar Jan 12 '23 16:01 habib256

I loved my Thymio :)

image

cymplecy avatar Jan 12 '23 21:01 cymplecy