Archive for the ‘Programming’ Category

Changing X11 Appearance

Posted by Erin, the RobotGrrl on Friday, May 11th, 2012

Ever wanted to make X11 look a lot cooler? There is a way, using some custom themes! With this you can make things like gEDA look even more cool when using a black theme. Now let it be known that this method is sort of not stable and I’ve had mixed results with it. Sometimes it works sometimes it doesn’t- haven’t really figured out why yet.

Open up terminal and do this (you’ll need Macports installed). The search should return results to proceed further. The two things we will be installing are a theme, and the theme picker.

  1. port search gtk2
  2. sudo port install gtk2-aurora
  3. sudo port install gtk-chtheme

The themes are stored at this place, so do this command…

cd /opt/local/share/themes

And you can move in your various themes to here…

  1. sudo mv (path to downloaded theme folder) yourthemename

And now for the best part! To actually choose the theme! Let’s open up chtheme! Use this command:

  1. gtk-chtheme

Now hopefully you will have some themes that you can switch to there. If not, I’m not sure what has happened. This has been happening to me quite often, but there are some occasions where I get it to work and it’s pretty cool.

If you ever want to reset everything…

  1. rm -r ~/.gtk*

If you are looking for some cool themes, there are a handful of most excellent ones on deviantART that you can search around for. Hopefully it works out good for you, have fun with your new X11 look!

Posted in: Other, Programming, Projects.

Cloud Robotics Hackathon!

Posted by Erin, the RobotGrrl on Tuesday, March 6th, 2012

I was at the Cloud Robotics Hackathon this weekend in Montreal and it was a BLAST! There were tons of teams participating, learning about robotics, programming with Arduino, and there was a MakerBot, some Naos, and a Darwin-OP there! Holy macaroni!

My favourite part at the end was listening to the experiences that people had programming their robot. There were lots of new people to robotics, so it was great.

I worked with Marek over the weekend! He is a super web dev guru, and was also on the Edubotics team at Startup Weekend Montreal. We came up with a pretty crazy project, under the team name of TEAM LIGHTNINGBOTS, because lightning comes from the cloud!

We ended up winning the Montreal part of the Cloud Robotics hackathon! Here is our project’s video!

As a quick summary, we made a network of cheerleading robots for an educational math game that can post the scores on MyRobots, then display them on a robotic scoreboard. Let’s take a look at this in more detail!

Cloud Robotics Hackathon - TEAM LIGHTNINGBOTS!

Here is the basic setup. There is the math game on the iPad. This app is actually a web app with a very thin native client layer to send data to the robot. It works by sending HTTP callbacks, which the app parses, then sends a packet through the Redpark Serial Cable, which Learning Pet (blue RoboBrrd) receives, parses, then does an action. You can input two digit numbers into the app because there is a specially-tuned delay to do so. You get an unlimited number of tries for answering, and no hints, since this is a basic version of it (proof of concept). The green dots below are showing the number of questions completed and needed to level up. The game repeats once you level up. The game is functional in any modern web browser, so you can check it out HERE! Marek was the one who coded this, and it was developed beforehand at Startup Weekend, so nothing new here.

Cloud Robotics Hackathon - TEAM LIGHTNINGBOTS!

Now for the new part: when Learning Pet (blue RoboBrrd) receives the data from the app, it also broadcasts the message out through its Xbee to the other two robots. We use the XBee Network Protocol for this, developed by Kris Kortright, but we use my uno-compatible fork of it.

Both Impy (orange RoboBrrd) and MANOI receive this data through their XBees, and are able to act out the actions as well. When you get the answer right, they do a little action of encouragement (MANOI swings its arms, RoboBrrds flap their wings, and Impy changes its eyes green too). When you get the answer wrong, they shake their heads- MANOI looks really scary doing this so you don’t want to get the answer wrong. When you level up, they all do a crazy dance celebration.

You can grab their code on Github here!

Now for the next new part: when Impy (orange RoboBrrd) receives the data from the mesh, it communicates with the computer which is running a Processing application. In the application, it creates a tally of the questions answered, and the number correct, the enthusiasm value (which is just how drastic changes in RoboBrrd’s sensors were), and the “brain power”.

The brain power is determined by the function:
(correct/tries)+enthusiasm+(100*levelnumber)

Cloud Robotics Hackathon - TEAM LIGHTNINGBOTS!

This data is then uploaded to MyRobots every 15 seconds and then cleared out for the next upload batch.

One of the tricky parts was figuring out how to optimize the sending and receiving of packets on Impy (orange RoboBrrds) end. It turned out that we had to listen before we send, or something like that, just to make it work a bit more reliably.

You can grab the code for the Processing sketch on Github here.

Cloud Robotics Hackathon - TEAM LIGHTNINGBOTS!

Here’s the next new part: To have the results of the game displayed on a live scoreboard, we used the DFRobot RobotShop rover as a scoreboard. I attached it to the bottom of a soapdish, which gave the treads enough clearance, and some popsicle sticks for support. Marek added the numbers and faceplate to it, and coded it up in Python. The code pulled the live “correct” number score from MyRobots and then called the Arduino to update the motors accordingly. It was pretty sweet!

Cloud Robotics Hackathon - TEAM LIGHTNINGBOTS!

Cloud Robotics Hackathon - TEAM LIGHTNINGBOTS!

All in all, the whole system worked great. It’s truly the ultimate social robot network, because we were able to combine so many robots together!

There was a lot of stuff that we developed that we didn’t use or mention though. For instance, Marek created this web nodejs application that can show the same webpage to all clients, and also send tcp messages to everyone connected. CHECK IT OUT HERE! We were going to use this originally as a sort of orchestra or central command console for the robots. He also made a Twitter analyzing program that looks for happy faces or sad faces in the streaming Twitter firehose. The data is being plotted on his MyRobots page for it, which is really cool.

On the first day I worked on getting Learning Pet (blue RoboBrrd) going with the ADK. For some reason it would work fine, I would get up for a break, and then not work. So that night was the turning point in the hackathon when we went with the idea we have now.

The idea we implemented is pretty cool though, since it both sends data to MyRobots and it uses it. We also are using basically 3 clouds in the 1 project, being:
1. The math game web app
2. The local mesh network
3. MyRobots

All in all, it was a blast! Huge thanks to Marek for his web skills!

I’m definitely looking forward to volunteering at this hackathon next year. Thanks to the organizers for making such an awesome event. SEE YOU IN THE CLOUD!

Posted in: Fun, Programming, Projects, RoboBrrd (thx Adafruit!), Robot, WyoLum Progress.

Reading Data from MyRobots / ThingSpeak

Posted by Erin, the RobotGrrl on Friday, March 2nd, 2012

Last post I showed some code and a guide on how to connect your robot to MyRobots/ThingSpeak! Now let’s look at how we can read the data from MyRobots. This part will be pretty cool, because you can read other robots data, and have your robot react to it!

I haven’t written up a MAKE Project guide for this yet, but wanted to show it anyway. Here you can get the SimpleThingSpeak_Parse code on Github!

We will be using the JSON Processing library to get and parse the data.

There are three main parts to this code:
1. Reading the entire feed
2. Specific feed field
3. Last entry in the robot feed

Here’s what the basic field structure looks like. The channel data is the info about your robot, and the feeds is an array, with each element being the specific datapoint.

channel
- created_at (str)
- description (str)
- field1…8 (str)
- id (int)
- last_entry_id (int)
- name (str)
- updated_at (str)

feeds
- (your entry int here)
– created_at (str)
– entry_id (int)
– field1…8 (str)

So for the accessing entire feed, you can use these functions:

  1. Object getChannelValue(String valueName)
  2. Object getFeedValue(String valueName, int feedEntry)
  3. int getFeedLength()

Here’s a very basic example of how to use these functions:

  1. // example, get random stuffs, print it out
  2.   String robotName = (String)getChannelValue("name");
  3.   String creationDate = (String)getChannelValue("created_at");
  4.   int lastEntry = ((Integer)getChannelValue("last_entry_id")).intValue();
  5.   int feedsNum = getFeedLength();
  6.   String lastField1 = (String)getFeedValue("field1", (feedsNum-1));
  7.  
  8.   println("\nHey! Did you know that " + robotName + ", aka coolest robot in the world was created on MyRobots on " + creationDate + "?");
  9.   println("It’s last field1 value that it sent (entry #" + lastEntry + " by the way) was: " + lastField1 + ". Cool!\n");

For the field feed, you can use this function:

  1. Object getSpecificFeedValue(String fieldName, String valueName, int feedEntry)

For the last entry, you can use this function:

  1. Object getLastEntryValue(String valueName)

And that is it! You can use the data from the functions and connect it up to your robot. :) Try it out, get the code from Github!

Posted in: Fun, Programming, Projects.

apps4arduino – Meters for Arduino on iOS, Introducing Wijourno!

Posted by Erin, the RobotGrrl on Tuesday, November 8th, 2011

Meters for Arduino is now available for iOS! You can get it on the App Store here:
http://itunes.com/apps/metersforarduino :)

It communicates with Meters for Arduino on Mac, which just had a 1.1 update. You can get it on the Mac App Store here:
http://itunes.com/mac/metersforarduino :)


View the demo video on YouTube

Meters for Arduino on iOS works with the magic of Wijourno. Wijourno lets you communicate with your iOS devices and your Mac.

It’s a lot of fun, since you can send messages to specific devices, or broadcast a message to all devices. I’m imagining things where (for robots) you could have the iPad displaying lots of diagnostics and such, the iPhone would be the controller, and the Mac would be the data logger and connection to the internet!

Check out the apps4arduino site for more information, including some details on how you can use Wijourno in your own Apps. :) Can’t wait to see what people are going to make with this!

Posted in: apps4arduino, Programming, Projects.

Learning Pet – VOTE! (Open Hardware Summit Scholarship)

Posted by Erin, the RobotGrrl on Wednesday, September 14th, 2011

VOTE FOR LEARNING PET IN THE OPEN HARDWARE SUMMIT SCHOLARSHIP!

Introducing Learning Pet, a mini RoboBrrd with a very large theme- education! Learning Pet enriches lessons by creating a physical interface to interact with the virtual world.



We demonstrate a number sorting game, where the student interacts with the robot to blast virtual UFO’s with the lowest value. Correct answers are celebrated with a wing flap, and each level-up with a dance. We use the Accessory Development Kit to interface with mobile devices while away from the computer.



On LearningPet’s webpage, it has all the detailed information about the hardware, software and design. There is also a handy checklist at the top, so that at a glance you can quickly see the important facts.

It would be awesome if you could vote for Learning Pet in the Open Hardware Summit Scholarship! VOTE here!

Here is a YouTube playlist of all the videos!

Posted in: Android, Android ADK, Programming, Projects, RoboBrrd (thx Adafruit!), Robot.

RoboBrrd Cosmic Soap

Posted by Erin, the RobotGrrl on Sunday, August 28th, 2011

Creating art with robots usually ends up with a result that is unexpected from the beginning! I created this fluid dynamics + physics sketch in Processing that was fun, and sort of looked like the soap from space. I connected it with RoboBrrd, and it was super unreal the result that it created.


IMG_2870

Watch the video on YouTube :D



All sorts of people have different ideas about what it is, it seems to change from person to person, which is really interesting :) With RoboBrrd, since the light is being shone into its “eyes” (because the LDRs are located close to the eyes), lots of people have said it like a RoboBrrd hallucination. I’m not so sure about this, but playing with it is lots of fun, and shooting some long-exposure photos creates interesting results :)


IMG_2924

My inspiration for creating this was lack of inspiration. I couldn’t focus on more important things to do, but at the same time I didn’t feel like doing nothing.

You can look at the code on GitHub. It’s commented and annotated, so it should be a good starting point if you want to create something like this.

Oh yeah, and to maybe answer a question you might be wondering- I’m not “on” anything. The only thing I’m “on” is my computer 18 hours a day, coding and creating.

If you use this sketch or make something similar, leave a comment with your project! It would be cool to see how this translates into other robot art :D

Posted in: Art, Programming, Projects, RoboBrrd (thx Adafruit!).

RoboBrrd Food – Using the Redpark Serial Cable

Posted by Erin, the RobotGrrl on Thursday, July 21st, 2011

Remember a while ago, when I was able to send data through the MFi SkyWire cable? It turns out, now there is a cable designed for hobbyists, with an SDK, by Redpark! They were very kind enough to send me a cable, so I figured that the first thing to try would be to feed RoboBrrd!

Here is a video where I explain everything in detail!

View video on YouTube

Here is a link to the code on Github!

What is next? For WWDC 2011 legacy sake, I will probably try to drive DOGCOW robot with the iPhone’s accelerometer. This time though, the cable would be attached to an XBee so that it will be wireless. :D

Posted in: iPhone, Programming, Projects, Robot.