View Single Post
  #6   Spotlight this post!  
Unread 22-05-2016, 16:35
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,038
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 Continuous Angle to Calculate Derivative

Quote:
Originally Posted by Richard100 View Post
Not finding this to be very clear either. We're likely discussing different aspects of the problem.

I am discussing the solution to this aspect of the OP's original framing of the problem (see bolded portion):
Quote:
Originally Posted by lethc View Post
Does anyone have any ideas on how I would get a continuous angle heading from the NavX? I.E. one that doesn't jump from 360 to 0 instantly, because that messes up the derivative calculation
You don't need a continuous angle to do a simple difference calculation (which is what I anticipated the OP was really wanting).

The IEEERemainder gives you that answer:

Quote:
Originally Posted by Ether View Post
what you want is the shortest angle from the previous reading to the present reading, with the correct sign. The IEEERemainder function1 does this with one line of code:
Code:
shortest_angle = IEEERemainder(present-previous,360);
Quote:
Originally Posted by lethc View Post
Just tried this out and it works perfectly. Thank you for your help.

Reply With Quote