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
Wiimote[n].ahrs wrong behavior
-
- One Eyed Hopeful
- Posts: 2
- Joined: Tue Oct 31, 2017 6:30 pm
- zelmon64
- Cross Eyed!
- Posts: 134
- Joined: Thu Apr 09, 2015 4:27 am
Re: Wiimote[n].ahrs wrong behavior
You're probably better off calculating the angle from gravity with the acceleration.neonflux wrote:I need it stays calibrated cause i want to use it as a steering wheel
There's any workaround?
Thanks for reply
-
- One Eyed Hopeful
- Posts: 2
- Joined: Tue Oct 31, 2017 6:30 pm
Re: Wiimote[n].ahrs wrong behavior
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 :/
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 :/
- zelmon64
- Cross Eyed!
- Posts: 134
- Joined: Thu Apr 09, 2015 4:27 am
Re: Wiimote[n].ahrs wrong behavior
Sure thing:neonflux wrote:Could you make an example pls?
Code: Select all
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
Yepneonflux wrote:Edit: Lol you are the one that reply at github too, I've noticed now :/
-
- One Eyed Hopeful
- Posts: 13
- Joined: Mon Jan 29, 2018 4:41 pm
Re: Wiimote[n].ahrs wrong behavior
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.zelmon64 wrote:Code: Select all
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
-
- One Eyed Hopeful
- Posts: 13
- Joined: Mon Jan 29, 2018 4:41 pm
Re: Wiimote[n].ahrs wrong behavior
I see what this is doing now. Sorry to bother y'all!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.