add dronecan 345.CanConfig message - #83
Open
olliw42 wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
adds the broadcast message 345.CanConfig, for reporting CAN bus configuration information such as bitrate or CAN variant.
problem it solves:
mLRS is supporting DroneCan since a longer while, and commerically available hardware has also become available some time ago. We now want to also support CAN FD, but possibly in a user friendly way. While what we have is working perfectly fine, and it is easy enough code-wise to autodetect and switch from classic CAN to CAN FD, autodetecting the bitrate is pretty clumsy and we would like to avoid such code.
The proposed CanConfig message is reporting such info to interested nodes, and the idea is that it is send by ArduPilot alongside the dynamic_node_id.Allocation message, when the dynamic node id allocation is finished.
That is, codewise, all change needed in ArduPilot is to add after that line here https://github.com/ArduPilot/ardupilot/blob/master/libraries/AP_DroneCAN/AP_DroneCAN_DNA_Server.cpp#L559 a line which publishes the CanConfig message.
From the user side, all they have to do is to configure ArduPilot, which they have to do anyway, but it would avoid specifc configuration on the node side. We believe users would welcome this simplification.
Alternatives:
The message could be designed as a service, such that nodes can actively request this info. However, the disadvantage in our opinion is that nodes then do have to actively request for it. This would add additional code on both the node and ArduPilot side, with no benefit in our opinion.
A further approach would be the capabilities service considered in #4. This approach is however way more sophisticated. It would e.g. require nodes to constantly watch out for possible can bus reconfigurations, and it's questionable if nodes should have control over the bitrate. Moreover, the proposed mechanism can perfectly coexist with a capabilities approach, if that should ever be installed.
Extensions:
The message could possible extended by further info, for instance, can bus timing info.