Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AP_DDS: Provide airspeed for planes #28300

Open
tizianofiorenzani opened this issue Oct 3, 2024 · 10 comments
Open

AP_DDS: Provide airspeed for planes #28300

tizianofiorenzani opened this issue Oct 3, 2024 · 10 comments

Comments

@tizianofiorenzani
Copy link

tizianofiorenzani commented Oct 3, 2024

Airspeed for planes

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

Solution

  • Publish the airspeed using the same /ap/twist/filtered topic, with a dedicated frame_id = "airspeed".
  • Leave the frame_id empty for standard Inertial/Body

Alternative

  • Publishing a TwistStamped message for just one element seems like a waste of bandwidth.
  • We could create a dedicated /ap/airspeed/ topic of type std_msgs/Float32, as the timestamp might not be crucial.

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

@Ryanf55
Copy link
Collaborator

Ryanf55 commented Oct 4, 2024

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
Copy link
Author

tizianofiorenzani commented Oct 4, 2024

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

  • x: airspeed
  • y: angle of attack (positive when flow comes from underneath)
  • z: sideslip angle (positive when flow comes from left)
  • topic name could be /ap/airspeed, where the frame_id = wind_axis

@Ryanf55
Copy link
Collaborator

Ryanf55 commented Oct 4, 2024

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

@tizianofiorenzani
Copy link
Author

tizianofiorenzani commented Oct 4, 2024

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
Copy link
Collaborator

Ryanf55 commented Oct 4, 2024

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
Copy link
Author

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

@tizianofiorenzani
Copy link
Author

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
Copy link
Collaborator

Ryanf55 commented Oct 5, 2024

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

@tizianofiorenzani
Copy link
Author

Here is the PR: #28319

@tizianofiorenzani
Copy link
Author

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants