Jimmy Engström

NAVIGATION

2015

Download all the videos from Build 2015

2015-05-11 17:25:00 +0000

Build 2015 was epic, there was so much content so Microsoft even recorded some content before build (now available at Channel9).
I usually download everything to my laptop and watch it to and from work, this script will download all videos from Build 2015 =)

This is an updated version of my script I previously blogged about here.

cd "d:\build15"

$pattern = "[{0},\:,\']" -f ([Regex]::Escape([String][System.IO.Path]::GetInvalidPathChars()))             
[Environment]::CurrentDirectory=(Get-Location -PSProvider FileSystem).ProviderPath
$a = ([xml](new-object net.webclient).downloadstring("http://s.ch9.ms/Events/Build/2015/RSS/mp4high"))
$a.rss.channel.item | foreach{ 
    $url = New-Object System.Uri($_.enclosure.url)
    $file = [Regex]::Replace($_.Title + " " + $url.Segments[-1] , $pattern, ' ') 
    Write-host  ("{0}  -  {1}" -f "Downloadning" ,$file)
    if (!(test-path $file))
    {
            (New-Object System.Net.WebClient).DownloadFile($url, $file)
    }
}

 

Just copy the code, paste it into a file called “Build2015.ps1”, create a directory (in my case “c:\Build15”) and change the path in the first line of the script.

Right click on the file and choose run with PowerShell.

 

In case you get a problem similar like “Build2015.ps1 cannot be loaded because running scripts is disabled on this system.”

Start PowerShell as an administrator and run “set-executionpolicy unrestricted”, this is probably a bad thing to do for security.

Build2015.ps1 (677.00 bytes)

2011

Our Kinect Controlled living room

2011-11-19 17:44:00 +0000

Recently I created a project for a Swedish Kinect contest at Migbi.se this was my second entry, my first one (and third place winner) was my Robosapien project.

I have always been fascinated by home automation, I bought my first X-10 system ten years ago.

My friends thought I was insane, “-You can just get up an shut the light off".

But that’s not the point, it’s not because I’m lazy it’s all about removing obstacles, what if when I enter a room the lights turns on, when I go to bed everything turns off.

Saves energy, saves time, removes obstacles.

 

Peter Forss made a really cool entry to the contest, his project turns on and off lights depending on where he is in the room.

This inspired me, I wanted to do something with Kinect and home automation.

 

I had previously built a home automation system that can control our home (lights, infrared devices etc) so the only thing I needed to do is hook up the Kinect.
I wanted to be able to control what lights to turn on just by pointing at them.

So here is my attempt to control our living room with a Kinect.

 

 
Kinected living room

 

How it works

I added all my light in an array with the lights X and Z position relative to the kinect sensor (in meters).

For each light, I calculate the angle from where I am in the room to the light and compare it to the angle between me (my body’s centre) and my hand.

 

Then I check for the light on gesture (hand under shoulder moved to over shoulder) or light off gesture (hand over shoulder moved to below shoulder).

 

These gestures sends a command to my home automation system to executes the correct command.

It uses a Tellstick to control the lights, the beauty of that device is that it can control close to any type of protocol (I use Nexa or in some cases the cheapest possible plug-in lamp module I could find, it also works with X10).

 

In this video I only control lights and screen, but it is possible to control infrared devices like tv or home cinema.

 

Please feel free to send me an email if you have any questions.

Kinect + Robosapien = <3

2011-07-04 10:30:00 +0000

Seeing all the cool Kinect demos around I wanted to try out the SDK myself.
I love those demos that makes it possible to interact with real world things thru the Kinect so I decided to dust off one of my Robosapien (v1).

For those who don’t know Robosapien, it is a small robot made by WowWee, and it’s reasonably cheap.

To communicate with the Robosapien I need to use IR and I just happen to have a usbuirt so I borrowed it from the living room.

Next I needed to get all the commands that I can use with the Robosapien, I found a great list here.

Then it was time to dig into the Kinect SDK, I decided to only implement arm movement, walking seemed silly for this sample.

I also implemented some voice commands to test the voice recognition which worked great, a bit sensitive (sometimes the Robosapien triggered voice commands while making sounds).

I used one of the Kinect SDK samples as a base for my application to see what the camera captured.

 

This was a really fun project to work on, took me about a day to make, trying different things and learning how the joints work.

Check out my Kinect Extension methods here.

 

If you are interested in the source code please contact me and I’ll send you a copy.

 

 
Video of me controlling my Robosapien

 

Some resources

Kinect SDK Beta
http://research.microsoft.com/en-us/um/redmond/projects/kinectsdk/
http://research.microsoft.com/en-us/um/redmond/projects/kinectsdk/docs/Speech_Walkthrough.pdf

 

USB-UIRT
http://usbuirt.com/

 

Robosapien
http://www.wowwee.com/en/products/toys/robots/robotics/robosapiens/robosapien

KinectRobosapien.zip (310.63 kb)

Kinect Extensions

2011-07-03 02:12:00 +0000

The Kinect SDK doesn’t have any built-in gesture system, it is however quite easy to use joints and check how they relate to each other.

 

For example:
if  (data.Joints[JointID .HandRight].Position.Y >  data.Joints[JointID.ShoulderRight].Position.Y)

 

That would trigger if I hold my right hand over my right shoulder.
It is still a bit hard to read and I wanted to simplify both reading and writing the code to check different joints, so I created a couple of extension methods to help out.

 

Code that does the same as above would look like this using my extensions:
var
  joints=data.Joints;
if  (joints[JointID .HandRight].HigherThan(joints[JointID.ShoulderRight]))

 

So far I have implemented:

HigherThan
LowerThan

BetweenVertically
BetweenHorizontally
ToTheLeftOf
ToTheRightOf

 

Hope these extensions will help =)

 

JointExtensions.zip (436.00 bytes)