[X3D-Public] Accelerometer environment sensor

Keith Victor keithrvictor at gmail.com
Wed Nov 18 12:12:16 PST 2009

Hey Don:

I agree that an orientation_changed output field would be helpfull in
addition to the raw acceleration data.  For true 3D orientation, you would
also need compass input along with the accelerometer.  Or, is this the 2D
orienation, as I had described.  We need to clearly define this.

In an ideal world, you can integrate acceleration to get relative velocity.
And, once again to get relative position.  But, Im afraid thats not going to
work with these simple devices.  The acceleration of gravity is so much
stronger than anything else going on, that the only thing it is good for is
detecting the orientation of the device ( which way is down ), and any
extreme shaking.  You're not going to get any good velocity data out of an
iPhone ;(

What is the "IsActive" output field do?  Does that tell you if the device
supports this feature.  If its enabled, and working, its going to be active.
Perhaps SFBool isSupported   is a better name.


On Wed, Nov 18, 2009 at 12:53 PM, Don Brutzman <brutzman at nps.edu> wrote:

> Keith Victor wrote:
>> Hey Don:
>>  I think it might look like this:
>>  SFBool   InputOutput   enabled    // typical Sensor Node field
>> SFVec3f    outputOnly    acceleration_changed    // the acceleration
>> vector, in Gs.
>>  Simple enough?
> thanks Keith.  so far so good...
> One simple example usage:
>> Then just Route that into a Script, do an atan2( accel.y, accel.x ) to get
>> an angle.
>> SetOrientation(  0,0,1, atan2( ... ) )
>>  Set the orientation of a Transform that is inside a Billboard, and the
>> content will remain plum as you rotate the device around.
> aha this is where it gets trickier.  we likely don't want users to
> write Script nodes to integrate accelerations and moments (linear
> and rotational forces) into velocities.  too hard, too error prone.
> so adding another similar SFVec3f field for velocity_changed is
> likely justifiable.
> it looks like the CSS example goes one integration step further and
> provides orientation angles.  which is most helpful for a scene author
> to use.  presumably we can set the initial orientation as zero when the
> node becomes enabled, allowing author control (enable/disable) if a
> reset capability is needed.
> folowing Keith's lead, here is a fuller possible signature:
> 22 Environmental sensor component
> AccelerationSensor: X3DSensorNode {
>  SFBool [in,out]  enabled  TRUE
>  SFVec3f [out]    acceleration_changed [m/s^2]
>  SFVec3f [out]    velocity_changed     [m/s]
>  SFRotation [out] orientation_changed
>  SFNode [in,out]  metadata NULL [X3DMetadataObject]
>  SFBool [out]     isActive
> }
> p.s. it would be helpful if someone actually looked at the Mozilla
> implementation, we wouldn't have to speculate as much about what
> they are doing.  anybody out there?
> all the best, Don
> --
> Don Brutzman  Naval Postgraduate School, Code USW/Br
> brutzman at nps.edu
> Watkins 270   MOVES Institute, Monterey CA 93943-5000 USA  work
> +1.831.656.2149
> X3D, virtual worlds, underwater robots, XMSF
> http://web.nps.navy.mil/~brutzman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20091118/fd1f7b76/attachment.html>

More information about the X3D-Public mailing list