ArduPilot / ardupilot

ArduPlane, ArduCopter, ArduRover, ArduSub source
http://ardupilot.org/
GNU General Public License v3.0
11.04k stars 17.6k forks source link

AP_DDS: Provide airspeed for planes #28300

Open tizianofiorenzani opened 1 month ago

tizianofiorenzani commented 1 month ago

Airspeed for planes

The DDS interface does not provide the airspeed, which is an essential information for planes (subs?).

Solution

Alternative

Platform [ ] All [ ] AntennaTracker [ ] Copter [ x ] Plane [ ] Rover [ ? ] Submarine

Ryanf55 commented 1 month ago

Airspeed would be great to add to the interface. Airspeed doesn't have a rotational component though, so twist seems overkill and wasteful of data. Did you consider publishing just a geometry_msgs/msg/Vector3 with the body frame component of estimated airspeed? Plane's zero sidesplip assumption means it would only be populating the X component, but copter could populate more fields.

tizianofiorenzani commented 1 month ago

I like this idea, we could use the three components to publish.

Ryanf55 commented 1 month ago

Sideslip is only for plane. Why not just XYZ relative to body frame.

tizianofiorenzani commented 1 month ago

You mean airspeed in body frame? That would work. length of vector is what we call "airspeed", which most of the times will result in only the x component unless you have AOA and sideslip measurements, or they are estimated internally.

Ryanf55 commented 1 month ago

You mean airspeed in body frame? That would work. length of vector is what we call "airspeed", which most of the times will result in only the x component unless you have AOA and sideslip measurements, or they are estimated internally.

Yea, that's what I meant.

tizianofiorenzani commented 1 month ago

I can work this out in a PR and we can move ahead from there.

tizianofiorenzani commented 1 month ago

Well, from inspecting the code it seems pretty easy to obtain the TAS vector:

    Vector3f airspeed_vec_bf;
    if (AP::ahrs().airspeed_vector_true(airspeed_vec_bf)) {
        // we are running the EKF3 wind estimation code which can give
        // us an airspeed estimate
        return airspeed_vec_bf.length();
    }
Ryanf55 commented 1 month ago

Awesome, at what rate do you think it should be published?

tizianofiorenzani commented 1 month ago

Here is the PR: https://github.com/ArduPilot/ardupilot/pull/28319

tizianofiorenzani commented 1 month ago

Awesome, at what rate do you think it should be published?

I publish it within the same velocity timer, if airspeed is available.