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 vehicle type and mode #28301

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

AP_DDS: Provide vehicle type and mode #28301

tizianofiorenzani opened this issue Oct 3, 2024 · 8 comments

Comments

@tizianofiorenzani
Copy link

DDS Interface to obtain vehicle's type and mode.

The DDS interface should provide information about the vehicle type and current mode.

Solution

  • Create a new topic /ap/flight_mode of custom type FlightMode.
  • FlightMode should contain:
    • vehicle_type: enum of the vehicle, plane, copter,....
    • flight_mode: enum of the current flight mode
    • armed: true if armed.
    • header
      • frame_id: string identifying the vehicle like SYSID_THISMAV.

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

@Ryanf55
Copy link
Collaborator

Ryanf55 commented Oct 3, 2024

Had you considered the reporting designed in REP-147?
https://ros.org/reps/rep-0147.html#flight-modes

@tizianofiorenzani
Copy link
Author

Thanks for the link. I find the proposed FlightMode message a a little too reductive, as it limits interaction with only Guided/Offline and does not provide any actual detail of the underlying mode. For example the DDS interface provides input for joystick, which could be used to control a airplane in FBWB (copter guided is way more advanced).

We could use the VehicleStatus type for what I called the vehicle_type, use the proposed FlightMode as a simplified mode, but I'd also find it useful to provide the actual flight mode, the same as we provide to a Mavlink interface.

@timtuxworth
Copy link
Contributor

timtuxworth commented Oct 4, 2024

frame_id seems confusing - in AP this might mean the frame_type/frame_class (e.g. if a VTOL is a X/H/Y frame and 4/6/8 motors etc) - whereas SYSID_THISMAV is not that.
Also SYSID_THISMAV is a number, not a string.

@Ryanf55
Copy link
Collaborator

Ryanf55 commented Oct 4, 2024

frame_id seems confusing - in AP this might mean the frame_type/frame_class (e.g. if a VTOL is a X/H/Y frame and 4/6/8 motors etc) - whereas SYSID_THISMAV is not that. Also SYSID_THISMAV is a number, not a string.

frame_id is supposed to correspond to a coordinate frame, not a vehicle number. Each vehicle has it's own base_link of the "body" frame in AP terminology, and then attached sensors such as GPS, camera, rangefinder also have their own frames relative to that. I wouldn't worry about populating the frame ID with a value to differentiate which vehicle. Differentiating vehicles for swarming type operations is a separate issue here: #23567

I agree knowing the mode the vehicle is in is very useful because it can failsafe, or the GCS can change out of GUIDED while you are running some autonomous operation. To me it would be best if we published this with reliable transport on state change

  • when the flight mode changed
  • When failsafe is engaged/disengaged

Having Ardupilot manage the state will make it easiest for companion computer algorithms to abort, rather than all of them having to continuously check if the vehicle is in the correct mode.

@Ryanf55
Copy link
Collaborator

Ryanf55 commented Oct 4, 2024

Also, can we call it /mode instead of /flight_mode because not all ArduPilot vehicles (Sub,Rover) fly?
Perhaps /mode_status or /current_mode?

@tizianofiorenzani
Copy link
Author

Follow up:

  • topic /ap/mode_status or /ap/status?
  • published when status changes with reliable transport.
  • fields:
    • frame_class
    • armed
    • failsafe (true when in failsafe mode)
    • mode (flight mode)
    • is_flying

@Ryanf55
Copy link
Collaborator

Ryanf55 commented Oct 4, 2024

looking better - What's the meaning of is_flying on non-flight vehicles?

@tizianofiorenzani
Copy link
Author

that is a good point, what can be a more generic term? Also, I know is_flying is well estimated for copters, but I am not so sure about planes.

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

3 participants