Go to Post Quoting Fred Durst--"Bring it on." - Billfred [more]
Home
Go Back   Chief Delphi > Technical > Control System > Sensors
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 20-02-2016, 10:57
schleprock's Avatar
schleprock schleprock is offline
Code Jockey
FRC #4905 (AndromedaOne)
Team Role: Mentor
 
Join Date: Feb 2015
Rookie Year: 2014
Location: massachusetts
Posts: 21
schleprock is an unknown quantity at this point
Re: navx-mxp AHRS.getAngle() method

Quote:
Originally Posted by slibert View Post
Let me take a look into it, sounds like a bug. Are you using Java?
yes, using Java.
Reply With Quote
  #2   Spotlight this post!  
Unread 21-02-2016, 01:44
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: 336
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: navx-mxp AHRS.getAngle() method

Quote:
Originally Posted by schleprock View Post
yes, using Java.
Thanks for helping us find this issue; an updated navX-MXP build is now available which fixes this issue in the Java library.
Reply With Quote
  #3   Spotlight this post!  
Unread 21-02-2016, 19:20
schleprock's Avatar
schleprock schleprock is offline
Code Jockey
FRC #4905 (AndromedaOne)
Team Role: Mentor
 
Join Date: Feb 2015
Rookie Year: 2014
Location: massachusetts
Posts: 21
schleprock is an unknown quantity at this point
Thumbs up Re: navx-mxp AHRS.getAngle() method

Quote:
Originally Posted by slibert View Post
Thanks for helping us find this issue; an updated navX-MXP build is now available which fixes this issue in the Java library.
thanks for getting a fix out this quickly. unfortunately we did not have the time to test the new library and for now we have a method that normalizes the angle so we can get around this. i'm hoping to be able to look at this later in the week and get back to you.

thanks,

bill
Reply With Quote
  #4   Spotlight this post!  
Unread 21-02-2016, 20:24
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 7,995
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: navx-mxp AHRS.getAngle() method

Quote:
Originally Posted by schleprock View Post
we have a method that normalizes the angle
What's your method?


Reply With Quote
  #5   Spotlight this post!  
Unread 21-02-2016, 20:35
schleprock's Avatar
schleprock schleprock is offline
Code Jockey
FRC #4905 (AndromedaOne)
Team Role: Mentor
 
Join Date: Feb 2015
Rookie Year: 2014
Location: massachusetts
Posts: 21
schleprock is an unknown quantity at this point
Re: navx-mxp AHRS.getAngle() method

Quote:
Originally Posted by Ether View Post
What's your method?


this is for our pid controller that rotates the robot to a heaing. in our code we now always set a target of 0 ie PIDcontroller.setSetpoint(0)

for the PIDsource we do the following:

public double pidGet() {
double gyroAngle = m_navX.getAngle();

//adding math to normalize the heading for a target of 0
//always
double diff = gyroAngle - m_headingToTurnTo;
if(diff <= -180){
diff += 360;
} else if(diff > 180){
diff -= 360;
}

return(diff);
}

the term normalize may be incorrect, but i couldn't come up with a better way to explain it.

unfortunately, trying to use this to tune the PID controller in test mode is rather difficult, but it does work in our code for commands to turn the robot to a specific heading. well, at least the robot doesn't just continuously spin as it was when we set a heading that caused the robot to spin past an angle of 0 or 360...

Last edited by schleprock : 21-02-2016 at 20:39.
Reply With Quote
Reply


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 20:02.

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