It is currently Sun Nov 18, 2018 3:20 pm



Reply to topic  [ 6 posts ] 
 Wiimote[n].ahrs wrong behavior 
Author Message
One Eyed Hopeful

Joined: Tue Oct 31, 2017 6:30 pm
Posts: 2
Reply with quote
Without moving the Wiimote and letting it lay down on the table the expressions:

wiimote[0].ahrs.yaw
wiimote[0].ahrs.pitch
wiimote[0].ahrs.roll

are not giving a fixed value (as they have to do), instead they give a number that continuosly increse/decrease by a little causing it loose the calibration of 0 spot

I need it stays calibrated cause i want to use it as a steering wheel

There's any workaround?

Thanks for reply


Thu Nov 02, 2017 4:03 pm
Profile
Cross Eyed!
User avatar

Joined: Thu Apr 09, 2015 4:27 am
Posts: 134
Reply with quote
neonflux wrote:
I need it stays calibrated cause i want to use it as a steering wheel

There's any workaround?

Thanks for reply


You're probably better off calculating the angle from gravity with the acceleration.


Thu Nov 02, 2017 4:21 pm
Profile
One Eyed Hopeful

Joined: Tue Oct 31, 2017 6:30 pm
Posts: 2
Reply with quote
Could you make an example pls?

The expression i use now to obtain the delta is:

yaw = 350*filters.deadband(filters.delta(wiimote[0].ahrs.yaw),0.01)

Thanks

Edit: Lol you are the one that reply at github too, I've noticed now :/


Thu Nov 02, 2017 4:45 pm
Profile
Cross Eyed!
User avatar

Joined: Thu Apr 09, 2015 4:27 am
Posts: 134
Reply with quote
neonflux wrote:
Could you make an example pls?

Sure thing:
Code:
def acc_update():
   diagnostics.watch(wiimote[0].acceleration.x)
   diagnostics.watch(wiimote[0].acceleration.y)
   diagnostics.watch(wiimote[0].acceleration.z)
   accx = wiimote[0].acceleration.x
   accy = wiimote[0].acceleration.y
   if accx == 0:
      angle = 0
   else:
      angle = math.atan(accy/accx)
   diagnostics.watch(angle)

if starting:
   wiimote[0].acceleration.update += acc_update


neonflux wrote:
Edit: Lol you are the one that reply at github too, I've noticed now :/

Yep :lol:


Fri Nov 03, 2017 8:44 am
Profile
One Eyed Hopeful

Joined: Mon Jan 29, 2018 4:41 pm
Posts: 13
Reply with quote
zelmon64 wrote:
Code:
def acc_update():
   diagnostics.watch(wiimote[0].acceleration.x)
   diagnostics.watch(wiimote[0].acceleration.y)
   diagnostics.watch(wiimote[0].acceleration.z)
   accx = wiimote[0].acceleration.x
   accy = wiimote[0].acceleration.y
   if accx == 0:
      angle = 0
   else:
      angle = math.atan(accy/accx)
   diagnostics.watch(angle)

if starting:
   wiimote[0].acceleration.update += acc_update


so I tried this on my wiimote, and this y/x seems to be (or at least emulate) the pitch. I've tried replacing y and x with all combinations of x, y, and z, but for some reason, can't consistently get roll or yaw. If y/x = pitch, then what's roll and yaw? I'm very new to this so all help is welcome and appreciated.


Fri Feb 09, 2018 2:00 am
Profile
One Eyed Hopeful

Joined: Mon Jan 29, 2018 4:41 pm
Posts: 13
Reply with quote
WestleyTwain wrote:
so I tried this on my wiimote, and this y/x seems to be (or at least emulate) the pitch. I've tried replacing y and x with all combinations of x, y, and z, but for some reason, can't consistently get roll or yaw. If y/x = pitch, then what's roll and yaw? I'm very new to this so all help is welcome and appreciated.


I see what this is doing now. Sorry to bother y'all!


Sat Feb 10, 2018 5:51 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 6 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Designed by STSoftware.