hobbydev kinect

I know they are about to release XBox One and they have already released Kinect for Windows but I still only have a Kinect for XBox for 360. I’m hoping to create a quick and sample application to test my Kinect and discover what’s in Kinect SDK so that I can remove it for a while from my gadgets-pending-to-be-tested-and-played-with list.

Until I buy a better and more recent hardware I just decided to utilise my existing sensor. I followed Channel9’s video tutorials and here is the code to display a video output of the sensor on the screen:

Xbox-360-Kinect-Standalone

Source code:

using System.Windows;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using Microsoft.Kinect;

namespace KinectDemo
{
	public partial class MainWindow : Window
	{
		KinectSensor _sensor;

		public MainWindow()
		{
			InitializeComponent();
		}

		private void Button_Click(object sender, RoutedEventArgs e)
		{
			
		}

		private void Window_Loaded(object sender, RoutedEventArgs e)
		{
			if (KinectSensor.KinectSensors.Count > 0)
			{
				_sensor = KinectSensor.KinectSensors[0];

				if (_sensor.Status == KinectStatus.Connected)
				{
					_sensor.ColorStream.Enable();
					_sensor.DepthStream.Enable();
					_sensor.SkeletonStream.Enable();
					_sensor.AllFramesReady += _sensor_AllFramesReady;
					_sensor.Start();
				}
			}
		}

		void _sensor_AllFramesReady(object sender, AllFramesReadyEventArgs e)
		{
			using (ColorImageFrame colorFrame = e.OpenColorImageFrame())
			{
				if (colorFrame == null)
				{
					return;
				}

				byte[] pixels = new byte[colorFrame.PixelDataLength];
				colorFrame.CopyPixelDataTo(pixels);

				int stride = colorFrame.Width * 4;
				image1.Source = BitmapSource.Create(colorFrame.Width, colorFrame.Height, 96, 96, PixelFormats.Bgr32, null, pixels, stride);
			}
		}

		void StopKinect(KinectSensor sensor)
		{
			if (sensor != null)
			{
				sensor.Stop();
				sensor.AudioSource.Stop();
			}
		}

		private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
		{
			StopKinect(_sensor);
		}
	}
}

I think for this amount of code and the simplicity it is a pretty good result:

Video:

Probably I will continue my conquest of Kinect after I get the latest one, but for now I’ll just call it.

Resources

hobby electronics, msp430

I have a number of electronics kits and boards like Netduino, Arduino and Gadgeteer. Among all the cheapest one I’ve ever seen is Texas Instrument’s MSP430 LaunchPad. Last year I bough one of these just because it was so cheap but couldn’t spend much time on it. I recently found out it has dropped to £8 and I decided to buy the latest version. Now that I have 2 of these babies I definitely need to spend some time to play with them.

MSP 430

Looks like there are a few differences between the two. The one on the left in the picture above is the old version. The new version comes with better controllers and male pins on the side.

Installation

First thing to do is go to its official site and download Code Composer Studio to develop programs to run on it. It is an Eclipse-based IDE so I’m hoping it won’t take to long to get acquainted with it.

First Program

Good thing there are plenty of tutorials about it. I decided to follow one of the simplest ones which just blinks one of the on-board LEDs. To be honest, the code looks hideous:

unsigned int i = 0; 
void main(void)
{
  WDTCTL = WDTPW + WDTHOLD;     
  P1DIR |= 0x01;

  for (;;)
  {
    P1OUT ^= 0x01;
    for(i=0; i< 20000; i++);
  }
}

I deleted the comments to keep it short. But even with detailed comments it looks hard to develop complex applications with this. Anyway, I’ll see how far I can get with it. So far, for this amound of work, the results are not so bad:

Resources

hobby beaglebone_black, electronics

After Raspberry Pi opened the way for low-cost small computers, a number of them started to show up in the market. One of the most recent ones gaining ground is BeagleBoard.

Beagle Logo

I just bought the cheap version which is called BeagleBone black which looks something like this:

BeagleBone_Black_Board

Nice looking little fellow, right?

Getting Started

I followed the getting started guide which you can find on the home page. Also the link in the resources section. When I plugged it in to USB it is recognized as a removable device. Then downloaded and tried to install the drivers as suggested but no luck. Apparently the drivers are unsigned and Windows 8 didn’t allow me to install them. Googling a little bit I found a step-by-step guide to change the machine settings so that unsigned drivers can be installed. I followed the steps and it worked like a charm. The original URL is in the resources section also the steps are below.

Troubleshooting

To be able to install drivers on Windows 8 follow the steps below:

1. Press win+c on the keyboard to bring up the charms side bar (or move mouse to right top corner of the screen)
2. Click the Settings button.
3. Click the Change PC Settings at the bottom of the sidebar.
4. On screen that shows up, select the General option from the sidebar then scroll down the page that appears.
5. Click the Restart now button under the Advanced startup section.
6. You will momentarily see the restarting screen, then it will switch to a blue screen titled "Choose an option"
7. Click the Troubleshoot button.
8. Click Advanced options.
9. Click Startup Settings
10. Click Restart
11. You should then see a Startup Settings screen after your computer reboots.
12. Press 7 or F7 on your keyboard to Disable driver signature enforcement
13. Now Windows 8 will continue starting up.
14. Log-in as normal, and then run BONE_D64.exe again
15. Now you should see 4 warning dialogs about "unsigned driver installation", click OK for all of them.

Results

So far so good:

BeagleBone Black

I can connect to the web server running by default. I’ll try to explore what I can do with it further. Let’s see what it is capable of.

Resources