Shop OBEX P1 Docs P2 Docs Learn Events
S2-S2 Robot Communication Using GUI: need more ideas... — Parallax Forums

S2-S2 Robot Communication Using GUI: need more ideas...

Ken GraceyKen Gracey Posts: 7,386
edited 2015-05-06 21:07 in Robotics
Hello,

Week after next I'm running a course in Iowa for 45 teachers who will be learning the S2 robot for their elementary school programs. The courses are a full day in length. The S2 GUI provides a whole semester's worth of projects, but what gets teachers and students really excited is when the robots interact with one another. Here are a couple of examples of S2-to-S2 communication that can be done within the GUI:
  • Program two S2 robots for line following. Program them both to keep their distance from other S2s, and reverse directions if they're too close (or leave the line for another one). Combination of IR line sensors and infrared.
  • Mount a flashlight to the top of an S2 and program it for a slow-roaming mode. Program the other S2s to follow it, yet avoid collisions. Combination of LDRs and infrared.
  • Group robot dances. While they're not actually communicating, this open-loop activity still looks neat. Can you think of a way the GUI could be used to start them all at the same time, with one leader?
I know there's more we can do, using the GUI and the sensors on the S2. Can you give me some more ideas about how we can make the S2s communicate with one another - strictly from GUI programming activities.

Share your ideas.

Thanks,

Ken Gracey
«1

Comments

  • ercoerco Posts: 20,244
    edited 2014-10-09 08:34
    The dance leader can send out an IR burst to trigger the other dancers.

    Have them travel between bright light sources (lamp or window) like beacons (3 makes a triangular course) while not hitting the lamps or each other (LDR plus IR).

    Cool class, Boss!

    S1 follow the leader, IR only: https://www.youtube.com/watch?v=seQXPRXzHtQ

    Different problem, but another type of follow the leader would be for the S3 (?) To be able to follow a line it drew with a Sharpie. Drive leader bot with an IR remote control, it draws a line, others follow that line. Might have to be be a special marker.
  • Ken GraceyKen Gracey Posts: 7,386
    edited 2014-10-09 09:06
    erco, have you tried to have one S2 lay down a sharpie line and another one follow it?

    - Ken
  • PublisonPublison Posts: 12,366
    edited 2014-10-09 09:32
    Ken Gracey wrote: »
    erco, have you tried to have one S2 lay down a sharpie line and another one follow it?

    - Ken

    Super Idea!

    I wonder if you could blunt down the tip of a Sharpie to be wide enough to follow?
  • ercoerco Posts: 20,244
    edited 2014-10-09 15:54
    Actually I haven't tried line following on an S2, but I have tweaked my S1 somewhat: http://forums.parallax.com/showthread.php/144156-CONTEST-Hack-The-Halls!?p=1152269&viewfull=1#post1152269 That one is fairly finicky about 1/2" line width and also very high contrast in stock form. I suspect that S2 might also need a very wide line since the sensor geometry is the same. That's why I suggested that S3 might be a chance to improve line follower function.

    Per Pub's idea, making a custom marker using Sharpie or even paint might be the best option for the S2. That large diameter marker hole should hold something that would make a 1/2" line.
  • WhitWhit Posts: 4,191
    edited 2014-10-09 19:56
    Working on some ideas. Will post once they are tested and proven to work well.

    I love the S2 for this sort of class. It is a fantastic robot for teaching!
  • NikosGNikosG Posts: 705
    edited 2014-10-10 10:28
    Hi all,


    I love all the ideas as I have two robotic projects this year.......

    Ken Gracey wrote: »
    ........Can you give me some more ideas about how we can make the S2s communicate with one another - strictly from GUI programming activities........

    Here is one thought about this challenge......
    I use 4 S2s and I put them in a way that the IR sensor of one Robot sees the side of the other Robot.......

    attachment.php?attachmentid=111375&d=1412961909

    In the next post I'll send the GUI code for leader and Robot1,2,3.....
    1024 x 1378 - 127K
  • WhitWhit Posts: 4,191
    edited 2014-10-10 10:28
    Okay Ken - here is my first shot.

    I know that this is actual communication either, but the robots interact. Attached are two programs written in the GUI (that means they will run on the Original Scribbler and S2, of course). Old blue is programmed to count in binary numbers up to 7 (with 3 LED indicators we have 0 - 7 - 1s column, 2s column and 4s column - On is 1 and Off is 0). See graphics below.

    The S2 (because of its encoders and ability to stay on course) is programmed to run 7 circles (can be simply reset to some other number up to 7 in the loop counter). As it passes by, old blue will count as it passes, using the IR detectors.

    See the following demo video... Hope you like it!

    BinaryCounting.JPG
    BinaryCountingLED.JPG


    An improved version might have the S2 literally running circles around Old blue! Wish I had thought of that earlier! Ha!
  • NikosGNikosG Posts: 705
    edited 2014-10-10 11:11
    Whit wrote: »
    ....See the following demo video... Hope you like it!....


    Whit,

    Can I see your video please?

    Is it a private video? I can't open your link......
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2014-10-10 11:31
    'Looks very cool, Whit! Here's a link to the video that doesn't require a Google signin:

    -Phil
  • WhitWhit Posts: 4,191
    edited 2014-10-10 11:35
    Thanks Phil - Link fixed!
  • RobotWorkshopRobotWorkshop Posts: 2,307
    edited 2014-10-10 13:26
    What are you thinking about for the communications? Are you leaning toward bi-directional IR or an RF solution like Xbee?

    I think it would be good to take a look at what Androbot tried back in the 80's with their TOPO II and TOPO III robots. Those use a bi-directional IR link and the host PC could talk to and control a whole group of them. Each robot would be configured with a unique ID and the host computer could either control an individual robot by sending its number as part of the packet or it could be sent as a broadcast to all the TOPO robots. All commands that didn't need a response could be broadcast while others that would send back a response had to be called out directly.

    I'd do something like this using the xbee modules. normally the host running the gui could call the shots but there is no reason that one of the actual robots couldn't step up and do the same so they could talk to each other or send out a broadcast to the rest of the group. Besides the actual robot ID's there could also be a group id so that commands could be sent to and individual robot, a group of robots, or all the robots.

    This is one of the things I want to use the xbee for.

    Robert
  • ercoerco Posts: 20,244
    edited 2014-10-10 13:47
    Very nice, Whit! First and best S1+S2 video I've seen. :)
  • Ken GraceyKen Gracey Posts: 7,386
    edited 2014-10-10 14:25
    NikosG wrote: »
    Hi all,


    I love all the ideas as I have two robotic projects this year.......




    Here is one thought about this challenge......
    I use 4 S2s and I put them in a way that the IR sensor of one Robot sees the side of the other Robot.......



    In the next post I'll send the GUI code for leader and Robot1,2,3.....

    Nikos! Perfect! Two questions:

    (a) Can you post the code for this project?
    (b) Can you refresh me and provide a few links to your other S2 projects?

    I didn't get to read the other replies yet, as I've had guests in the office, but I shall this weekend.

    Your project looks totally feasible for our class.

    Ken Gracey
  • WhitWhit Posts: 4,191
    edited 2014-10-10 17:12
    @erco - I knew you'd like that. It is really neat that GUI code works across both Scribblers! Phil's the man!

    Got some more coming too...
  • Ken GraceyKen Gracey Posts: 7,386
    edited 2014-10-10 18:00
    Whit - that's fantastic and I'LL USE IT!

    I should've rephrased my request - I'm more interested in interaction than actual communication. The kinds of projects you and Nikos have shown are perfect, actually. What a way to learn binary counting.

    I look forward to Nikos' code. It's probably quite easy to write since the S2 GUI is so capable, but I don't have much time. Every hour and every day for the next ten days are accounted for.

    What else can we come up with?

    Ken Gracey
  • WhitWhit Posts: 4,191
    edited 2014-10-10 18:07
    Variation on the theme above. Should be easy for your teachers to figure out and students will love it because it resembles a magic trick - "Fire Stealer"

    The sneaky S2 sings Charge!, runs erco's figure 8 and "steals" LED light - "fire" - from Scribbler A and drops it off at Scribbler B. When all the light is stolen from Blue A - it says Uh-Oh!, and when all the LEDs are lit on Scribbler B, it says TaDa!

    Enjoy the video - code attached too!
  • WhitWhit Posts: 4,191
    edited 2014-10-10 19:36
    Last one... maybe!

    I call this one Ribbon Following.

    I took a black piece of ribbon (weighted with a quarter taped to the back) and attached it to my blue Scribbler. Using the S2 default line following program, the S2 gives chase. The slightly raised ribbon attached to the Scribbler seems to work well - with the usual goofs, of course! I had to adjust the speeds of the two bots to make the following work best. See photo below and...

    Enjoy this video - Thanks to videographer, scribbler-kart!

    RibbonFollowing.jpg

    1024 x 768 - 107K
  • NikosGNikosG Posts: 705
    edited 2014-10-11 02:53
    Ken Gracey wrote: »
    ......I look forward to Nikos' code. It's probably quite easy to write since the S2 GUI is so capable, but I don't have much time. Every hour and every day for the next ten days are accounted for.....
    Ken Gracey

    Ken here is the code:
    Please pay attention when you place the S2s. You must leave a gap 3.3" between them in order to work properly the IR sensors.


    attachment.php?attachmentid=111390&d=1413020190

    Incide the code of every Robot 1,2,3 and leader the point of synchronization is at the TD! music command.

    attachment.php?attachmentid=111395&d=1413020856

    After that point you can add your own choreography.

    Here is the video:

    [video=youtube_share;Q1KtsR3wcC8]

    My next long term plan is to add Greek choreography [html= SYSRTAKI DANCE [/html] or [html= ZEIMBEKIKO DANCE [/html] :)

    Nikos
  • WhitWhit Posts: 4,191
    edited 2014-10-11 05:53
    @Nikos - Very cool video and idea! I will use this in my classes for sure. You could add Jessica's Hokey Pokey code at the end (not sure if it was made in the GUI though)! EDIT - I just checked and Jessica's Hokey Pokey was written with the GUI - It is attached in case you haven't seen it. It is also here with a video - http://learn.parallax.com/s2-robot-hokey-pokey

    Or you could add the Conga at the end instead of the Hokey Pokey - a bit more grown-up! - Code attached (in case you haven't seen it).


    I wish I sounded more Greek and less Louisianian! ;-)

    It still amazes me how much can be done with the GUI Program Maker software. I love to then go to the Spin and see how it is coded there too. What a great teaching and learning tool!

    @Ken - have fun. I love teaching teachers!
  • PublisonPublison Posts: 12,366
    edited 2014-10-11 07:17
    Whit..You have been a busy man. Nice work!

    Jim
  • PublisonPublison Posts: 12,366
    edited 2014-10-11 07:18
    Nicos..Nice work also!

    Jim
  • Ken GraceyKen Gracey Posts: 7,386
    edited 2014-10-11 07:22
    Whit wrote: »
    @Nikos - Very cool video and idea! I will use this in my classes for sure. You could add Jessica's Hokey Pokey code at the end (not sure if it was made in the GUI though)! EDIT - I just checked and Jessica's Hokey Pokey was written with the GUI - It is attached in case you haven't seen it. It is also here with a video - http://learn.parallax.com/s2-robot-hokey-pokey

    Or you could add the Conga at the end instead of the Hokey Pokey - a bit more grown-up! - Code attached (in case you haven't seen it).


    I wish I sounded more Greek and less Louisianian! ;-)

    It still amazes me how much can be done with the GUI Program Maker software. I love to then go to the Spin and see how it is coded there too. What a great teaching and learning tool!

    @Ken - have fun. I love teaching teachers!

    We heard some of the Lousianian dialect in your video - it's a sound we never hear in California.

    I'm going to use the binary counter and fire stealer projects in my course from you, and Nikos' interactive movement project. I will also be sure to share his work with Excel and Spin to plot coordinate systems. Today I'll get to test both projects.

    Last night I stayed up late working with line following. When we factory program the S2, we had to make some decisions on line follower sensitivity. The LINE-THRESHOLD value in the GUI is 32, but it works better with matte electrical tape at a value of 50-60 (almost perfectly reliable, in fact). I wish the GUI could expose a slider for line follower analog constants. I'm already talking to Phil about that but he's selective in his hearing so far (and I'm selective in my requests!).

    Will report back!

    Ken Gracey
  • WhitWhit Posts: 4,191
    edited 2014-10-11 08:21
    Ken,

    Glad you are enjoying these. Class ideas always inspire me!

    This one is called Light-N-Logo Tracking (though it is really just light tracking!) It also features simple GUI Program Maker programming with the S2.

    The Target Bot S2 is equipped with an LED flashlight in a container (two bowls stuck together sticky tack) complete with the Parallax Logo - it rotates clockwise and counter-clockwise (randomized by a coin toss) around the second S2 Tracking Bot. Can the tracker follow? See photos, code and video.

    Edit: This is similar. of course, to Light following but a bit easier since the Tracking Bot rotates in place. The Target Bot just runs a circle with changes of direction.

    LightNLogo2 (1).jpg
    LightNLogo2 (2).jpg


    [video=youtube_share;lBfch4bYLyo]
  • WhitWhit Posts: 4,191
    edited 2014-10-11 08:32
    Ken Gracey wrote: »
    We heard some of the Lousianian dialect in your video - it's a sound we never hear in California.

    It was a sound heard at one time. I lived almost 15 years in the Bay area. I went to seminary in Berkeley and was ordained in Grace Cathedral in San Francisco. It has gotten worse since I moved back home though!
    Ken Gracey wrote: »
    Last night I stayed up late working with line following. When we factory program the S2, we had to make some decisions on line follower sensitivity. The LINE-THRESHOLD value in the GUI is 32, but it works better with matte electrical tape at a value of 50-60 (almost perfectly reliable, in fact). I wish the GUI could expose a slider for line follower analog constants. I'm already talking to Phil about that but he's selective in his hearing so far (and I'm selective in my requests!).

    Toggling into the Propeller Tool from the GUI and making that one setting adjustment isn't too hard and might give your students a glimpse at the deeper complexity that underlies what they see in the GUI. Attached is my example using the LEDs - just for an idea.

    Best of luck!
  • KMyersKMyers Posts: 433
    edited 2014-10-11 10:23
    Nice work guys! Whit love the accent! I live in southern WV so........Guess how I talk but throw in an Ohio and Pittsburgh accent mixed together.
  • WhitWhit Posts: 4,191
    edited 2014-10-11 13:23
    KMyers wrote: »
    Nice work guys! Whit love the accent! I live in southern WV so........Guess how I talk but throw in an Ohio and Pittsburgh accent mixed together.

    @KMyers - Most of us are mixes... Bet yours sounds great, Thanks for the encouragement!
  • ercoerco Posts: 20,244
    edited 2014-10-11 14:10
    Whit+, you are a Saint!
  • WhitWhit Posts: 4,191
    edited 2014-10-11 14:27
    @erco - I think it is time for the S2 to start playing "When the Saints, Go Marching In!" and doing a little parade! Great idea!

    [video=youtube_share;Ux_Zxn6FCic]

    Edit - If that doesn't make you smile - nothing will!

    Oh and attached is GUI code of what is coming... still working on a dance erco!
  • KMyersKMyers Posts: 433
    edited 2014-10-12 08:16
    Whit I love it! In HS I played a little Dixie land jazz in a band. That deffinately got my feet moving. Pretty good for a para...:lol:
  • NikosGNikosG Posts: 705
    edited 2014-10-12 09:31
    Whit ,
    your Project with the binary count is very cool!
    It gives me some ideas for interesting activities with S2.......!

    Whit wrote:
    ...... just checked and Jessica's Hokey Pokey was written with the GUI - It is attached in case you haven't seen it. ........Or you could add the Conga at the end instead of the Hokey Pokey ....

    Jessica's project was actually my ispiration in order to put the S2s in the arrangement that I suggested.

    I would like to Copy and paste the Hokey Pokey GUI code in the choreography section on robot1,2,3 and leader codes. But I can't Copy and paste code from one GUI program to another.
    This makes things more difficult because I must write the code manually four times! Any ideas.......?

    I have the music for a very famous Greek song: "The Evdokias Zeibekiko" in S2 commands! (I attached the code) and I'm triyng to make the choreography!

    I must find a way to Copy and paste the code between in differents programs........


    P.s. If you love Greek music upload "evdovia4.scb" on your S2 and listen....... Compare with the original in this video

    Nikos
Sign In or Register to comment.