Kudzu World

"البرمجة: فنّ و تمرّد"

Kudzu World  »  Blogspace  »  Kudzu's Tech Blog
English - Română - Русский - عربي

RSS Feed

If you want to more easily stay informed of updates etc you can subscribe to the RSS feed. Just point your RSS reader at this page, auto discovery is enabled.

Wiimotely Controlled Wee Little Rockets

8/24/2007

Give men toys and they will be boys. But give them C# plus toys, and this is what happens. What toys? The Wiimote, and a USB Rocket Launcher.

The Toys

Nintendo Wiimote, Dream Cheeky USB Rocket Launcher

Circus Cannon

If you have the Circus Cannon instead, don't worry. It works with it too!

The Result


Larger Image

Be careful with the Wiimote. Since its remote, you can easily shoot yourself with the rockets. Sure they are foam, but in the eye foam still hurts!

I will try to put some videos online later for those who are interested.

The Code

I have put the complete source on CodePlex. The library is separated out into an assembly called Indy.Rocket. I should have called it Indy.Rockets, then there would be Indy.Sockets, and Indy.Rockets. The code includes all kinds of neat logic around making the motion efficient, detecting limits of movement, etc. I am also working on tracking positioning, and allowing for absolute positioning to be set.

It uses two external libraries. WiimoteLib, and USB HID.

<< Previous Entry    Next Entry >>

Comments:

Joshua Allen on 6/11/2009 wrote: SPRAWL!!!
Mark Schmidt on 6/11/2009 wrote: Do you need the sensor bar for the Wiimote? Do you use the D-Pad or does it actually do motion sensing? If the latter...Man, that's cool.
Chad Z Hower on 6/11/2009 wrote: You dont need the sensor bar. The sensor bar is only needed for pointing detection. All other inputs including movement and direction function without the sensor bar. Also you can make a sensor bar for about $15, or with two candles if you want to go cheap. :) Its not even a sensor bar, its two high outpuut LED's. In front of the wiimote is a VGA camera which tracks them.
hsiaochung on 6/11/2009 wrote: your RocketLauncher.dll have " connect " Method but do not have disconnect why how could i release the hid
Chad Z. Hower on 6/11/2009 wrote: Its been a while since I looked in the code directly, but IIRC you Dispose it.
amok on 6/11/2009 wrote: I have downloaded the sources but they don't run properly (no connect) - any update?
Chad Z. Hower on 6/11/2009 wrote: I think this will help you: http://www.kudzuworld.com/blogs/Tech/20070817A.aspx
x3haloed on 6/11/2009 wrote: I am writing up my own app based on your dll. When I use TurnLeft TurnRight or FireOnce, the rocket launcher just repeats those actions indefinitely. Adding StopAll does nothing. Also, I notice that the turning methods will accept a speed argument, but I'm not sure how to create a Indy.Rocket.Core.Rocket.Speed to pass it. Do you have any advice? Thanks!
x3haloed on 6/11/2009 wrote: Whoops, I misspelled those. MoveRight, MoveLeft.
Chad Z. Hower on 6/11/2009 wrote: Try running the demo and see if it works for you.
x3haloed on 6/11/2009 wrote: The demo crashes when I try to launch it. NullReferenceException
joshua70448 on 6/11/2009 wrote: I'm also getting a NullReferenceException on startup. Here's the details: Object reference not set to an instance of an object. at Indy.Rocket.Core.Rocket.Connect() at Demo.MainForm..ctor() at Demo.Program.Main()
joshua70448 on 6/11/2009 wrote: Okay, I've gotten a simple app working with the DLL. I had the null exceptions again, but I hunted down the vendor and product IDs and got it working. However, there's a few problems: * Move, StopAll, StopFiring, and StopMovements don't work at all * FireOnce keeps firing * MoveLeft, MoveRight, MoveUp, and MoveDown don't work if you pass Rocket.Speed.Slow * MoveUp and MoveDown are reversed I've got the normal USB missile launcher that you've got linked above. Oh, and to x3haloed, Indy.Rocket.Core.Rocket.Speed is an enumeration, you just need to pass Indy.Rocket.Core.Rocket.Speed.Normal or Slow as a value.
Chad Z. Hower on 6/11/2009 wrote: Which rocket launcher are you using?
joshua70448 on 6/11/2009 wrote: I've got the standard Dream Cheeky USB Missile Launcher (#782) as seen here: http://www.dreamcheeky.com/index.php?pagename=product&pid=1
Chad Z. Hower on 6/11/2009 wrote: Check the vendor and device ID's, maybe they changed them in newer models. Its definitely the same model I have, but maybe they revved it. It works here "as is" and I've tried it on several machines. Not sure if I ever tried on Vista, although I think I have.
x3haloed on 6/11/2009 wrote: Yeah, I'm having all of the exact same problems as joshua70448. I had to look up my vendor and device ID's too. I am developing on Vista.
joshua70448 on 6/11/2009 wrote: The vendor ID I'm using is 2689, and the device ID is 1793 (both in decimal). I'm using Windows XP Pro, so the problems seem to be happening across operating systems. They might have made some changes to the protocol between rocket launcher revisions, I suppose.
Chad Z. Hower on 6/11/2009 wrote: X3, try the other vendor id and device id listed here. As I suggested earlier, it is possible they changed controllers and thus vendor and device ids.

Post a comment

Use my contact form to contact me directly.