WiiRemote EventClient disconnect problems
#16
Awesome, got the volume control working.

One thing i'm noticing though, the calculations are absolute, not relative. And by that I mean, it doesn't calculate my roll relative to where i started presing B, but rather it's always relative to the flat/unrotated position. Do you know what I mean? Sorry if i'm explaining it poorly.

It wouldn't be too difficult to add a way to do these calculations differently. The first time we realize the HOLD_BUTTON_TIMEOUT threshold has been crossed, you could get the current roll value, then subsequent entries to handleACC would calculate the difference between the current roll value and the original roll value and pass that onto the EventClient.

Thoughts? I'll try coding this up to if it works as well as I think it will.
Reply
#17
Looks like it's not as easy as it sounds. I added what i thought would be the code to handle this. Looks like this currently:

Code:
if ((controller.m_buttonDownTime > HOLD_BUTTON_TIMEOUT) && controller.m_holdableHeld)
          {
            EnableMotionSensing(wm);
            if (!controller.m_newMotion)
            {
              printf("New Motion!!!!!\n");
              controller.m_newMotion = true;
              controller.m_startRoll = wm->orient.roll;
              controller.m_startPitch = wm->orient.pitch;
              printf("NewStartRoll: %f\n", controller.m_startRoll);
            }
            else
            {
              float currentRoll;// = wm->orient.roll;
              controller.m_roll = (currentRoll = wm->orient.roll) - controller.m_startRoll;
              controller.m_pitch = wm->orient.pitch - controller.m_startPitch;
              printf("current: %f, start: %f, diff: %f\n",
                  currentRoll, controller.m_startRoll, controller.m_roll);
              controller.handleACC();
            }
          }

But when i test it, the starting value isn't usually very accurate. Might be that you want to wait a couple of ticks before settling on a start value? But how many ticks is a tough question to answer.

Other than that, the logic seems pretty sane. About a quarter of the time, the start value does end up being accurate, and in those cases, it works like a charm. I'll keep fiddling.
Reply
#18
See updated client @ Trac ticket. Works MUCH better, thanks for the idea.

Now needs to keep a ubound and lbound for how high/low the roll gets, so that it's activated at ubound +/- 30 rather than just +/-30. Hard to explain, but play around some and I think you'll see what i mean.

I'll work that out next.

TheUni
Reply
#19
I've just got the Wii remote working with XBMC. Seems to work well so far - great not having to point the remote at a receiver for it to work.

Once I get video playback working decently due to ATI driver issues I'd be keen to try some of these motion related changes that have been discussed. The old XBox seems like a dream setup compared to Linux at the moment.

What would the easiest way to do that? Will the wiiremote Linux packages in the PPA be updated, or will I have to revert to compiling code?

Cheers,
David
Reply
#20
For now you'll have to compile the code, since it's still in development. Top2fs mentioned that maybe at some point it will replace the current client available from apt, but it will be after gold release for sure.

TheUni
Reply
#21
Finally got XBMC under Linux working and have the Wii Remote all hooked in.

Using the standard WiiRemote Keymapping that ships with XBMC, while playing a video the Up Arrow pauses, and the Down Arrow stops. We were using these buttons on the original XBox remote for Big Skip Forward and Big Skip Backward (timing configured for them to be 6 commercial breaks). They were really handy, and the WAF will decrease if I don't keep them.

What key mappings are other people using? Not sure how best to access:
Big Skip Forward - would prefer the Up Arrow (as opposed to Pause)
Big Skip Backward - would prefer the Down Arrow (as opposed to Stop)
Fast Forward - this may be able to be done using "Hold down B and then rotate right" based on discussion here. Analog seek might work quite well. Not sure how that was thinking of being implemented.
Rewind - this may be able to be done using "Hold Down B and then rotate left" as above
Pause - pretty easy to get to by using A and then navigating. Would prefer this was a single button press though. Probably fine though.
Stop - also pretty easy to get to by using A then navigating. XBMC seems to remember the option that was last chosen, so if that was stop it's only two button presses. (Actually it only remembers it sometimes, seems to default to Audio Settings other times. Perhaps just the Mediastream skin does this though?)

The 1 and 2 buttons open things we'd hardly ever use while watching videos, so wondered if these could be used differently.

What keymappings or behaviors are other people using that seem to work quite well?
Reply
#22
I had a spin through the default Keymap.xml. There are a few changes that I will make to the default WiiRemote settings so I can more easily remember (and explain) the general functions for the buttons, e.g.

1 for "Info/ContextMenu" type stuff
2 for "Delete/Backspace/Stop" type stuff
B for "Back/Close" type stuff

Where do I get the latest code that includes the button definitions for roll and pitch mentioned in this thread? The downloads on the trac ticket (http://trac.xbmc.org/ticket/4264) seems to be from 5 months ago. Really want to try the Analog Fast Forward and Rewind.

Also, I noticed the the PS3 joystick entries in the Keymap.xml had <axis> tags in them that seemed to be for a similar thing to the accelerometer stuff mentioned in this thread. Do those <axis> entries in XBMC behave differently to a button that is triggered by an acceleration in a direction on the Wii remote?

Great work making the changes to get the Wii to work as good as it can. Bluetooth remote is fantastic, and the Wii remote has just enough buttons to cover most everything we seem to need.

Now that Atlantis final has been released, maybe this can get into the main trunk.
Reply
#23
The latest code is here, though it's still a work in progress:

http://trac.xbmc.org/ticket/5080

I've also got tilt working, though it's not yet reliable enough to use. I've tried to come up with a good way to use it, though I can't find a good case for it. PM me if you'd like to try it.

TheUni
Reply
#24
For anyone else trying to get this working here are some more detailed instructions (I haven't compiled C stuff for ages so it's a reminder for me when I do it on the HTPC).

Download, Make and Install the WiiUse libraries
  1. Install the development libraries for bluetooth.
    Code:
    sudo apt-get install libbluetooth-dev
  2. Download wiiuse from SourceForge. http://sourceforge.net/project/showfiles..._id=187194
  3. Extract the wiiuse files to your machine and change to that directory. Read the README file - the next two steps are contained in the README.
  4. Make the wiiuse library
    Code:
    make wiiuse

  5. Install the wiiuse library. sudo is needed because some of the libraries are put into locations only root can write to.
    Code:
    sudo make install


Download and Compile the WiiRemoteNew code
  1. Download latest source from http://trac.xbmc.org/ticket/5080
  2. Extract WiiRemoteNew directory to XBMC/tools/EventClients/Clients/WiiRemoteNew and change to that directory.
  3. Read the README.
  4. Fix the compile error as per the README
  5. Compile using
    Code:
    g++ -lwiiuse client.cpp -o xbmc-wiiremote
  6. Try it out by running it
    Code:
    ./xbmc-wiiremote
Reply

Logout Mark Read Team Forum Stats Members Help
WiiRemote EventClient disconnect problems0