Developer

Ardupilot 2.5 preview part 2

Ok this post is about crosstrack error. Ardupilot 2.5 has a basic system for adjusting the plane's bearing when it has steered off of its intended path due to wind. Thanks to Doug Weibel for the code.
XTRACK_GAIN = .2if (abs(bearing_error) < 25) {        bearing_error += sin(radians(crosstrack_heading - bearing_error)) * wp_distance * XTRACK_GAIN;}
We set the crosstrack from our starting location as the angle toward the waypoint. As we get blown from side to side, that angle changes. We run that through sine to get a nice ratio and multiply it to get an angle to add to our heading.Depending on the gain and bearing error, we can get wild results, so we need to limit the effect to a range of degrees. In this case 25°. If we go outside of 25° by a lot, we can reset the crosstrack to be from the current location.Here is an example:
E-mail me when people leave their comments –

You need to be a member of diydrones to add comments!

Join diydrones

Comments

  • yes i see. Is the whole shield really needed or is just the sensor ok. I dont see where they even talk about just the sensor without the shield. Man they should have some kind of high school student discount :P
  • Developer
    Yes and yes. The airspeed sensor still gives valuable information, particularly if there is wind.
  • is the airspeed sensor still in use in the 2.5 code? will it still be in use with the imu's?
  • Developer
    I have Ryan's code. He was very kind to share. I will make a Flash version of it to compare the two and post it in a few days.
  • Developer
    Hey Jason,

    I'm glad you put in some edits. I had a constraint in my code as well, but must not have snipped enough. Rather than ignore the crosstrack error when it gets too large, I just constrain it to a maximum. The result is pretty similar to Ryan's vector field. We should take a look and see which is computationally lighter :)
  • Developer
    added you ryanbeall is mine
  • Developer
    jasonshort is my skype
  • Developer
    Ahh Yeah I see the transparent trick now....Skype?
  • Developer
    Hi Ryan,
    I might need a bit more detail on your two calls get_lambda and cross_track to understand what your doing. I like it though!
    In this version, I throw out anything too wacky. You can see the green bar go transparent.
  • Developer


    Maybe this pic will help describe what I'm getting at
This reply was deleted.