Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - steve6

Pages: 1
1
Project Ideas / Wiimote Tracking System at 6-DOF
« on: April 02, 2009, 10:04:01 AM »
I have create a 3D tracking system at 6-DOF with Wiimotes and illuminator.
I made some videos that show the characteristics of the system:
[youtube]http://www.youtube.com/watch?v=JbtXE7sarhw[/youtube]
[youtube]http://www.youtube.com/watch?v=rTWEqNeZnPg[/youtube]
[youtube]http://www.youtube.com/watch?v=QlvpDYRgtY0[/youtube]
[youtube]http://www.youtube.com/watch?v=O3EN_BrW-gc[/youtube]


At this link soon you can view more info and project : http://sanna.polito.it/wiitracking/index.htm

Thanks

2
General Discussion / Connect more than 6 wiimotes
« on: March 30, 2009, 10:31:18 AM »
Hi, i try to connect 7 wiimotes, the maximum allowed for the bluetooth. But I can't connect the wiimote number 7. I have registred it but i can't connect simultaneously 7 wiimotes.
Why?

And if I want connect more than 7 wiimotes?

Thanks

3
Project Ideas / Multi camera calibration
« on: June 23, 2008, 06:15:32 PM »
Hi I try to calibrate 4 wiimotes camera at the same time.
I use this sofware : http://cmp.felk.cvut.cz/~svoboda/SelfCal/

I have create the image using a IR source and moving around the area. I create the image placing a point in a black image using IR coordinate.

But I don't have the right result when I calibrate whit the matlab sofware.

this in my configuration


Any that wont help me??

Thanks

4
Project Ideas / Multi wiimotes connect at the same time
« on: June 23, 2008, 07:46:19 AM »
Hi I wont create an application similar at the WiiMoteTest but i want see the data of the IR at the same time and dont in a different tab.

How i can make this??whit a list of wiimote?

Thanks Steve

5
Other / problem with IR illuminator
« on: June 04, 2008, 04:24:16 AM »
Hi, I have bought this IR illuminator: http://scene.en.alibaba.com/product/50413596/52306946/IR_Illuminator/S_8030_12M_IR_Illuminator.html#productDetailpageLocation

But this work only with the dark.And at short distance.

Why?

Thanks

6
Project Ideas / manage 4 wiimote
« on: June 01, 2008, 05:26:47 PM »
Hi, I have try to change wiimotetest to manage 4 wiimote.
I have use a function that retur a list of wiimote.

Code: [Select]
public static List<Wiimote> GetConnectedWiimotes()
        {
            List<Wiimote> motes = new List<Wiimote>();

            int index = 0;
            bool found = false;
            Guid guid;

            // get the GUID of the HID class
            HIDImports.HidD_GetHidGuid(out guid);

            // get a handle to all devices that are part of the HID class
            // Fun fact:  DIGCF_PRESENT worked on my machine just fine.  I reinstalled Vista, and now it no longer finds the Wiimote with that parameter enabled...
            IntPtr hDevInfo = HIDImports.SetupDiGetClassDevs(ref guid, null, IntPtr.Zero, HIDImports.DIGCF_DEVICEINTERFACE);// | HIDImports.DIGCF_PRESENT);

            // create a new interface data struct and initialize its size
            HIDImports.SP_DEVICE_INTERFACE_DATA diData = new HIDImports.SP_DEVICE_INTERFACE_DATA();
            diData.cbSize = Marshal.SizeOf(diData);

            // get a device interface to a single device (enumerate all devices)
            while (HIDImports.SetupDiEnumDeviceInterfaces(hDevInfo, IntPtr.Zero, ref guid, index, ref diData))
            {
                UInt32 size;

                // get the buffer size for this device detail instance (returned in the size parameter)
                HIDImports.SetupDiGetDeviceInterfaceDetail(hDevInfo, ref diData, IntPtr.Zero, 0, out size, IntPtr.Zero);

                // create a detail struct and set its size
                HIDImports.SP_DEVICE_INTERFACE_DETAIL_DATA diDetail = new HIDImports.SP_DEVICE_INTERFACE_DETAIL_DATA();

                // yeah, yeah...well, see, on Win x86, cbSize must be 5 for some reason.  On x64, apparently 8 is what it wants.
                // someday I should figure this out.  Thanks to Paul Miller on this...
                if (IntPtr.Size == 8)
                    diDetail.cbSize = 8;
                else
                    diDetail.cbSize = 5;

                // actually get the detail struct
                if (HIDImports.SetupDiGetDeviceInterfaceDetail(hDevInfo, ref diData, ref diDetail, size, out size, IntPtr.Zero))
                {
                    Debug.WriteLine(index + " " + diDetail.DevicePath + " " + Marshal.GetLastWin32Error());

                    // open a read/write handle to our device using the DevicePath returned
                    SafeFileHandle mHandle = HIDImports.CreateFile(diDetail.DevicePath, FileAccess.ReadWrite, FileShare.ReadWrite, IntPtr.Zero, FileMode.Open, HIDImports.EFileAttributes.Overlapped, IntPtr.Zero);

                    // create an attributes struct and initialize the size
                    HIDImports.HIDD_ATTRIBUTES attrib = new HIDImports.HIDD_ATTRIBUTES();
                    attrib.Size = Marshal.SizeOf(attrib);

                    // get the attributes of the current device
                    if (HIDImports.HidD_GetAttributes(mHandle.DangerousGetHandle(), ref attrib))
                    {
                        // if the vendor and product IDs match up
                        if (attrib.VendorID == VID && attrib.ProductID == PID)
                        {
                            Debug.WriteLine("Found it!");
                            found = true;

                            Wiimote mote = new Wiimote();
                            mote.mStream = new FileStream(mHandle, FileAccess.ReadWrite, REPORT_LENGTH, true);
                            mote.mHandle = mHandle;

                            // start an async read operation on it
                            mote.BeginAsyncRead();

                            // read the calibration info from the controller
                            try
                            {
                                mote.ReadCalibration();
                            }
                            catch
                            {
                                // if we fail above, try the alternate HID writes
                                mote.mAltWriteMethod = true;
                                mote.ReadCalibration();
                            }


                            // force a status check to get the state of any extensions plugged in at startup
                            mote.GetStatus();

                            motes.Add(mote);
                        }
                        else
                        {
                            // otherwise this isn't the controller, so close up the file handle
                            mHandle.Close();
                        }
                    }
                }
                else
                {
                    // failed to get the detail struct
                    throw new Exception("SetupDiGetDeviceInterfaceDetail failed on index " + index);
                }

                index++;
            }

            // clean up our list
            HIDImports.SetupDiDestroyDeviceInfoList(hDevInfo);

            // if we didn't find a Wiimote, throw an exception
            if (!found)
                throw new Exception("Wiimote not found in HID device list.");

            return motes;
        }

and in the program I have duplicate the handler function in the form

Code: [Select]
private void Form1_Load(object sender, EventArgs e)
{
           
            //wm.WiimoteChanged += new WiimoteChangedEventHandler(wm_WiimoteChanged);
//wm.WiimoteExtensionChanged += new WiimoteExtensionChangedEventHandler(wm_WiimoteExtensionChanged);

g = Graphics.FromImage(b);
            g2 = Graphics.FromImage(b2);
            g3 = Graphics.FromImage(b3);
            g4 = Graphics.FromImage(b4);
            motes = Wiimote.GetConnectedWiimotes();
            NWii.Text = motes.Count.ToString();
            if (motes.Count > 0)
            {
                motes[0].WiimoteChanged += new WiimoteChangedEventHandler(wm_WiimoteChanged);
                motes[0].WiimoteExtensionChanged += new WiimoteExtensionChangedEventHandler(wm_WiimoteExtensionChanged);
                wm = motes[0];
                wm.SetReportType(Wiimote.InputReport.IRAccel, true);
                wm.SetLEDs(false, false, false, true);
                fs1 = new FileStream("wii1.txt", FileMode.Create, FileAccess.Write);
                sw1 = new StreamWriter(fs1);
            }
            if (motes.Count > 1)
            {
                motes[1].WiimoteChanged += new WiimoteChangedEventHandler(wm_WiimoteChanged2);
                motes[1].WiimoteExtensionChanged += new WiimoteExtensionChangedEventHandler(wm_WiimoteExtensionChanged2);
                wm2 = motes[1];
                wm2.SetReportType(Wiimote.InputReport.IRAccel, true);
                wm2.SetLEDs(false, false, true, false);
                fs2 = new FileStream("wii2.txt", FileMode.Create, FileAccess.Write);
                sw2 = new StreamWriter(fs2);
            }
            if (motes.Count > 2)
            {
                motes[2].WiimoteChanged += new WiimoteChangedEventHandler(wm_WiimoteChanged3);
                motes[2].WiimoteExtensionChanged += new WiimoteExtensionChangedEventHandler(wm_WiimoteExtensionChanged3);
                wm3 = motes[2];
                wm3.SetReportType(Wiimote.InputReport.IRAccel, true);
                wm3.SetLEDs(false, true, false, false);
                fs3 = new FileStream("wii3.txt", FileMode.Create, FileAccess.Write);
                sw3 = new StreamWriter(fs3);
            }
            if (motes.Count > 3)
            {
                motes[3].WiimoteChanged += new WiimoteChangedEventHandler(wm_WiimoteChanged4);
                motes[3].WiimoteExtensionChanged += new WiimoteExtensionChangedEventHandler(wm_WiimoteExtensionChanged4);
                wm4 = motes[3];
                wm4.SetReportType(Wiimote.InputReport.IRAccel, true);
                wm4.SetLEDs(true, false, false, false);
                fs4 = new FileStream("wii4.txt", FileMode.Create, FileAccess.Write);
                sw4 = new StreamWriter(fs4);
            }
       
           
}

but when i run the program it stay in loading mode...
I create the file to save the IR data.
whit 2 wiimote it work.

Any ideas??

7
Project Ideas / 3D tracking
« on: May 31, 2008, 07:04:48 AM »
Hi, I want create a 3d tracking system whith a 3/4 Wiimote, a 2 IR source and a base whit four reflective ball.
I have create an application that connect 4 Wiimote and get IR information to each other.
Now I must create a triangulation sistem.

Any ideas an help?

Thanks
Steve

Pages: 1