.comment-link {margin-left:.6em;}
Moriash Moreau: My Second Life
Sunday, April 29, 2007
 
Bike Status
As mentioned last week, I've been taking another stab at wiring up my old stationary exercise bicycle. This morning, I more or less finished.


Not too much to look at here, really. A momentary connect lever switch is mounted on the frame of the bike (attached to that bit of plywood there at center), right above the bearing for the pedal sprocket. (I'm making up terminology on the fly here, but it's not that hard to figure out!) A bisected scrap of wooden dowel is appended on the sprocket itself. As the sprocket turns, the dowel passes over the switch and depresses the lever. The switch is wired to the Page Up key, and the associated scripts in SL know what to do with the keypresses (currently measuring time between presses and deducing speed). Simple enough.

This morning's addition involved steering. Over the past few days, I've kicked around all sorts of custom switching schemes to allow me to move in world. Finally, late last night, it occurred to me that modern joysticks might already have solved the problem for me. I haven't used a joystick for a decade or more, and apparently they've come a long way in the interim.

The joystick pictured above is a Logitech Attack 3. Nothing terribly special about it, although it does seem to work fairly well. Mostly, though, it was the cheapest one available at the local Best Buy. The important thing is it allows the user to assign all of the controls, including the axis controls. This was a bit of a surprise, and was exactly what I needed! Currently, it's configured to act as fancy keyboard arrow keys. Push it left, it presses the left arrow key for me. Pull it back, it presses the down arrow. And it has a variety of other assignable buttons, which I've configured to activate various utility gestures in-world. The trigger hits CTRL-F2 for me, which turns my flight control script on and off. The buttons at the base control various fine-tuning aspects of the script. And so on. Pretty slick!

So, this one turned out to be quite a bit simpler than the treadmill project (you can see the umbilical feeding the control interface, monitor, keyboard, and mouse for that running offscreen at right). Once I had the joystick, and figured out how to configure it, I just needed to come up with a place to put it. Thus the little shelf hanging off of the handlebars. It's not pretty, but it seems to work. It's nice to have a sufficient accumulation of scrap and spare parts lying around to be able to knock something like that together in half an hour, without having to make a specific trip to the hardware store first.

I should send out a nod to qDot's previous work with bicycle interfaces. His is no doubt more technically sophisticated than mine. In particular, it pre-processes (by hardware and non-LSL software) the signals from the bike, and uses a scheme to more efficiently pass the resulting data to SL. As for me, I simply monitor the keypresses and do all of the interpretation work in LSL. (Fortunately, this does not seem to be a particularly resource-intensive process.) While dDot's approach has its advantages, this seems to work just fine for my purposes. The main difference is mine is susceptible to loss of focus if, say, an IM window is opened. Mildly vexing, but I don't often engage in long typed conversations while biking, in any case. (Might be fun when voice comes along, assuming the equipment isn't too noisy.) If you get a Busy response, well, there's a chance that I'm out riding my bike. Leave a message, and I'll get back to you later.

One thing I notice is the similarities between his time-out scheme and mine. It's been a while since I read his article, so I can't say with certainty if I got the concept from him or developed it independently. In any case, it's the only way this setup will work. The helicopter setup has a timer that resets every time the Page Up key is pressed. If too much time elapses (1.5 seconds, currently), the script in-world assumes that I've stopped pedaling, and the heli-bike plummets from the sky. (The trigger on the joystick turns this script on and off, should I wish to just hang where I am under my avatar's normal flight power.) I like his idea of rigging a bike powered version of SFCave. I'd experimented with a version of that using normal keypresses (press a key, the player is pushed upward, release and he falls). But it proved to require far too much space to operate, and wouldn't fit on my parcel. Perhaps the trick would be to leave the player stationary and move the cavern (in the form of a series of paired prims (roof and floor, with continuously varying spaces between, floating front-to-back under their own power) around him. Food for thought, that.

And I suppose that's all I have to say about this thing. Now, I'm going for a ride!
Comments:
Lol , SL and Excercising at the same time. I shouldt invent something like that :-)
 
Post a Comment



Return to Main Page