Skip to content

AP_HAL_ChibiOS: enable DroneCAN scripting for CubeOrangePlus#31938

Closed
jvanderploeg wants to merge 1 commit into
ArduPilot:masterfrom
jvanderploeg:testing_sgdc
Closed

AP_HAL_ChibiOS: enable DroneCAN scripting for CubeOrangePlus#31938
jvanderploeg wants to merge 1 commit into
ArduPilot:masterfrom
jvanderploeg:testing_sgdc

Conversation

@jvanderploeg

Copy link
Copy Markdown

Adds HAL_ENABLE_DRONECAN_DRIVERS define to enable DroneCAN scripting bindings for Lua on CubeOrangePlus hardware. This allows Lua scripts to access DroneCAN functionality on this board.

Adds HAL_ENABLE_DRONECAN_DRIVERS define to enable DroneCAN scripting bindings for Lua on CubeOrangePlus hardware. This allows Lua scripts to access DroneCAN functionality on this board.
@peterbarker

Copy link
Copy Markdown
Contributor

(1) this feature is already built into that board and (2) if we've left something out it's usually for a good reason.

Closing this one now.

@jvanderploeg

Copy link
Copy Markdown
Author

Hi @peterbarker - where is this feature already built in? Without adding this I'm unable to get CAN data via Lua scripting, specifically for a CAN enabled fuel tank. It wouldn't seem like this change should make much of a difference, but perhaps it would be better to add as a parameter instead?

@rob-clarke

Copy link
Copy Markdown
Contributor

@jvanderploeg CAN is enabled on the CubeOrangePlus as CANx pin types are defined in the hwdef. That causes chibios_hwdef.py to define HAL_NUM_CAN_IFACES. Through a series of #ifndefs it ultimately results in HAL_ENABLE_DRONECAN_DRIVERS being set.

CAN data from Lua works for me on the same board. There are some restrictions on what you can access though. IIRC only 11-bit CAN messages will be forwarded to Lua if you are also using the standard DroneCAN handling.

Access to DroneCAN messages needs this PR (merged into master May 2025).

@jvanderploeg

Copy link
Copy Markdown
Author

@rob-clarke - thanks for the response. I just pulled the latest master and compiled, and my Lua scripts appear to be working as expected. I guess I missed my opportunity to contribute when I was looking at this last year, although I thought I had forked after that PR you mention and it wasn't working then. Not sure what happened, but sorry for the confusion and thanks for the help

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.

3 participants