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

RemoteID v2 and adding additional remote ID definitions #1865

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

BluemarkInnovations
Copy link

At the moment I'm working both on integrating Remote ID MAVLink support in ArduPilot and releasing a Remote ID MAVLink capable transponder.

An outcome of this process is that -in my opinion - the current set of MAVLink message definitions are incomplete. Next, I have created an issue at the OpenDrone ID project to discuss new message definitions with the maintainers. That is now complete and in this PR I'm submitting two additional message definitions:

  • CMD message to control the radio transmission of a Remote ID transponder. For instance, it can be useful to switch off radio transmission when the UAV is on the ground.
  • ACK message to signal incompatibility issues. For instance if the Remote ID transponder does not support a particular MAVLink Remote ID message, it can signal this using the ACK message.

@hamishwillee
Copy link
Collaborator

hamishwillee commented Jul 14, 2022

New messages in common.xml should be marked as WIP until there is a working/prototyped implementation. At that point we can bring it to the MAVLink call to discuss whether we're happy with the stability.

With respect to the ACK message, "generally" if there is a requirement for a command/response we use the command protocol. Can you show me the message sequence you're expecting where you might need to send this ACK? What is the transponder / sender supposed to DO in this case?

@friissoren I'm hoping you can confirm that you understand the use cases here and are happy with the implementation.
@auturgy FYI

@auturgy
Copy link
Collaborator

auturgy commented Jul 14, 2022

@hendjoshsr71

@BluemarkInnovations
Copy link
Author

Marked the messages as WIP.

With respect to the ACK message, "generally" if there is a requirement for a command/response we use the command protocol. Can you show me the message sequence you're expecting where you might need to send this ACK?

Message sequence example 1:
Autopilot system sends OPEN_DRONE_ID_MESSAGE_PACK to transponder A. The transponder supports OPEN_DRONE_ID_MESSAGE_PACK message types, so it responds with OPEN_DRONE_ID_ACK message with ACK status MAV_ODID_ACK_OK.

What is the transponder / sender supposed to DO in this case?

Nothing, the auto pilot system can keep sending OPEN_DRONE_ID_MESSAGE_PACK packages.

Message sequence example 2:
Autopilot system sends OPEN_DRONE_ID_MESSAGE_PACK to transponder B. The transponder does not support OPEN_DRONE_ID_MESSAGE_PACK message types, so it responds with OPEN_DRONE_ID_ACK message with ACK status MAV_ODID_ACK_ERR_NOT_SUPPORTED.

What is the transponder / sender supposed to DO in this case?

The auto pilot knows that it should use other OpenDrone ID packets types. In this example it would try the individual messages instead like OPEN_DRONE_ID_BASIC_ID, OPEN_DRONE_ID_LOCATION.

Compatibility issues
If in future, the Remote ID standard evolves, it may result in new MAVLink RemoteID message definitions. Sören indicated that it is unlikely that this is the case: Since both the ASTM and ASD-STAN standards are now basically done, the chance that there will be future changes is quite small. Nevertheless if this would be the case, ACK message could also useful here to detect incompatibility issues.

In general -in my opinion- the auto pilot system needs to know if the transponder has accepted Remote ID messages. Remote ID will become a mandatory technology, so if messages are not supported or received faulty by the transponder, Remote ID signals will be broadcast incompletely or not at all.

If the command protocol is a better solution to this, we should use that. I will do some more reading on this. If you need additional examples, please let me know.

@BluemarkInnovations
Copy link
Author

Another example would be for the OPEN_DRONE_ID_CMD message. Not all transponders support all transmission modes. Most support only BLE ones as can be seen on the page for stand-alone devices.

For instance, if the auto pilot sends message OPEN_DRONE_ID_CMD with MAV_ODID_TRANSMISSION_MODE_WLAN_BEACON as transmission mode, the ACK message (MAV_ODID_ACK_ERR_NOT_SUPPORTED) can be used by the transponder to indicate that it doesn't support WiFi transmissions as it only has BLE hardware. The auto pilot should then try other transmission modes. Mandatory transmission modes differ a bit between the regions.

Reading a bit into MAVLink commands, I think OPEN_DRONE_ID_CMD should be a command and not defined as a message.

@friissoren
Copy link
Contributor

I definitely see a need to be able to control the transmission type/frequency etc. That is a clear missing item in the current set of messages.

Whether that should be via a message or command is not clear to me. I am not familiar enough with general MAVLink conventions to comment on that.

I can see some value in the acknowledgement message as well. I think we just need to document further when/where it would be expected that this message is used and in what types of typical contexts (just like @BluemarkInnovations already started describing earlier in this thread).

@friissoren
Copy link
Contributor

@lukasbrchl: does your team possibly have any comments/input on this?

message_definitions/v1.0/common.xml Outdated Show resolved Hide resolved
message_definitions/v1.0/common.xml Outdated Show resolved Hide resolved
<field type="uint8_t" name="command" enum="MAV_ODID_COMMAND">Controls the transmission of the OpenDroneID device.</field>
<field type="uint8_t" name="transmission_mode" enum="MAV_ODID_TRANSMISSION_MODE">Configure the OpenDroneID transmission mode.</field>
<field type="uint16_t" name="transmission_period_ms" units="ms">Configures the OpenDroneID transmission period. Valid values are between 100 and 3000 ms.</field>
</message>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we add the following note at the end?

<!-- The message ids 12918 - 12919 are reserved for OpenDroneID. -->

At some point some control messages related to network remote id will need to be added and it would make sense to have things in the same place.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good idea

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will add it in the next PR and see what happens. I will also 'claim' ID 12906 to 12914.

@hamishwillee
Copy link
Collaborator

hamishwillee commented Jul 21, 2022

@BluemarkInnovations @friissoren commands encode up to seven parameter values as floats in a COMMAND_LONG or 5 floats and 2 ints in a COMMAND_INT.

They are intended for sending commands - i.e. "do something", with this configuration information. That is not what you are doing, and your information is too large to fit in a command, so my suggestion is incorrect.

However I still might not use the ACK approach for this because it would be wasteful on the link. Consider your example #1865 (comment) - you'll be sent that ACK with every response when you knew after the first time it was supported.

Some other options:

  1. You could invert control. I.e. Transponder B could request the messages it wants/supports using https://mavlink.io/en/messages/common.html#MAV_CMD_REQUEST_MESSAGE to request just one message or https://mavlink.io/en/messages/common.html#MAV_CMD_SET_MESSAGE_INTERVAL to request streaming. Both of these should ACK with https://mavlink.io/en/messages/common.html#MAV_RESULT_DENIED if the requested message is not supported.
  2. Add a query mechanism for discovering or publishing what features or "profiles" are supported. This could be something you trigger with a command "tell me what you support"

Thoughts? I don't want to tell you what particularly to do. It's just the the ACK changes the semantics from "we just sent out what we like" to "we have to understand what you support". That is a very different problem.

@BluemarkInnovations
Copy link
Author

Thanks all for the feedback, very useful. I will go back to the drawing board and propose new message definitions. This will likely be early next week.

@hamishwillee
Copy link
Collaborator

Thanks all for the feedback, very useful. I will go back to the drawing board and propose new message definitions. This will likely be early next week.

Thanks. Note you don't have to propose new messages if you end up working out these are the best compromise. I just want to make sure we do think about this stuff.

message_definitions/v1.0/common.xml Outdated Show resolved Hide resolved
message_definitions/v1.0/common.xml Outdated Show resolved Hide resolved
message_definitions/v1.0/common.xml Outdated Show resolved Hide resolved
@BluemarkInnovations
Copy link
Author

BluemarkInnovations commented Jul 26, 2022

With this new PR, I have updated the definitions. I think it is now a better proposal that makes better use of the existing MAVLink commands and reduces MAVLink communication. I dropped the ACK message definition and added the WLAN channel in the CMD message.

I see two use cases/modes of the remote ID messages:

  • legacy/dumb mode
  • enhanced/intelligent mode

A transponder should support one or both modes.

legacy/dumb mode

This modes uses the existing remote ID message definitions: OPEN_DRONE_ID_BASIC_ID, OPEN_DRONE_ID_LOCATION, OPEN_DRONE_ID_SELF_ID,OPEN_DRONE_ID_SYSTEM and OPEN_DRONE_ID_OPERATOR_ID. It is only one way communication from auto pilot system to the transponder.

The workflow is as follows:

each second:
Auto pilot -> Transponder: OPEN_DRONE_ID_LOCATION

every 10 seconds (or other interval):
Auto pilot -> Transponder: OPEN_DRONE_ID_BASIC_ID
Auto pilot -> Transponder: OPEN_DRONE_ID_SELF_ID
Auto pilot -> Transponder: OPEN_DRONE_ID_SYSTEM
Auto pilot -> Transponder: OPEN_DRONE_ID_OPERATOR_ID
Auto pilot -> Transponder: OPEN_DRONE_ID_AUTHENTICATION

Broadcast settings are defined by the firmware of the transponder.

In current PR for ArduPilot this legacy/dumb mode is implemented.

In this mode also the newly OPEN_DRONE_ID_CMD message can be used, but the auto pilot system has no knowledge if this command is fully accepted by the transponder.

enhanced/intelligent mode

In this mode, the transponder has an active role and will ask the auto pilot system for information, by using the MAV_CMD_REQUEST_MESSAGE / MAV_CMD_SET_MESSAGE_INTERVAL commands.

The workflow is as follows:

startup:

  1. Transponder waits for a Heartbeat signal of the auto pilot system. After the heartbeat is detected, it will send this message:
  2. Transponder -> Auto pilot: MAV_CMD_REQUEST_MESSAGE for Message ID OPEN_DRONE_ID_BASIC_ID.
  3. It will receive from the auto pilot system a OPEN_DRONE_ID_BASIC_ID back.
  4. The transponder will send similar MAV_CMD_REQUEST_MESSAGE messages for OPEN_DRONE_ID_SELF_ID, OPEN_DRONE_ID_SYSTEM, OPEN_DRONE_ID_OPERATOR_ID and OPEN_DRONE_ID_AUTHENTICATION. The transponder will receive those messages from the auto pilot system.
  5. The transponder will send MAV_CMD_SET_MESSAGE_INTERVAL for message OPEN_DRONE_ID_LOCATION. And the auto pilot system will respond with a stream of OPEN_DRONE_ID_LOCATION at the required interval. This interval can be much smaller as 1 second, in case the broadcast interval is also set to values below 1 second.
  6. The transponder will also send a MAV_CMD_REQUEST_MESSAGE messages for OPEN_DRONE_ID_CMD message. Here, the Req Param 2 is defined as MAV_ODID_BROADCAST_MODE. Basically it signals the capabilities of the transponder. Req Param 3, the minimum allowed broadcast interval in ms and Req Param 4, WLAN radio information. Do I need to add an ENUM type for this? 1 = single radio, 2 = dual radio (two independent WLAN interfaces), 3 = dual radio (one 2.4 GHz, one for 5 GHz). Req Param 5 defines the allowed WLAN channels. Do I need to add an ENUM type for this? 1 = capable of 2.4 GHz broadcasting, 2 = capable of 5 GHz lower band broadcasting, 3 = capable of 5 GHz higher band broadcasting, 4 supports 2.4 GHz and 5 GHz lower band, 5 supports 2.4 GHz and 5 GHz higher band, 6 supports 5 GHz lower band and 5 GHz higher band, 7 supports 2.4 GHz, 5 GHz lower band and 5 GHz higher band. The auto pilot system returns with a OPEN_DRONE_ID_CMD message. (And will send additional OPEN_DRONE_ID_CMD messages, if it wants to change the broadcast mode.)

Note 1: In case the transponder restarts, temporarily power loss etc, it will request this information again (start at point 1).
Note 2: In case there are multiple Basic IDs, the transponder can use the MAV_CMD_REQUEST_MESSAGE for message OPEN_DRONE_ID_BASIC_ID where Req Param 2 is set to the Basic ID index: 0 for the first Basic ID, 1, for the second Basic ID, etc. (As I understand from the information, Req Param 1 can't be used.) Of course, the auto pilot can also send all Basic ID messages once it receives such a request message.
Note 3: In case there are multiple Auth messages, the auto pilot system will send all those messages after receiving a MAV_CMD_REQUEST_MESSAGE for OPEN_DRONE_ID_AUTHENTICATION message.
Note 4: In case the auto pilot system does not return request messages, the transponder will keep, say every 10 seconds, send request messages and it will use the legacy/dumb mode as fall back option.
Note 5: Compatibility issues, in the first PR the ACK message was defined to cope with compatibility issues (new message definitions). The MAV_CMD_REQUEST_MESSAGE / MAV_CMD_SET_MESSAGE_INTERVAL message will result in a similar behavior while reducing the number of MAVLink messages. The legacy/dumb mode will use the existing message only. For support of future message definitions, the transponder should switch to the enhanced/intelligent mode.

@BluemarkInnovations
Copy link
Author

In the above explanation comment, I changed transmit to broadcast. Also I redefined point 6: original it was Req Param 4 was the maximum allowed broadcast (transmission) protocol. In real life this is limited already by the standard to maximum of 3000 ms. So it is not useful. It is replaced by sending information about the WLAN radio capabilities (together with Req Param 5) of the transponder. This was needed as I allowed a primary and secondary WLAN channel for broadcasting.

@hamishwillee
Copy link
Collaborator

@BluemarkInnovations As I said before there are many ways to do this. I think this direction is pretty good, but others might want to consider others. Here are my comments:

To paraphrase the enhanced proposal (please confirm, to test my understanding), the transponder drives the interactions rather than the autopilot just emitting what it supports:

  • The transponder uses MAV_CMD_REQUEST_MESSAGE to request the messages it only needs once: OPEN_DRONE_ID_BASIC_ID, OPEN_DRONE_ID_SELF_ID, OPEN_DRONE_ID_SYSTEM, OPEN_DRONE_ID_OPERATOR_ID, OPEN_DRONE_ID_AUTHENTICATION.
  • The transponder use MAV_CMD_SET_MESSAGE_INTERVAL to get messages it needs to be streamed: OPEN_DRONE_ID_LOCATION.
  • The transponder uses MAV_CMD_REQUEST_MESSAGE to request OPEN_DRONE_ID_BROADCAST_CONTROL from the autopilot. This contains the settings that the autopilot wants the transponder to use.
    • It isn't stated, but my assumption is that the autopilot should also emit this if it wants to change the setting.
      If you don't allow this then there is no way for the autopilot to dynamically update the settings.
  • Transponder requests what it needs on restart.

Some questions / notes.

  1. Is that about right?
  2. You refer to OPEN_DRONE_ID_CMD message but that is not in the PR. I assume you mean OPEN_DRONE_ID_BROADCAST_CONTROL?
  3. The approach for requesting the messages you want sent once and streamed is good (points 1 and 2).
    • Note, that if an "enhanced" transponder is connected to the autopilot that is emitting the legacy messages at legacy rates the transponder can still send MAV_CMD_SET_MESSAGE_INTERVAL to stop streaming the one-off messages and control the rate of the streamed message.
    • On that note, how will the autopilot know whether to use enhanced or legacy approach? Is the idea that the autopilot will always start with legacy and the transponder will tune the rates if it wants, or is it that we'll migrate to the new approach?
  4. OPEN_DRONE_ID_BROADCAST_CONTROL approach (point 3) is good if the data is set and stored by the autopilot. I presume this is the case?
  5. On use of MAV_CMD_REQUEST_MESSAGE
    • The command, like all commands causes the autopilot to emit an ACK. IF that ACK is MAV_RESULT_ACCEPTED the message you requested will also be emitted.
      I think you know this, but just for your workflow clarifying the interaction.
    • the param1 is intended for an index, and if you have an index it should be in param1. But you can use it (or any param) for anything you like. The point though is that if you a param for something it's meaning must be defined in the message to be emitted so that user know what they are for. If you use param 1 for an index and the message has an index you don't need to particularly say anything in the message because use of index for param 1 will be assumed.
    • ArduPilot does not AFAIK implement param number > 1 because the first version of the request message only supported an index. If you need more than two params per mission you will need to talk to @peterbarker
    • You will need to check that the autopilot knows to handle MAV_CMD_REQUEST_MESSAGE for your messages. By default they may just send back an ACK of MAV_RESULT_DENIED to indicate the particular message is not supported for requesting.

Now to your questions.

Do I need to add an ENUM type for this? 1 = single radio, 2 = dual radio ...

The TLDR; answer is "for all cases it is highly recommended"

Essentially we use enums to maintain compatibility forever. If there is any possibility of the values on the ends of those links changing then you really have to have enums. It is also more clear for users since the enums are cross-linked.

The cases where I'd say people don't need to is when there are only one or 2 possible values.

Re the notes "where I have something to say"

Note 2: In case there are multiple Basic IDs, the transponder can use the MAV_CMD_REQUEST_MESSAGE for message OPEN_DRONE_ID_BASIC_ID where Req Param 2 is set to the Basic ID index: 0 for the first Basic ID, 1, for the second Basic ID, etc. (As I understand from the information, Req Param 1 can't be used.) Of course, the auto pilot can also send all Basic ID messages once it receives such a request message.

This is the case where you would use param 1 for the basic ID that you want. "index ID" here can mean "instance id". I think we meant instance when we wrote this.

If it were me I would specify in your OPEN_DRONE_ID_BASIC_ID that an instance/index value of 0 means "send all", and use 1, 2, 3 for specific cases.

Note 3: In case there are multiple Auth messages, the auto pilot system will send all those messages after receiving a MAV_CMD_REQUEST_MESSAGE for OPEN_DRONE_ID_AUTHENTICATION message.

That's cool. If the authentication messages have instances you can use the same approach as in my comment above - 0 for all, or id for specific instance. This is quite flexible because it means you can choose to re-request an intermediate instance if you note one is missing.

Note 4: In case the auto pilot system does not return request messages, the transponder will keep, say every 10 seconds, send request messages and it will use the legacy/dumb mode as fall back option.

This is not needed. You will get an ACK back with MAV_RESULT_DENIED if the particular message you want to emit is not supported.

I'm not sure what you mean by use the legacy/dumb option. The legacy option is managed by the autopilot - it just sends everything at whatever rate it wants. As in one of the notes above, we need to decide what we do in that case.

Note 5: Compatibility issues, in the first PR the ACK message was defined to cope with compatibility issues (new message definitions). The MAV_CMD_REQUEST_MESSAGE / MAV_CMD_SET_MESSAGE_INTERVAL message will result in a similar behavior while reducing the number of MAVLink messages. The legacy/dumb mode will use the existing message only. For support of future message definitions, the transponder should switch to the enhanced/intelligent mode.

We should refer to this as OpenID protocol v2 and define what happens if the different protocol versions for transponder/autopilot are used with each other.

For example, current ArduPilot version will presumably always be emitting the legacy messages because it only supports v1 (though maybe you have some param to tell it that a transponder is connected?). Anyway, if this autopilot version is connected to a v1 transponder nothing changes. If it is connected to a v2 transponder we might say "the transponder should set the rates of the autopilot appropriately usiing the request and interval messages".
And so on ...

Sorry, if I am belaboring the point - trying to be exhaustive responding to your points.

@BluemarkInnovations
Copy link
Author

BluemarkInnovations commented Aug 3, 2022

@hamishwillee I had yesterday a meeting with @friissoren to discuss this proposal and made some changes. The reasons were that some scenarios were missing, but also that it will likely not be supported by ArduPilot and other systems that use MAVLink. (Because you cannot include parameters to the MAV_CMD_REQUEST_MESSAGE except for the message ID. ) So, the new proposal (57f3b90) is both supported by Søren and myself (Roel). I will make a new description below this comment.

  • The transponder uses MAV_CMD_REQUEST_MESSAGE to request the messages it only needs once: OPEN_DRONE_ID_BASIC_ID, OPEN_DRONE_ID_SELF_ID, OPEN_DRONE_ID_SYSTEM, OPEN_DRONE_ID_OPERATOR_ID, OPEN_DRONE_ID_AUTHENTICATION.

  • The transponder use MAV_CMD_SET_MESSAGE_INTERVAL to get messages it needs to be streamed: OPEN_DRONE_ID_LOCATION.

  • The transponder uses MAV_CMD_REQUEST_MESSAGE to request OPEN_DRONE_ID_BROADCAST_CONTROL from the autopilot. This contains the settings that the autopilot wants the transponder to use.

    • It isn't stated, but my assumption is that the autopilot should also emit this if it wants to change the setting.
      If you don't allow this then there is no way for the autopilot to dynamically update the settings.
  • Transponder requests what it needs on restart.

Some questions / notes.

  1. Is that about right?

Yes.

  1. You refer to OPEN_DRONE_ID_CMD message but that is not in the PR. I assume you mean OPEN_DRONE_ID_BROADCAST_CONTROL?

In an updated PR this message was changed to OPEN_DRONE_ID_BROADCAST_CONTROL.

  1. The approach for requesting the messages you want sent once and streamed is good (points 1 and 2).

    • Note, that if an "enhanced" transponder is connected to the autopilot that is emitting the legacy messages at legacy rates the transponder can still send MAV_CMD_SET_MESSAGE_INTERVAL to stop streaming the one-off messages and control the rate of the streamed message.

Thanks, I will include that in the new description!

  • On that note, how will the autopilot know whether to use enhanced or legacy approach? Is the idea that the autopilot will always start with legacy and the transponder will tune the rates if it wants, or is it that we'll migrate to the new approach?

Good point. To my knowledge there are no implementations yet of the legacy approach. (Except for the BlueMark MAVLink transponder.) In the end you want to migrate to the new approach to unlock all features. However, the legacy approach may be sufficient in some scenarios. Let me describe first in the new comment how the newest approach looks like. Then we could decide how to handle it. For now, myy suggestion would be to keep both approaches supported.

  1. OPEN_DRONE_ID_BROADCAST_CONTROL approach (point 3) is good if the data is set and stored by the autopilot. I presume this is the case?

Yes, the transponder is a dumb device and does not store data.

  1. On use of MAV_CMD_REQUEST_MESSAGE

    • The command, like all commands causes the autopilot to emit an ACK. IF that ACK is MAV_RESULT_ACCEPTED the message you requested will also be emitted.
      I think you know this, but just for your workflow clarifying the interaction.
    • the param1 is intended for an index, and if you have an index it should be in param1. But you can use it (or any param) for anything you like. The point though is that if you a param for something it's meaning must be defined in the message to be emitted so that user know what they are for. If you use param 1 for an index and the message has an index you don't need to particularly say anything in the message because use of index for param 1 will be assumed.
    • ArduPilot does not AFAIK implement param number > 1 because the first version of the request message only supported an index. If you need more than two params per mission you will need to talk to @peterbarker

Your idea about param1 is wrong. I looked it up in the ArduPilot source code, param1 is the message ID. And other parameters (like param2) are not supported. This is one of the reasons for a new approach.

The MAV_CMD_REQUEST_MESSAGE implementation in AruPilot can be found here. The function handle_command_request_message is called when such a packet arrives.
https://github.com/ArduPilot/ardupilot/blob/master/libraries/GCS_MAVLink/GCS_Common.cpp?plain=1#L2706-L2715

In this function only the message id is decoded (param1).

  • You will need to check that the autopilot knows to handle MAV_CMD_REQUEST_MESSAGE for your messages. By default they may just send back an ACK of MAV_RESULT_DENIED to indicate the particular message is not supported for requesting.

Good point.

Now to your questions.

Do I need to add an ENUM type for this? 1 = single radio, 2 = dual radio ...

The TLDR; answer is "for all cases it is highly recommended"

Essentially we use enums to maintain compatibility forever. If there is any possibility of the values on the ends of those links changing then you really have to have enums. It is also more clear for users since the enums are cross-linked.

The cases where I'd say people don't need to is when there are only one or 2 possible values.

In the updated PR there are ENUMs.

Re the notes "where I have something to say"

Note 2: In case there are multiple Basic IDs, the transponder can use the MAV_CMD_REQUEST_MESSAGE for message OPEN_DRONE_ID_BASIC_ID where Req Param 2 is set to the Basic ID index: 0 for the first Basic ID, 1, for the second Basic ID, etc. (As I understand from the information, Req Param 1 can't be used.) Of course, the auto pilot can also send all Basic ID messages once it receives such a request message.

This is the case where you would use param 1 for the basic ID that you want. "index ID" here can mean "instance id". I think we meant instance when we wrote this.

This approach won't work as param1 is the message ID (see above).

If it were me I would specify in your OPEN_DRONE_ID_BASIC_ID that an instance/index value of 0 means "send all", and use 1, 2, 3 for specific cases.

Note 3: In case there are multiple Auth messages, the auto pilot system will send all those messages after receiving a MAV_CMD_REQUEST_MESSAGE for OPEN_DRONE_ID_AUTHENTICATION message.

That's cool. If the authentication messages have instances you can use the same approach as in my comment above - 0 for all, or id for specific instance. This is quite flexible because it means you can choose to re-request an intermediate instance if you note one is missing.

This approach won't work as param1 is the message ID (see above).

Note 4: In case the auto pilot system does not return request messages, the transponder will keep, say every 10 seconds, send request messages and it will use the legacy/dumb mode as fall back option.

This is not needed. You will get an ACK back with MAV_RESULT_DENIED if the particular message you want to emit is not supported.

Okay, good point.

I'm not sure what you mean by use the legacy/dumb option. The legacy option is managed by the autopilot - it just sends everything at whatever rate it wants. As in one of the notes above, we need to decide what we do in that case.

Hopefully in the new description I cover this sufficiently.

Note 5: Compatibility issues, in the first PR the ACK message was defined to cope with compatibility issues (new message definitions). The MAV_CMD_REQUEST_MESSAGE / MAV_CMD_SET_MESSAGE_INTERVAL message will result in a similar behavior while reducing the number of MAVLink messages. The legacy/dumb mode will use the existing message only. For support of future message definitions, the transponder should switch to the enhanced/intelligent mode.

We should refer to this as OpenID protocol v2 and define what happens if the different protocol versions for transponder/autopilot are used with each other.

Okay.

For example, current ArduPilot version will presumably always be emitting the legacy messages because it only supports v1 (though maybe you have some param to tell it that a transponder is connected?). Anyway, if this autopilot version is connected to a v1 transponder nothing changes. If it is connected to a v2 transponder we might say "the transponder should set the rates of the autopilot appropriately usiing the request and interval messages". And so on ...

Sorry, if I am belaboring the point - trying to be exhaustive responding to your points.

Thanks for you long response, it will get the PR better!

@BluemarkInnovations
Copy link
Author

BluemarkInnovations commented Aug 3, 2022

The most important changes in the newest PR (57f3b90) are:

  • added ENUMS: MAV_ODID_RADIO_MODE, MAV_ODID_RADIO_CONTROL, MAV_ODID_RADIO_FUNCTION, MAV_ODID_RADIO_TYPES, MAV_ODID_RADIO_WIFI_SUPPORTED_FREQUENCY_BANDS and MAV_ODID_MESSAGES_SUPPORTED
  • rename wlan to wifi
  • use the word radio instead of broadcast in number of cases.
  • changed the OPEN_DRONE_ID_BROADCAST_CONTROL message to OPEN_DRONE_ID_RADIO_CONTROL
  • added also fields for receiving OpenDroneID in the OPEN_DRONE_ID_RADIO_CONTROL message.
  • added a message OPEN_DRONE_ID_BROADCAST_CAPABILITIES that can be used by an OpenDroneID device to signal its capabilities.
  • changed the word transponder to transmitter.

@friissoren
Copy link
Contributor

@BluemarkInnovations : In your most recent commit, you have somehow managed to modify every single line in common.xml. When I source compare the two versions, I don't see any differences in most of the lines though. I think what might have happened is that you have added/removed some CR/LF characters at the end of each line.

Could you please try to fix this so only the lines that actually needs to be changed/added are included in the commit?

@BluemarkInnovations
Copy link
Author

BluemarkInnovations commented Aug 3, 2022

There are two cases/modes how remote ID messages can be exchanged between MAVLink devices, such as an auto pilot system and a remote ID transmitter.

Note, in case of a remote ID transmitter, it is assumed that it a dumb device. It does not store any data, but receives everything from the auto pilot system. (There is one exception, the transmitter may store a unique serial number and send a separate Basic ID message with this number.)

These cases are:

  • remote ID v1 (use the existing remote ID implementation/definitions, 1-way communication)
  • remote ID v2 (use a capabilities message to discover the remote ID capabilities of a device and have a control message to control the radio transmission/reception.)

The reason for a capabilities message is that a remote ID device can:

  • have different roles (transmitter, receiver or both)
  • support different radio technologies (Bluetooth legacy, Bluetooth Long Range, WiFi Beacon, WiFi NaN)
  • support different WiFi frequency bands (2.4 GHz, 5 GHz or both).
  • have multiple WiFi radios to allow transmitting remote ID signals on both the 2.4 and 5 GHz.

If for instance the auto pilot system wants to control the radio transmission, it needs to have the above information.

Each remote ID system (auto pilot, transmitter, receiver) should support at least remote ID v1. There, are however enough incentives to support (part of) remote ID v2 too.

remote ID v1

transmitter
This modes uses the existing remote ID message definitions: OPEN_DRONE_ID_BASIC_ID, OPEN_DRONE_ID_LOCATION, OPEN_DRONE_ID_SELF_ID,OPEN_DRONE_ID_SYSTEM and OPEN_DRONE_ID_OPERATOR_ID. It is only one way communication from auto pilot system to the transmitter.

The workflow is as follows:

each second:
Auto pilot -> Transmitter: OPEN_DRONE_ID_LOCATION

every 10 seconds (or other interval):
Auto pilot -> Transmitter: OPEN_DRONE_ID_BASIC_ID
Auto pilot -> Transmitter: OPEN_DRONE_ID_SELF_ID
Auto pilot -> Transmitter: OPEN_DRONE_ID_SYSTEM
Auto pilot -> Transmitter: OPEN_DRONE_ID_OPERATOR_ID
Auto pilot -> Transmitter: OPEN_DRONE_ID_AUTHENTICATION

Optionally a transmitter can use the MAV_CMD_SET_MESSAGE_INTERVAL message to request a different interval for the
OPEN_DRONE_ID_LOCATION message. It will receive a MAV_CMD_ACK message back to know if this request is granted.

Transmitter settings (mode, interval etc) are defined by the firmware of the transmitter.

In current ArduPilot PR this remote ID v1 mode is implemented.

In this remote ID v1 mode, also the newly OPEN_DRONE_ID_RADIO_CONTROL message from v2 can be used, but the auto pilot system has no knowledge if this message is accepted by the transmitter. This may be solved by the transmitter by sending a MAV_CMD_REQUEST_MESSAGE for the OPEN_DRONE_ID_RADIO_CONTROL message once the MAVLink is up. In this case the auto pilot system knows the transmitter supports this message. In this radio control message, the auto pilot could set the following fields:

  • transmit_control to MAV_ODID_RADIO_CONTROL_START (or other command)
  • receive_control to MAV_ODID_RADIO_CONTROL_NO_CHANGE
  • transmit_mode to MAV_ODID_RADIO_MODE_NO_CHANGE (It does not know what the capabilities are of the transmitter, so it leaves it to the transmitter to choose the mode. For instance configured in the firmware.)
  • receive_mode to MAV_ODID_RADIO_MODE_NO_CHANGE
  • transmission_period_ms to a value with in the valid range e.g. 1000 (1 second)
  • transmission_wifi_2_4ghz to 255 (This value means it is configured by the transmitter itself.)
  • transmission_wifi_5ghz to 255 (This value means it is configured by the transmitter itself.)

receiver
This modes uses the existing remote ID message definitions: OPEN_DRONE_ID_BASIC_ID, OPEN_DRONE_ID_LOCATION, OPEN_DRONE_ID_SELF_ID,OPEN_DRONE_ID_SYSTEM and OPEN_DRONE_ID_OPERATOR_ID. It is only one way communication from receiver to auto pilot system.

The workflow is as follows:

Every time the receiver receives a remote ID signal, it will send a MAVLink message to the auto pilot. If the remote ID signal includes multiple packets, it will send for each information block (operator ID, system, self ID, location, authentication) a separate MAVLink message.

Receiver -> Auto pilot: remote ID MAVLink message.

In this remote ID v1 mode, also the newly OPEN_DRONE_ID_RADIO_CONTROL message from v2 can be used, but the auto pilot system has no knowledge if this message is accepted by the receiver. This may be solved by the receiver by sending a MAV_CMD_REQUEST_MESSAGE for the OPEN_DRONE_ID_RADIO_CONTROL message once the MAVLink is up. In this case the auto pilot system knows the receiver supports this message. In this radio control message, the auto pilot system could set the following fields:

  • transmit_control to MAV_ODID_RADIO_CONTROL_NO_CHANGE
  • receive_control to MAV_ODID_RADIO_CONTROL_START (or other command)
  • transmit_mode to MAV_ODID_RADIO_MODE_NO_CHANGE
  • receive_mode to MAV_ODID_RADIO_MODE_NO_CHANGE (It does not know what the capabilities are of the receiver, so it leaves it to the receiver to choose the mode. For instance configured in the firmware.)
  • transmission_period_ms to a value with in the valid range e.g. 1000 (1 second). It is not used by the receiver.
  • transmission_wifi_2_4ghz to 0 (This value means transmission disabled.) The receiver will decide by itself how to receive remote ID signals and on which channels.
  • transmission_wifi_5ghz to 0 (This value means transmission disabled.) It is not used by the receiver. The receiver will decide by itself how to receive remote ID signals and on which channels.

transceiver
This is the combination of the case transmitter and receiver messages that are described above.

The remote ID v2 description will be in a new comment.

@BluemarkInnovations
Copy link
Author

@BluemarkInnovations : In your most recent commit, you have somehow managed to modify every single line in common.xml. When I source compare the two versions, I don't see any differences in most of the lines though. I think what might have happened is that you have added/removed some CR/LF characters at the end of each line.

Could you please try to fix this so only the lines that actually needs to be changed/added are included in the commit?

Should be fixed in 57f3b90.

@BluemarkInnovations
Copy link
Author

remote ID v2

In this v2 approach, the OpenDroneID device will send MAV_CMD_REQUEST_MESSAGE once the MAVLink is up (heartbeat messages are received) for the OpenDroneID messages it supports. Also, it will send a OPEN_DRONE_ID_BROADCAST_CAPABILITIES message to signal its capabilities. In addition, a OPEN_DRONE_ID_RADIO_CONTROL has been defined to control the radio state (e.g. start or stop transmitting remote ID signals).

If the auto pilot system does not receive MAV_CMD_REQUEST_MESSAGE messages, it will assume the OpenDroneID device only supports v1. The v2 approach will lower the number of messages send over MAVLink, which is especially useful for CAN bus links where multiple devices share the same bus.

transmitter
In this mode, the transmitter has an active role and will ask the auto pilot system for information, by using the MAV_CMD_REQUEST_MESSAGE / MAV_CMD_SET_MESSAGE_INTERVAL commands.

The workflow is as follows:

  • Transmitter waits for a Heartbeat signal of the auto pilot system. After the heartbeat is detected, it will send this message:
  • Transmitter -> Auto pilot: MAV_CMD_REQUEST_MESSAGE for Message ID OPEN_DRONE_ID_BASIC_ID. It will receive from the auto pilot system MAV_CMD_ACK message back. If the value is MAV_CMD_ACK_OK, it will receive from the auto pilot system a OPEN_DRONE_ID_BASIC_ID back. Otherwise (in v1), it needs to wait until a OPEN_DRONE_ID_BASIC_ID message is sent. In case of multiple basic IDs, the auto pilot system will send all basic IDs after such request; for every ID a separate OPEN_DRONE_ID_BASIC_ID message. If the MAV_CMD_REQUEST_MESSAGE is accepted by the auto pilot system, the auto pilot system does not need to send every 10 seconds the OPEN_DRONE_ID_BASIC_ID messages anymore (v1). If the transmitter would have power loss or reboots, it will send a new MAV_CMD_REQUEST_MESSAGE.
  • The transmitter will send similar MAV_CMD_REQUEST_MESSAGE messages for OPEN_DRONE_ID_SELF_ID, OPEN_DRONE_ID_SYSTEM, OPEN_DRONE_ID_OPERATOR_ID and OPEN_DRONE_ID_AUTHENTICATION. The transmitter will receive those messages from the auto pilot system or in v1 have to wait until those message are sent. In case of multiple authentication pages, the auto pilot system will send all authentication pages after such request; for every page a separate OPEN_DRONE_ID_AUTHENTICATION message. If the MAV_CMD_REQUEST_MESSAGE is accepted by the auto pilot system, the auto pilot system does not need to send every 10 seconds the OPEN_DRONE_ID_BASIC_ID messages anymore (v1). If the transmitter would have power loss or reboots, it will send new MAV_CMD_REQUEST_MESSAGE for these message types.
  • The transmitter will send MAV_CMD_SET_MESSAGE_INTERVAL for message OPEN_DRONE_ID_LOCATION. And the auto pilot system will respond with a stream of OPEN_DRONE_ID_LOCATION at the required interval. This interval can be much smaller as 1 second, in case the broadcast interval is also set to values below 1 second. (Here it will receive from the auto pilot system also MAV_CMD_ACK response back for the MAV_CMD_SET_MESSAGE_INTERVAL message. If the value is not equal MAV_CMD_ACK_OK, the interval won't be changed.)
  • Transmitter -> Auto pilot: MAV_CMD_REQUEST_MESSAGE for the (newly defined) Message ID OPEN_DRONE_ID_RADIO_CONTROL. It will receive from the auto pilot system MAV_CMD_ACK message back. If the value is MAV_CMD_ACK_OK, it will receive from the auto pilot system a OPEN_DRONE_ID_RADIO_CONTROL back. Both the transmitter and auto pilot system knows in this case v2 is supported. If MAV_CMD_ACK_ERR_NOT_SUPPORTED is received back, the transmitter knows the auto pilot system does not support this command. In this case, it will use default transmitter settings (as defined in firmware) and will transmit/broadcast signals once OpenDroneID messages are received from the auto pilot system. If the auto pilot system does support the OPEN_DRONE_ID_RADIO_CONTROL, message, it can use a no change payload i.e. set fields to MAV_ODID_RADIO_CONTROL_NO_CHANGE and MAV_ODID_RADIO_MODE_NO_CHANGE. Once the UAV takes off, it could set the transmit_control to MAV_ODID_RADIO_CONTROL_START (by sending a new OPEN_DRONE_ID_RADIO_CONTROL message). So typically the initial v2 state of a transmitter would be to have radio transmission disabled/off.
  • The transmitter would also send a OPEN_DRONE_ID_BROADCAST_CAPABILITIES message, once the MAVLink is up. Here it signals to the auto system which capabilities it has. The radio_wifi_count field defines how much WiFi radio there are. Typically it can be 0 (none), 1 or 2. In case of 2, the transmitter allows transmission both in the 2.4 and 5 GHz. Based on this capabilities message, the auto pilot system knows how to set the fields in the OPEN_DRONE_ID_RADIO_CONTROL message. If the capabilities message is not supported by the auto pilot system, the auto pilot system would send a OPEN_DRONE_ID_RADIO_CONTROL message as defined in the remote ID v1 case. This means set field transmit_mode to MAV_ODID_RADIO_MODE_NO_CHANGE and transmission_wifi_2_4ghz / transmission_wifi_5ghz to 255. If the auto pilot system does not support the radio control message (the transmitter will send a MAV_CMD_REQUEST_MESSAGE for this message type), the transmitter will fall back to v1 behavior.

receiver
This is very similar to the receiver case described in remote ID v1. Here the OPEN_DRONE_ID_BROADCAST_CAPABILITIES is sent by the receiver once the MAVLink is up. It allows the auto pilot system to set the OPEN_DRONE_ID_RADIO_CONTROL. Default state would be that the receiver receives OpenDroneID messages and sends MAVLink messages, unless it is switched off.

So remote ID v2 means for a receiver that the auto pilot system and receiver support the OPEN_DRONE_ID_BROADCAST_CAPABILITIES and OPEN_DRONE_ID_RADIO_CONTROL message. In case one the devices does not support v2, communication falls back to v1.

transceiver
This is the combination of the case transmitter and receiver messages are described above.

@optical-o
Copy link

optical-o commented Aug 3, 2022

Hello,
i was asked by @lukasbrchl to contribute to this discussion on behalf of @dronetag. I'm the lead firmware/hardware engineer there and I'm in charge of integrating MAVLink support into our products. We are currently actively working on devices broadcasting mostly BT Legacy and BT 5 Long range. Currently, there is not support for any of the modes of operation using the OpenDroneID system from the MAVLink Controllers.

Our current approach

So our current approach to support MAVLink Controllers is to interface with the controller and read the Telemetry data available from the controller actively(Subscribing to interval MAVLink messages such as MAVLINK_MSG_ID_SCALED_PRESSURE, MAVLINK_MSG_ID_GPS_RAW_INT, MAVLINK_MSG_ID_GLOBAL_POSITION_INTMAVLINK_MSG_ID_SCALED_PRESSURE, MAVLINK_MSG_ID_HEARTBEAT) to retrieve required information from the drone to translate them into ODID messages(location, height, drone state). This solution is not ideal, however, it is the easiest for us because other ODID fields(odid_operator, odid_class, odid_category, etc...) are supplied to our devices using our Mobile application.
Our current devices always have the option to use an internal sensor to get the information required and the MAVLink in our software is only used as an alternative source.

  • Note that using this implementation we came up with an issue integrating with PIXHawk and Ardupilot when retrieving time information from MAVLINK_MSG_ID_GPS_RAW_INT, MAVLINK_MSG_ID_GLOBAL_POSITION_INT being relative to system start instead of UTC information inside the MAVLink documentation. Which needs to be detected and synchronized with external time to produce the timestamp required by the ODID. Which is not ideal. The timestamp should be always tied to the Telemetry information to prevent synchronization issues.

This is by no means an ideal approach to this problem, however, it is for now the easiest to implement(And probably not even the correct given the nature of some messages used by us). I wanted to add this approach to the mix as it was not mentioned here. And for devices, which have the option to work in the stand-alone mode with separate applications and other features this might be the preferred way of doing things. There might be an option to replace the messages for the ODID ones, which would lead to a prettier implementation.

Future development

We are looking into implementing the "remote ID v1 or the next one" solution. We are looking from the point of mandatory ODID transmission and that all of the ODID information are provided by the Flight controller itself.

I have a few remarks on this from the developer if tranciever point of view. The messages should be sent only when a change in the data occurs, which can be driven by the interval or by the data itself. The transmitter is trying to send always the newest data possible. The only live message in the ODID protocol is the OPEN_DRONE_ID_LOCATION. Other messages usually do not change. This all should be done easily with the current implementation of MAV_CMD_REQUEST_MESSAGE, MAV_CMD_SET_MESSAGE_INTERVAL as @hamishwillee said.

  • Note there is the OPEN_DRONE_ID_MESSAGE_PACK that should not be used by the flight controller to communicate with the transmitter. Should be used only for receiving ODID messages, because the transmitter whould have to know, which messages will be inside the pack provided by the flight controller and would only complicate things. The packing of the ODID message should handle the transmitter base on a configuration in OPEN_DRONE_ID_RADIO_CONTROL this is only valid for BT5 Extended advertisement.

The easiest way to change the implementation is by the transmitter to retrieve on startup/MAVLink connection or parse then on change. For proper integration of the receiver into the system should report using the HEARTBEAT message and prevent the system from operating until it has all necessary information(either they are polled or received by interval sending) for correct ODID operation.

To add something to progress the implementation discussion indeed there should be some OPEN_DRONE_ID_RADIO_CONTROL message I can see usage for disabling and enabling the transmission mode. Keep in mind that the ODID specification defines aircraft state for Landed so the device should broadcast its position even in landed/standby mode before flight. I would prefer that this field would be also polled at startup or actively sent by the controller when change occurs as a broadcast.

Backward compatibility would be assured by receiving the MAV_CMD_ACK_ERR_NOT_SUPPORTED and reverting to the default configuration for the OPEN_DRONE_ID_RADIO_CONTROL. By this, I think that the term 'remote ID v2' is a little bit ambiguous. Due to the simple extension of the ODID support with OPEN_DRONE_ID_RADIO_CONTROL

TLDR: Current implementation of ODID messages should be extended for the OPEN_DRONE_ID_RADIO_CONTROL and added configuration for message packs for the transmitter. Omit support OPEN_DRONE_ID_MESSAGE_PACK for the Flight controller - > transmitter communication in the documentation. Basically transmitter polls and sets intervals for all required messages by itself and parses any active messages OPEN_DRONE_ID_* from the controller to detect changes done by the flight controller.

OPEN_DRONE_ID_BROADCAST_CAPABILITIES is nice to have(for diagnosis), but I don't see that the flight controller would adjust its functionality by receiving this field. Most of the systems are statically configured beforehand.

As for the receiver we don't have any major remarks on that. It should poll the OPEN_DRONE_ID_RADIO_CONTROL report the OPEN_DRONE_ID_BROADCAST_CAPABILITIES and forward any ODID messages it receives to the MAVLink bus.

@hamishwillee
Copy link
Collaborator

@BluemarkInnovations Thanks for clarification about MAV_CMD_REQUEST_MESSAGE support in ArduPilot. I haven't read the rest of this yet, but you might want to talk to @peterbarker about getting the support updated to match the current spec so you could choose to use this.

I'll look at the new proposal now.

@@ -4595,7 +4695,7 @@
</description>
</entry>
<entry value="2" name="NAV_VTOL_LAND_OPTIONS_HOVER_DESCENT">
<description>Land in multicopter mode on reaching the landing co-ordinates (the whole landing is by "hover descent").</description>
<description>Land in multicopter mode on reaching the landing coordinates (the whole landing is by "hover descent").</description>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI These typo fixes are all great, but should have gone in a separate PR. OK here now.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not so familiar with git. So I forgot to rebase the code prior to pushing this PR. Hence,changes from other PRs got included as well. Hopefully, it is solved now with the latest commits. If not, please let me know.

@hamishwillee
Copy link
Collaborator

@BluemarkInnovations Thanks very much. I quite like the symmetry of the design. FYI only V2 description might be easier to parse if it was written as though v1 did not exist.

I think it looks like this (you can click the image to be taken to an editor for this).

So essentially most of this is pretty simple in v2:

  1. All static data is requested by the transponder on restart/first detection of heartbeat: OPEN_DRONE_ID_BASIC_ID, OPEN_DRONE_ID_SELF_ID, OPEN_DRONE_ID_SYSTEM, OPEN_DRONE_ID_OPERATOR_ID and OPEN_DRONE_ID_AUTHENTICATION.
  2. Dynamic data is streamed - requested by transponder for OPEN_DRONE_ID_LOCATION using MAV_CMD_SET_MESSAGE_INTERVAL
  3. Transponder sends capabilities to autopilot in OPEN_DRONE_ID_BROADCAST_CAPABILITIES
  4. Transponder requests radio control information in OPEN_DRONE_ID_RADIO_CONTROL using MAV_CMD_REQUEST_MESSAGE
  5. Autopilot might send OPEN_DRONE_ID_RADIO_CONTROL at any other time if the user changes settings (right?)

My concerns:

  1. OPEN_DRONE_ID_BROADCAST_CAPABILITIES is sent to autopilot to say what it supports. OPEN_DRONE_ID_RADIO_CONTROL is then requested from autopilot its content is formatted based on what is supported.
  • The OPEN_DRONE_ID_BROADCAST_CAPABILITIES appears to be sent only once? What if it is not received?
  • The docs are a little unclear too on the sequence - later on it looks like the capabilities might be send after the radio control.
What I might consider here is changing OPEN_DRONE_ID_BROADCAST_CAPABILITIES  into a command. It would fit - though could not be extended with new fields). This would be the first thing sent by the transponder. The response would be an ACK so you would know it had been received and you would also know that the autopilot supported v2 API.
  1. If the settings change OPEN_DRONE_ID_RADIO_CONTROL should be transmitted by autopilot. Might be missed by transmitter and there is no way of knowing. Some common patterns if this is a concern:

    • poll by transponder
    • stream by autopilot
    • autopilot sends command - "updated" forcing transponder to re-request the data. That's a lot of acks but ultimately less bandwidth.
  2. How you handle v1/v2 switchover depends on how the flight stack is setup. How does it know that it has an ODID transponder connected in order to start streaming? Is that based on heartbeat and MAV_TYPE_ODID being set by the component? Or is it configured using a parameter, or some other way?

    FWIW

    • We can add a protocol bit if we like to indicate which versions of ODID are supported by an autopilot
    • A v1 only transponder can't do anything itself, so either the autopilot has to be set up to always stream, or understand that it is connected to a v1 transponder and stream when requested
    • A v2 transponder can obviously set streaming rates appropriately for a v1 only autopilot
    • A v2 transponder with a v2-compatible autopilot can be entirely configured by the transponder.

    I think we want to move to a state where the v1 protocol eventually disappears.

@hamishwillee
Copy link
Collaborator

hamishwillee commented Aug 4, 2022

@optical-o I'm going to leave @BluemarkInnovations to comment broadly on your response. A few minor points.

The messages should be sent only when a change in the data occurs, which can be driven by the interval or by the data itself.

Yes, we get that. The version 1 is an earlier implementation that did not understand this approach, so it streams the static data at low rate to ensure that it is received if, say, a transponder is connected late. I want v2 to replace v1 - not co-exist forever.

The concern in V2 is that we have things like the OPEN_DRONE_ID_RADIO_CONTROL which might change on the vehicle. If we send them once then we don't know for sure they were received unless (ish) we stream them. Though this could be a command too :-)

By this, I think that the term 'remote ID v2' is a little bit ambiguous.

It is more than just the radio control/capabilities. It is a switch from streamed static data to requested data. From a MAVLink point of view we need to identify the different workflows for implementers.

If this was all agreed we'd have two separate protocols, with v2 superseding v1


Getting the data needed from other messages is certainly a valid approach, albeit requires much more knowledge of MAVLink and systems than most implementers are likely to want.

@hendjoshsr71
Copy link
Contributor

hendjoshsr71 commented Aug 4, 2022

I think I'm caught up up and the preceding sounds reasonable enough for "the next steps".

Sorry to diverge a bit from the work above.

However, we do not yet have a message that goes from the DroneID module back to the autopilot to authorize arming or say "I'm not ready".

I do not see how a device that only receives messages can meet the FAA''s "Standard RID" regulatory requirements. How do we know the transmitter is sending data correctly, receiving data correctly, passed preflight tests, etc.?
From my reading of the ASTM Means of Compliance this is not required for "Broadcast IDs" though as long as their is an "indicator" on the module light, sound, or other.
Note: the above is related only to the FAA. I'm not sure about other locales.

Say OPEN_DRONE_ID_MODULE_STATUS with an enum for the various states of the module Pre-flight tests passed, Not ready, various failures states, etc.

The discussion for that message should likely be separate as I see that message as a required item within this month.

@BluemarkInnovations
Copy link
Author

@optical-o, thanks for the feedback and sharing your current MAVLink implementation. It is good see more manufacturers that want to support the MAVLink remote ID messages. And also share their opinion about this PR.

@hamishwillee already explained why it is called v2 and v1. Basically you describe using the remote ID v1 message definitions outside the intended usage.

  • Note there is the OPEN_DRONE_ID_MESSAGE_PACK that should not be used by the flight controller to communicate with the transmitter. Should be used only for receiving ODID messages, because the transmitter whould have to know, which messages will be inside the pack provided by the flight controller and would only complicate things. The packing of the ODID message should handle the transmitter base on a configuration in OPEN_DRONE_ID_RADIO_CONTROL this is only valid for BT5 Extended advertisement.

The OPEN_DRONE_ID_BROADCAST_CAPABILITIES message can be used to signal that the transmitter does not support OPEN_DRONE_ID_MESSAGE_PACK packet types. In general, a transmitter could decide to implement it. You prefer not to implement it, me neither.

The easiest way to change the implementation is by the transmitter to retrieve on startup/MAVLink connection or parse then on change. For proper integration of the receiver into the system should report using the HEARTBEAT message and prevent the system from operating until it has all necessary information(either they are polled or received by interval sending) for correct ODID operation.

I think you mean transmitter instead of receiver. (So the transponder that receives data from the auto pilot system.) I think a message type like mentioned here by @hendjoshsr71 would be useful.

To add something to progress the implementation discussion indeed there should be some OPEN_DRONE_ID_RADIO_CONTROL message I can see usage for disabling and enabling the transmission mode. Keep in mind that the ODID specification defines aircraft state for Landed so the device should broadcast its position even in landed/standby mode before flight. I would prefer that this field would be also polled at startup or actively sent by the controller when change occurs as a broadcast.

There are different regulations and it is up to the auto pilot system. I can imagine that when the motors are off, you also don't send any remote ID signals. Basically also the auto pilot system needs to implement the remote ID standard correctly. This is a bit out of the scope of this MAVLink message definitions.

OPEN_DRONE_ID_BROADCAST_CAPABILITIES is nice to have(for diagnosis), but I don't see that the flight controller would adjust its functionality by receiving this field. Most of the systems are statically configured beforehand.

Indeed, it could well be that most transmission parameters are set statically in the system. However, the capabilities message also returns which packets the transmitter (transponder) supports. This is useful, unless of course there is a strict definition of remote ID in MAVLink that does not allow room for different implementations.

@BluemarkInnovations
Copy link
Author

@hamishwillee Here a quick reply. Next week more extensive one.

My concerns:

  1. OPEN_DRONE_ID_BROADCAST_CAPABILITIES is sent to autopilot to say what it supports. OPEN_DRONE_ID_RADIO_CONTROL is then requested from autopilot its content is formatted based on what is supported.
  • The OPEN_DRONE_ID_BROADCAST_CAPABILITIES appears to be sent only once? What if it is not received?

The auto pilot system could send a MAV_CMD_REQUEST_MESSAGE to the the transmitter for this message type. And keep sending those requests periodically if it doesn't receive them. Or it could be a command message like you mentioned below

  • The docs are a little unclear too on the sequence - later on it looks like the capabilities might be send after the radio control.

It should be the first message.

W.r.t. to the OPEN_DRONE_ID_RADIO_CONTROL, I think it makes sense to make it a command message, as it is quite essential to know that the transmitter received the message.

  1. How you handle v1/v2 switchover depends on how the flight stack is setup. How does it know that it has an ODID transponder connected in order to start streaming? Is that based on heartbeat and MAV_TYPE_ODID being set by the component? Or is it configured using a parameter, or some other way?

Could be both. Depends on the auto pilot implementation.

@friissoren
Copy link
Contributor

Finally I also want to add -to the description page only- that if you transmit a OPEN_DRONE_ID_BASIC_ID with an uas_id field, the transponder will use its own serial number in the transmission. In some standards like F3411, the radio module serial number of the radio module needs to be broadcast. Setting the uas_id to empty, allows the autopilot system to configure other fields in this message and at the same time allow the transponder to broadcast its own serial number.

F3411 does not define add-on modules at all.
F3586 distinguishes between standard RID (UA integrated) and Broadcast Modules but does not give a specific description of the difference between them (during the standardization work, it was implicitly understood that a module would be a device that could not communicate with the rest of the UAS).

ASD-STAN specifically specify an Add-on as: "A standalone Direct Remote ID broadcast device integrating a GNSS function and a communication function, being able to provide position, height, speed over ground, track clockwise with true north, of the UA, and the remote pilot position or it’s take-off position."
Again, the assumption is that it cannot communicate with the UAS.

Since the proposed MAVLink messages here are clearly targeted at communication between the flight controller/GCS and the transmitter module, I would say that when these are used, the transmitter device is considered integrated into the UAS and thus need to follow the rule-set adhering to Standard RID/Direct Remote ID.

I.e. the serial number must be the serial number of the UA, the operator location must be dynamic (updated continuously), any faults of the transmitter device must be detected/communicated via the flight controller/GCS etc.

tridge added a commit to tridge/mavlink that referenced this pull request Aug 10, 2022
this is required for the pre-arm check that the transmitter is ready
and passing tests

message ID chosen so as not to conflict with PR mavlink#1865
@ThomasDebrunner
Copy link
Contributor

For PX4, we started with an implementation of what would be described here as the "legacy" protocol. PX4/PX4-Autopilot#20036
PX4 generally streams all telemetry messages without having to configure them first (which is unlike ArduPilot afaik). As I see it here, the only difference of the V2 protocol is that streams / messages ahve to be explicitly requested, which is fair.

@hamishwillee
Copy link
Collaborator

hamishwillee commented Aug 11, 2022

@BluemarkInnovations I believe you have addressed my concerns iabout v1/v2 control in #1865 (comment) -

The radio control bit won't quite work:

This bit is good. The autopilot sets RADIO_CONTROL at any time in a command, and gets back and ACK. It knows it has been set, and it does after the capabilities are set

But you cant request a command in the request message. It just won't work - you can only request a message.
So what I'd say is that this radio control must be called by a v2 compliant autopilot after getting capabilities. WOuld that work?

This is a little odd because normally an autopilot acts as a server answering queries from a GCS. So if we ever need to have a GCS interaction to set this radio info, things might get complicated.

@BluemarkInnovations
Copy link
Author

@hamishwillee, thanks for your feedback. The last message flow would work from my perspective, copied at the bottom of this comment.

This is a little odd because normally an autopilot acts as a server answering queries from a GCS. So if we ever need to have a GCS interaction to set this radio info, things might get complicated.

Not sure what you mean with this, perhaps it is lost in translation. Is the message flow below awkward to implement for PX4/ArduPilot?

Given the latest developments at ArduPilot and PX4, I'm less likely to implement remote ID v2 myself, or at least follow what these projects will do. I started this PR as in my opinion remote ID v1 has shortcomings and there wasn't much activity in this area when I opened this PR.

@tridge, @ThomasDebrunner could you please give your opinion about this PR; does the proposed v2 work for you to implement? If not, what you want to have changed?

@ThomasDebrunner
Copy link
Contributor

@BluemarkInnovations Yes, that protocol looks fine. For now, we just send out the LOCATION and DRONE_ID_BASIC_ID messages automatically, without having to configure them.

Also, there needs to be a mechanism that the Autopilot knows that the transponder is still working. E.g. this message. #1873

@hamishwillee
Copy link
Collaborator

hamishwillee commented Aug 11, 2022

@BluemarkInnovations Yes, that message is in. Though it is slightly redundant as the transmitter emits a heartbeat.

@friissoren We should do a last review of this. An push it in for prototyping. Also document as a v2 protocol and reframe the original doc as a v1 protocol.

<field type="uint8_t" name="basic_id_max">Describes how many different basic IDs the device supports. The valid range is 1 to 4.</field>
<field type="uint8_t" name="authentication_pages_max">Describes how many Authentication pages the device supports. Maximum value is 16.</field>
</message>
<!-- The message ids 12918 - 12919 are reserved for OpenDroneID. -->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be changed to only 12919 when rebasing this on top of the latest master. 12918 was already merged in.

<field type="uint8_t" name="radio" enum="MAV_ODID_RADIO_TYPES" display="bitmask">Describes which radio types the device has (Bluetooth, WiFi).</field>
<field type="uint8_t" name="radio_wifi_frequency_bands" enum="MAV_ODID_RADIO_WIFI_SUPPORTED_FREQUENCY_BANDS" display="bitmask">Describes supported frequency bands of the WiFi radio(s).</field>
<field type="uint8_t" name="radio_wifi_count">Describes how many (independent) WiFi radio(s) the device has.</field>
<field type="uint8_t" name="commands_supported" enum="MAV_ODID_MESSAGES_SUPPORTED" display="bitmask">Describes which OpenDroneID messages the device supports.</field>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we make this uint16_t instead? Right now the enum exactly fits in the 8 bits allocated.
However, there is a theoretical possibility that the standards will be amended with additional message and it then won't be possible to add additional bitmask enum values to indicate those.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, it would make it future proof.

Copy link
Contributor

@friissoren friissoren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general I am okay with this.

@BluemarkInnovations
Copy link
Author

@BluemarkInnovations Yes, that message is in. Though it is slightly redundant as the transmitter emits a heartbeat.

Well the heartbeat has a bit of functionality as the transmitter is a critical component in the system. If it would fail there are no heartbeats anymore. However, we could modify the v2 protocol a bit and replace the heartbeat message by the OPEN_DRONE_ID_ARM_STATUS message. That one is also streamed.

@hamishwillee
Copy link
Collaborator

This is a little odd because normally an autopilot acts as a server answering queries from a GCS. So if we ever need to have a GCS interaction to set this radio info, things might get complicated.

Not sure what you mean with this, perhaps it is lost in translation. Is the message flow below awkward to implement for PX4/ArduPilot?

@BluemarkInnovations Sorry

All I am saying is that I don't understand how the settings that the autopilot provides to the transponder will be populated in the autopilot. Normally you would write settings from a GCS. It may be that these are hard coded by an integrator on a per-device level. Upshot, I don't know if there is a "GCS intergration" required.

What is it that concerns you about PX4/ArduPilot work that concerns you. I hope you'll implement this - right now I see you as the key stakeholder :-0.

@hamishwillee
Copy link
Collaborator

@ThomasDebrunner @tridge Could you please review the messages and workflow described in #1865 (comment)

  • Is this reasonable
  • Is this worth prototyping
  • Is anyone committing to prototype?

@BluemarkInnovations
Copy link
Author

What is it that concerns you about PX4/ArduPilot work that concerns you. I hope you'll implement this - right now I see you as the key stakeholder :-0.

When I started this PR, I was focused on Europe. Here, it is mandatory after Jan 1st 2024. So, enough time to start PRs like this one and slowly walking towards a solution and implementation. This has changed since a few weeks, as the "world" seems to get awakened; ArduPilot and PX4 rush to get remote ID integrated due to the September deadline in USA. This changes the whole process a bit and yes, of course, I will try to get it implemented.

Due to this strict deadline, I find it important to get consensus with PX4/ArduPilot and avoid discussions afterwards which could result in the need for v3 or end up with different implementations that may cause incompatibility issues with the remote ID hardware. In my opinion v1, has shortcomings that need to be tackled and addressed here in this PR.

You are right, that I should not (over)complicate things, and just move on with my effort getting this done.

@tridge
Copy link
Member

tridge commented Aug 14, 2022

see my comments on #1880 for why I think we should not move fwd with the v2 proposal at this time

@hamishwillee hamishwillee changed the title Adding additional remote ID message definitions RemoteID v2 and adding additional remote ID definitions Aug 14, 2022
@hamishwillee
Copy link
Collaborator

@BluemarkInnovations Thanks very much. Given all the churn this week I think we should pause this discussion for a little while and wait until the dust settles. Could we perhaps re-engage on this early next year?

@BluemarkInnovations
Copy link
Author

Could we perhaps re-engage on this early next year?

Okay for me.

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

Successfully merging this pull request may close these issues.

None yet

9 participants