Monday, November 18, 2013

FriedCircuits now on InMojo.com

I recently heard about iNMOJO.com. Similar to Tindie, so I decided to give it a try. Currently just the USB Tester is listed.



http://www.inmojo.com/store/friedcircuits/item/usb-tester/



Let me know in the comments if you have heard or had any experiences (good or bad) with inmojo.com.

Sunday, November 17, 2013

Twitter Bootstrap and ROS

Working on the BeagleBone Black and ROS, I started playing with the Twitter Bootstrap framework. Its a combination of CSS and Javascript libraries that make is much easier to create a website from scratch. I had heard of it and seen a few projects but never dived into it. With the new robot running ROS which has a websocket interface, I ended up trying Bootstrap. Here are few resources I used to get started plus a few screenhots of what I am working on. Once it is in a usable state I will post it on Github and a guide on how to use it. In the meantime I will try to post what I can.

Get Bootstrap: http://getbootstrap.com/
     Good getting started resources

BBB: WebCam Streaming

After figuring out the Raspberry Pi camera module and getting MJPG-Streamer working I decided to try it on the BBB(BeagleBone Black). This should be easier as you are working with USB vs the RPi camera module which isn't full developed.  Thanks to Warren I already had a Logitech C210 camera I use for the Adaruit show and tells and video chating with family.  Any UVC camera should work, you can check out this list: http://en.wikipedia.org/wiki/List_of_USB_video_class_devices.

Fastest way to check is to plug it in and see if the system sees it as a camera.

# lsusb - will show all USB devices on the bus. This doesn't mean it has the driver.

# ls /dev/  - will list all the devices in the system that have drivers loaded and are ready to use. Look for video0. If it is there you should be ready to go.

Now we just need to download mjpg-streamer. I used part of this guide: http://shrkey.com/installing-mjpg-streamer-on-beaglebone-black/.

Pretty simple compared to the time I spent on the RPi since I wanted to do it without writing a file everytime.

cd ~
su
opkg install subversion libjpeg-dev imagemagick
exit
svn checkout svn://svn.code.sf.net/p/mjpg-streamer/code/ mjpg-streamer-code
cd mjpg-streamer-code/mjpg-streamer-experimental
make
I tried both the experimental and the stable release and both worked fine.

Finally to run it with the full web interface:

./mjpg_streamer -i "./input_uvc.so" -o "./output_http.so -w ./www"

Then you can connect to it via your web browser:

http://beagleboneIP:8080/

You can use VLC as a streaming client but there is a much greater delay due to buffering. This might be adjustable, haven't checked yet. VLC was showing mostly green instead of the video but VLC worked with RPi.

There are a bunch of other options you can find here: <link>

I am using -f 5 to limit FPS to 5. Should help on slower connections but affects the delay.

Using a USB webcam works much better for realtime streaming vs the RPi camera module. I am sure if you used a USB webcam on the RPi it would be better as well.

Saturday, November 16, 2013

Adruino and working with limited memory

Check out this great post about how Arduino memory works and how to work with limited memory. This includes tips of ways to trim the fat from your program.




http://learn.adafruit.com/memories-of-an-arduino

BBB: Adventures in ROS - Cross Compiling and Recipes

Previously I setup ROS on the BeagleBone Black and installed Angstrom build environment on Ubuntu x86 so I can compile for ARM. Now that the base is setup we can add the Beagle-Ros layer and try cross compiling a recipe with Bitbake. Wait, what... what is layers and baking recipes you speak of, are we cooking?

Since we can't compile directly on the BBB we have to do it on a x86 system. But we have to tell the compiler the architecture we want and how to package it up into a IPK that we can install on the BBB. The IPK needs to have all the right parts to make a ROS package. But you can test using just python scripts without make the compiled package.

The base install uses OpenEmbedded then there are layers on top of that to add functionality such as a meta ROS layer. This layer provides all the sources files to compile ROS. This should be in the

setup-scripts\sources\meta-ros

On top of that Victor from Beagle-Ros.org created a layer for the Beaglebone parts. Which include recipes for some of the common sensors and parts you can use with the BBB. He is slowly merging them with the meta-ros layer.

Once setup, bitbake will read the recipe and compile the package you create into an IPK you can install on the BBB and run with ROSRUN or ROSLAUNCH.


New Product: Dual Resonator



Overview

Sometimes you need 8Mhz and other times, 16Mhz. This Dual resonator makes sure you have both always on hand. Easy to breadboard at a moments notice. Just flick the switch for the speed you need!

Included

  • 1x PCB
  • 1x 16Mhz Resonator
  • 1x 8Mhz Resonator
  • 1x DPDT SMD Switch
  • 1x 3pin header
Requires some soldering mostly through hole. Even though the switch is SMD it is easy to solder.
Purchase: Tindie or FriedCircuits


Sunday, November 10, 2013

Science: Water temp over time

Every few weeks or so we make a trip to the water store to fill up our 3 gallon water container all while trying to avoid their delicious Santa Cruz ice cream. Upon arriving home, the container gets put into the refrigerator. At which point I started to wonder about the effect of the ambient temperature and how long it takes the water to reach equilibrium.




Saturday, November 9, 2013

BBB: Adventures in ROS - Getting Setup

Originally written about a month ago when I started this project. I will be posting more as I make progress.

Now that I finally have a Beaglebone Black, I can start to explore and have some fun. I want to get back to working on the SBot and with all the features I want to add, I was leaning towards an onboard Linux system with an Arduino or similar to do the low level timing stuff. Originally I wasn't going to go the ROS route and write everything from scratch, but the more I dive into ROS (Robot Operating System), this seems the way to go.

So first things first, get ROS running on the BBB and see what I can do with it. It's a little tricky getting to work and you have to setup cross compiling. It's not too bad but it does take awhile to setup. Here is how I did it.



I found the Beagle-ROS project to get me started, at least pointing me in the right direction. First off, start with the section Getting ROSCORE running from https://github.com/vmayoral/beagle-ros. This gets you to the point where you can actually run ROSCORE. Only change I did: I used the stock image for the BBB instead of downloading Angstrom. Now there isn't much you can do with that. The fun is adding packages and talking to hardware. My first goal is getting camera support but I may have to take it easy and do something that is ready for the BBB. I have a few Sharp IR sensors that may do the trick. Then comes the hard part: interfacing with a Arduino sketch to get motor control.

Once ROSCORE is running I needed to setup cross-compiling for Angstrom on a desktop. I have Ubuntu 12.04 LTS running on my VMWare ESXi server.

I started with this site:
http://www.angstrom-distribution.org/building-angstrom

Which worked for the most part but had issues with step 2. Then I found:
http://cwraig.id.au/?p=507
This site has a list of packages you need before you setup bitbake.

Finally, I found this site which gets you compiling a quick "hello world" c program to make sure you are in business.

http://datko.net/2013/05/06/cross-compiling-applications-for-the-beaglebone/

Step 6 mentions commenting INHERIT += "rm_work", but since I am working just on ROS packages I decided not to do that. It keeps the kernel sources, uses about 4Gb, but you may need them.

Found this site about commenting it out.
http://wind.cs.purdue.edu/doc/crosscompile.html


Here is the down and dirty:

Starting from your home directory:

sudo apt-get install sed wget cvs subversion git-core coreutils unzip texi2html texinfo docbook-utils gawk python-pysqlite2 diffstat help2man make gcc build-essential g++ desktop-file-utils chrpath dosfstools kpartx

also add 
zlib1g-dev (this is needed later for compiling boost when doing recipes.)

mkdir BBB

cd BBB

git clone git://github.com/Angstrom-distribution/setup-scripts.git


cd setup-scripts

./oebb.sh config beaglebone/
./oebb.sh bitbake virtual/kernel (takes awhile)

At this point you can try to compile the 'hello world' test. First you need to set the compiler in your path. I couldn't get this to work yet, so I had to use absolute paths. 

Adjust as needed for your setup, I had to change x86_64-linux to i686-linux.

PATH=$PATH:~/setup-scripts/build/tmp-angstrom_v2012_12-eglibc/sysroots/i686-linux/usr/bin/armv7a-vfp-neon-angstrom-linux-gnueabi

cd ~/BBB
nano hello.c

paste the following:

#include <stdio.h> int main(void) { printf("Hello Beaglebone world!\n"); return 0; }


Compile with 
arm-angstrom-linux-gnueabi-gcc -o hello hello.c

Now you shouldn't be able to run the output. 

chmod +x ./hello

./hello


Then copy to your BBB and run. It should output "Hello BeagleBone world!"

I copied it over using SCP.
scp ~/BBB/hello user@beagleboneIP:~/

This confirms you are able to cross-compile and run it on the BBB.

Now it's off to learn ROS packages and compiling using recipes! Yay!