Archive for October, 2010

FNR: MANOI + Zombie = ZOMBOI

Posted by Erin, the RobotGrrl on Friday, October 29th, 2010

Here’s MANOI, celebrating a robotic Hallowe’en!

IMG_0139

Its scarf has little pumpkins on it!

IMG_0141

Here is a ZOMBIE motion that tries to steal brains from you, telepathically:

I finally figured out what has been happening with the LEDs and not having enough power to power the SSC-32! It turns out that the IR sensor must draw a bunch of current, which takes away from the available current to power the LEDs and the SSC-32 at the same time. The solution is pretty straight forward for now: turn off the LEDs when using the IR, or turn off the IR when using the LEDs. :)

Happy Halloween!

Posted in: Projects, Robot.

Hockey MANOI

Posted by Erin, the RobotGrrl on Wednesday, October 27th, 2010

Hockey MANOI from RobotGrrl on Vimeo.

Posted in: MANOI, Projects, Robot.

OTTAWA MINI MAKER FAIRE!

Posted by Erin, the RobotGrrl on Wednesday, October 27th, 2010

There’s going to be a Maker Faire in Ottawa November 6th & 7th! If you’re around during that time, come see our beautiful capital and our crazy cool hacks! For more info, check out Artengine.

Posted in: News, Other News.

S7GraphView Zoom & Pan Code

Posted by Erin, the RobotGrrl on Wednesday, October 20th, 2010

Here is the code for the S7GraphView Zoom & Pan modification that I mentioned a while ago for the s7graphview iOS framework.

DemoS7GraphView-ZoomPan.zip

If anyone out there improves it more, please leave a comment! :D

Posted in: iPhone, Projects.

Robot Party!

Posted by Erin, the RobotGrrl on Wednesday, October 13th, 2010

Robot Party

Robot Party is a 30 minute weekly internet stream that I am starting! It will cover some of the latest news in the robot world, mainly stories about really big robots and some nifty hobby robotics. After that, will be a live demonstration of whatever I have been working on lately. The last segment is the 5 minute hack, which will be something really easy and quick that you can prepare for your robots. Questions will be taken after that point from the FMCG chat room as well as the UStream channel room.

If you have any ideas for 5 minute hacks, or some projects that should be featured on the show, feel free to leave a comment below or just contact me! We may even invite guests onto the show at some point. :) We’ll see how well the show grows and determine if it is still worth continuing in 6 weeks.

You can watch tune in every Thursday at 7:00PM EST on the UStream Robot Party channel. Hope to see you there!

Posted in: Other, Projects.

FNR – Robot Mesh Network: MANOI & IRC

Posted by Erin, the RobotGrrl on Friday, October 1st, 2010

Using Twitter as a means of communication between the outside world and my robots isn’t a very reliable solution. Sometimes the website is down, and they don’t return search results in a timely manner. There were a few other options that I through around, like using gchat or IRC. IRC seems pretty fun, plus I have already done some playing around with it through the factbot idea.

To be honest, MANOI hasn’t been powered up since May. There were a few tune ups that were needed. This included a few hours of debugging in order to determine that the TX and RX wires got swapped that were going to the SSC-32. The SSC-32 was also having some power problems, so I added in a new switch:

IMG_9970

The XBee is going to fit in behind the SSC-32, above the gyro and accelerometer sensor. You can see a part of it here:

IMG_9971

Once this was all set, I started to communicate to MANOI through IRC.

Here’s a video of an explanation and demonstration:

Mesh Robots – MANOI & IRC from RobotGrrl on Vimeo.

The IRC bot runs from a Python script. The initial code that I used was from Cmd-c && Cmd-v (cool blog name!). They use the pyserial and irclib libraries. There are specific commands that will trigger certain events. The commands are actually the function definitions, it is all done through the magic of this line of code:

  1. getModuleCallables()[cmd[0]](self.arduino)

The first command that I started out with was to read the force sensitive resistor on MANOI’s hand (kudos to Krafter for donating the FSR)! This is what the function looks like in Python:

  1. def readFSR(arduino):
  2.         print "MANOI Read FSR"
  3.         arduino.send(‘*’)
  4.         arduino.send(‘FSR’)
  5.         arduino.send(‘*’)
  6.         return arduino.read(4)

This is how it gets parsed into MANOI’s Arduino brain:

  1. if(newByte == ‘*’) {
  2.                
  3.                 byte byteIn = 0;
  4.                
  5.                 // Getting the command details
  6.                 while (byteIn != ‘*’) {
  7.                         byteIn = nextByte();
  8.                         msg[it] = byteIn;
  9.                         it++;
  10.                 }
  11.                
  12.                 // Checking to see if we received the message
  13.                 // and seeing how long it is
  14.                 if(it>0) {
  15.                         receivedMessage = true;
  16.                         messageLength = it-1;
  17.                         //analogWrite(greenR2, 255);
  18.                 }
  19.                                
  20.                 if(receivedMessage == true && messageLength == 3) {
  21.                        
  22.                         validCmd = true;
  23.                         ii = 0;
  24.                        
  25.                         // Check each letter to see if it’s right
  26.                         while(validCmd && ii<messageLength) {
  27.                                 if(msg[ii] != fsrCmd[ii]) {
  28.                                         validCmd = false;
  29.                                 }
  30.                                 ii++;
  31.                         }
  32.                        
  33.                         // If it is right, do the command
  34.                         if(validCmd) {
  35.                                 readFSR(false, true);
  36.                         }
  37.                        
  38.                 }
  39. }

BTW, this is how we are reading in the Serial data. It’s a pretty fail-safe way of doing it, especially as it is wrapped in the infinite loop. It makes sure that you don’t miss any data!

  1. byte nextByte() {
  2.        
  3.     while(1) {
  4.                 if(Serial.available() > 0) {
  5.                         byte b =  Serial.read();
  6.                         return b;
  7.                 }              
  8.     }
  9.  
  10. }

It’s pretty cool to see it working! For triggering dance moves, it is a basic command called danceCmd. The user then feeds in some argument that lets the Arduino know which one you want. For these examples, I used the argument BAJNGL. It stands for “Both Arm Jingle”, but saying it phonetically is pretty funny too *bajingle*!

Python:

  1. def danceCmd(arduino, args):
  2.         print "Dance Command"
  3.         arduino.send(‘%’)
  4.         arduino.send(args[0]) #bajngl
  5.         arduino.send(‘%’)
  6.         #r = arduino.read((7*19) + 3)
  7.         #print r
  8.         arduino.flush()
  9.         arduino.flushInput()
  10.         return arduino.read(4)

Arduino:

  1. // Pre programmed moves command
  2.         } else if(newByte == ‘%’) {
  3.                
  4.                 byte byteIn = 0;
  5.                
  6.                 // Getting the command details
  7.                 while (byteIn != ‘%’) {
  8.                         byteIn = nextByte();
  9.                         msg[it] = byteIn;
  10.                         it++;
  11.                 }
  12.                
  13.                 // Checking to see if we received the message
  14.                 // and seeing how long it is
  15.                 if(it>0) {
  16.                         receivedMessage = true;
  17.                         messageLength = it-1;
  18.                 }
  19.                
  20.                 if(receivedMessage == true && messageLength == 6) {
  21.                        
  22.                         validCmd = true;
  23.                         ii = 0;
  24.                        
  25.                         // Check each letter to see if it’s right
  26.                         while(validCmd && ii<messageLength) {
  27.                                 if(msg[ii] != bothArmJngl[ii]) {
  28.                                         validCmd = false;
  29.                                 }
  30.                                 ii++;
  31.                         }
  32.                        
  33.                         // If it is right, do the command
  34.                         if(validCmd) {
  35.                                 Serial << "okay";
  36.                                 bothArmJingle(1);
  37.                                 Serial.flush();
  38.                                 Serial2.flush();
  39.                         }
  40.                                                
  41.                 }
  42.                
  43.         }

But here is where the problem starts! Even though the commands that are sent to move the servos on the SSC-32 are attached to Serial2, they still go into the Serial output buffer. This means that when the Python script wants to read four bytes to see if the Arduino responded to the command, it gets the first four bytes of the motion command that are being sent to the SSC-32. It’s confusing because… why would Serial2 be going into just Serial? It’s really weird.

When I try to clear the buffer through Python, it messes up the way the function is handled. In Arduino, you can’t flush the output buffer, only the input buffer. However, I think that you used to be able to flush the output buffer, as I found an excerpt of a book that said that flush had two boolean values fed into it, for input and output. I think it will turn out to be a simple timing process thing for flushing the buffers from Python.

Once I figure that out, I can add on the XBee to MANOI and test it through wireless communication! I also have a ChronoDot that I can add on to MANOI as well, so that it knows what time it is. I kind of destroyed the circuitry for the RoboGlyphs when I tried to use a TLC594 with RGB LEDs. The TLC594 controls the PWM of the LEDs by connecting them to ground. It’s basically reverse of what you normally do. Common cathode RGB LEDs can’t work with this, only common anode. :P Once I save up enough moneys to buy an Arduino UNO Mega, then MANOI will receive that, and the RoboGlyphs will receive MANOI’s older Arduino MEGA. The RoboGlyph’s Sanguino can be used for BubbleBoy. That leaves two normal Arduino boards and one Boarduino left to be used for TECHNOROBOT and for the Transmitter and Receiver. The Yoda Rampage Robot already has an on-board Arduino on it. :)

Here’s the link to the Arduino code:

Click to download MANOI_awareness v01 pde

Here’s the link to the Python code:

Click to download Arduino IRC v01 py

Thanks to comm.cslabs’s IRC channel for being to withstand the numerous tests on MANOI and IRC bot. Glad I haven’t crashed it yet!

Here’s a photo of some pretty leaves at sunset being hidden by some technology (a telephone and power pole).

IMG_9975


Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. GO OPEN SOURCE! :)

Posted in: MANOI, Programming, Projects, Robot.