-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
CAN: added CAN_Dn_PROTOCOL2 for 11 bit auxillary protocol #25617
Conversation
If its DroneCAN only shouldn't the param live down a level with the DroneCAN params? It would be nice to bypass the 11 bit limit for scripting so it can be used to add support for new/bespoke DroneCAN messages. This will be very useful. |
It is only DroneCAN at the moment, but in principle other protocols (eg. Piccolocan) could implement this by implementing the add_11bit_driver() method.
that would be nice, but we'd need to work out how to do that. I suspect we'd need to be able to pass a list of message IDs we want to get in scripting so we don't get all messages (similar to the filter list in MAVCAN). Then we'd need to make the DSDL compiler generate lua bindings. That is quite a large project. |
I think to start with a virtual mirror would be OK, just as if you had two physical CAN ports connected to the same bus. That is the current solution to the issue. Fancy filters would be nice, but they only apply to DroneCAN. |
Also once this is supported for more protocols you might want the 29 bit protocol as the auxiliary and the 11 bit as the primary. |
that would be possible of course, but can you give an example of a use case? |
@@ -51,6 +51,14 @@ const AP_Param::GroupInfo AP_CANManager::CANDriver_Params::var_info[] = { | |||
AP_SUBGROUPPTR(_piccolocan, "PC_", 5, AP_CANManager::CANDriver_Params, AP_PiccoloCAN), | |||
#endif | |||
|
|||
// @Param: PROTOCOL2 | |||
// @DisplayName: Secondary protocol with 11 bit CAN addressing | |||
// @Description: Secondary protocol with 11 bit CAN addressing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should add a comment to say that PROTOCOL should be set to DroneCAN for this to work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not my area really but it looks ok to me.
This allows for a 2nd CAN protocol specified by CAN_Dn_PROTOCOL2. This protocol needs to use 11 bit addressing and the same CAN bitrate as the DroneCAN driver (usually 1MBit)
With this enabled users no longer need to dedicate a CAN bus for devices such as Benewake CAN lidar, USD1 radar and various EFI CAN ECUs
Tested with both SITL and a CubeOrangePlus with a Benewake Lidar