Go to Post Steampunk goggles are perfectly legal as forehead protectors. - Nuttyman54 [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 07-02-2016, 14:52
TimTheGreat's Avatar
TimTheGreat TimTheGreat is offline
ArchdukeTim
FRC #1418 (Vae Victis)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2011
Location: Falls Church
Posts: 238
TimTheGreat has a spectacular aura aboutTimTheGreat has a spectacular aura aboutTimTheGreat has a spectacular aura about
Reset navX roll

Is there a way to zero the navx roll midgame?
__________________
There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.



2012 - Gracious Professionalism - Greater DC
2014 - Regional Finalist - Virginia | Industrial Design - Virginia | Regional Finalist - Greater DC
2015 - Innovation in Control - Greater DC
2016 - District Event Winner - VAHAY | Innovation in Control - VAHAY | District Event Winner - MDBET | Industrial Design - MDBET | District Champion - CHCMP | Innovation in Control - CHCMP
  #2   Spotlight this post!  
Unread 07-02-2016, 19:03
slibert slibert is offline
Software Mentor
AKA: Scott Libert
FRC #2465 (Kauaibots)
Team Role: Mentor
 
Join Date: Oct 2011
Rookie Year: 2005
Location: Kauai, Hawaii
Posts: 356
slibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud of
Re: Reset navX roll

Quote:
Originally Posted by TimTheGreat View Post
Is there a way to zero the navx roll midgame?
Yaw (z axis rotation angle): yes

Roll and Pitch (x and y axis rotation angles): no

See this page for detailed description of these terms.

Roll/Pitch angle does not drift over time - can you please explain why you would like to reset it, and what you would reset it to?
  #3   Spotlight this post!  
Unread 07-02-2016, 21:28
Dan Waxman Dan Waxman is offline
Registered User
FRC #0263 (Aftershock)
Team Role: Programmer
 
Join Date: Feb 2016
Rookie Year: 2016
Location: Long Island
Posts: 35
Dan Waxman is an unknown quantity at this point
Re: Reset navX roll

While I don't think it's supported by navx, you can get around and effectively reset. I would do this by having a reset method which reads the current roll and sets it to a variable (lets say lastResetRoll). Then just subtract lastResetRoll from the current roll whenever you access roll and you have an effectively "reset" roll.
  #4   Spotlight this post!  
Unread 07-02-2016, 22:41
TimTheGreat's Avatar
TimTheGreat TimTheGreat is offline
ArchdukeTim
FRC #1418 (Vae Victis)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2011
Location: Falls Church
Posts: 238
TimTheGreat has a spectacular aura aboutTimTheGreat has a spectacular aura aboutTimTheGreat has a spectacular aura about
Re: Reset navX roll

Quote:
Originally Posted by slibert View Post

Roll/Pitch angle does not drift over time
Our readouts say differently. Not buy much, but about .05 degree a second. We are trying to tell if we are on the ramps of the obstacles. I know it isn't much but it also doesn't equal 0 when we are on the ground.
__________________
There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.



2012 - Gracious Professionalism - Greater DC
2014 - Regional Finalist - Virginia | Industrial Design - Virginia | Regional Finalist - Greater DC
2015 - Innovation in Control - Greater DC
2016 - District Event Winner - VAHAY | Innovation in Control - VAHAY | District Event Winner - MDBET | Industrial Design - MDBET | District Champion - CHCMP | Innovation in Control - CHCMP
  #5   Spotlight this post!  
Unread 07-02-2016, 23:09
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: Reset navX roll

Quote:
Originally Posted by TimTheGreat View Post
Our readouts say differently. Not buy much, but about .05 degree a second. We are trying to tell if we are on the ramps of the obstacles. I know it isn't much but it also doesn't equal 0 when we are on the ground.
Since it's reported to you as a float, it will never exactly equal zero. Floating point numbers aren't exact, they are only approximations, so you can never use an == comparison on floats or doubles and expect it to work.

The NavX is performing a sensor fusion algorithm which combines accelerometer and gyro data. When the robot is not moving, the accelerometers will read a constant 1G vector due to gravity, and this vector can be used to trim the pitch/roll readings even with zero gyro movement so they are exact. While moving, the estimated pitch/roll reading can be used to subtract gravity and get vehicle accelerations from an accelerometer reading both gravity and vehicle accelerations.

The 'drift' you're seeing is probably the error in the gyros being slowly corrected by the accelerometers.

There's also the possibility that you aren't truly flat on the ground, since e.g. a 6wd drop center will have a few degrees of normal chassis rock.
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
  #6   Spotlight this post!  
Unread 07-02-2016, 23:12
Dan Waxman Dan Waxman is offline
Registered User
FRC #0263 (Aftershock)
Team Role: Programmer
 
Join Date: Feb 2016
Rookie Year: 2016
Location: Long Island
Posts: 35
Dan Waxman is an unknown quantity at this point
Re: Reset navX roll

Here, try something like this.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 18:28.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi