-
Notifications
You must be signed in to change notification settings - Fork 17.6k
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_ESC extended status packet addition #27248
AP_ESC extended status packet addition #27248
Conversation
Do you have a spec for this? I am not finding anything that specifies this. |
|
@andyp1per it is a custom APD code which is made for us. There is no document for it. |
This is the telemetry Structure : The telem struct: |
@Pradeep-Carbonix @robertlong13 would be a good idea to split this into 2 PR one for ESCX support and other for APDF120 custom Firmware. |
So its not BLHeli at all. I think we should make this clear in the naming and in the define to enable it. EDT2 is also providing some of this information and some is also available in the BLHeli status frame - we need to not get these muddled up and not trample over one. |
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.
Like EDTv2 I think we need to be able to compile this out with something like:
AP_EXTENDED_APD_TELEM_ENABLE
9da04c7
to
bde0161
Compare
This PR now has changes related to DroneCAN ESCX implementation only. BLHeli implementation is removed from this PR. |
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.
Need a different name but changes looking good.
bde0161
to
8195e84
Compare
966454b
to
9c9e00b
Compare
CI check autotest (sitltest-plane) is failing. |
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.
this is getting close now, thanks!
@@ -188,6 +188,10 @@ | |||
#define AP_EXTENDED_DSHOT_TELEM_V2_ENABLED HAL_REQUIRES_BDSHOT_SUPPORT | |||
#endif | |||
|
|||
#ifndef AP_EXTENDED_ESC_TELEM_ENABLED | |||
#define AP_EXTENDED_ESC_TELEM_ENABLED (CONFIG_HAL_BOARD == HAL_BOARD_SITL) |
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.
Do you not want it enabled on more than sitl? Incidentally, since this is really just to handle dronecan I think the define should be based on drone can being available.
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.
Enabling this feature for sitl up in the previous discussion. Mainly to help with autotests.
AP_ESC_Telem_config.h is added with -
#ifndef AP_EXTENDED_ESC_TELEM_ENABLED
#define AP_EXTENDED_ESC_TELEM_ENABLED HAL_ENABLE_DRONECAN_DRIVERS
#endif
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.
I think we should just enable for all drone CAN builds.
9c9e00b
to
cdfb37d
Compare
#if AP_EXTENDED_ESC_TELEM_ENABLED | ||
// get an individual ESC's input duty if available, returns true on success | ||
bool get_input_duty(uint8_t esc_index, uint8_t& input_duty) const; | ||
|
||
// get an individual ESC's output duty if available, returns true on success | ||
bool get_output_duty(uint8_t esc_index, uint8_t& output_duty) const; | ||
|
||
// get an individual ESC's status flags if available, returns true on success | ||
bool get_flags(uint8_t esc_index, uint32_t& flags) const; | ||
#endif // AP_EXTENDED_ESC_TELEM_ENABLED |
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.
I don't think these are used anywhere?
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.
The APD ESC extended status telemetry messages implementation utilizes these functions. Given its specificity to our requirements, we decided to create two separate pull requests.
The first pull request includes the driver implementation (which is this one), as we believe it could be beneficial to a broader audience.
The second pull request will contain the AP_Periph interface with the APD ESC, which we plan to submit at a later time.
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.
If they are unused they should not be included because they cannot have been tested. You should add them in the future PR with the periph interface.
@@ -62,6 +62,8 @@ def __init__(self, filename, nm="arm-none-eabi-nm", strings="strings"): | |||
('HAL_EFI_ENABLED', 'AP_EFI::AP_EFI',), | |||
('AP_EFI_{type}_ENABLED', 'AP_EFI_(?P<type>.*)::update',), | |||
|
|||
('AP_EXTENDED_ESC_TELEM_ENABLED', 'AP_Extended_Telem::get_input_duty',), |
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.
I suspect this won't work because the get_input_duty
function is not used anywhere so the linker will remove it.
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.
The APD ESC extended status telemetry messages implementation utilizes these functions. Given its specificity to our requirements, we decided to create two separate pull requests.
The first pull request includes the driver implementation (which is this one), as we believe it could be beneficial to a broader audience.
The second pull request will contain the AP_Periph interface with the APD ESC, which we plan to submit at a later time.
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.
AP_Extended_Telem::get_input_duty
is not even a function that exists in this PR. As I say, even if it had the correct class name it would not work for extract features because its not used so it won't be in the compiled output which extract features uses.
*/ | ||
void AP_DroneCAN::handle_esc_ext_status(const CanardRxTransfer& transfer, const uavcan_equipment_esc_StatusExtended& msg) | ||
{ | ||
#if HAL_WITH_ESC_TELEM |
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.
We should add a error somewhere if you get AP_EXTENDED_ESC_TELEM_ENABLED
and not HAL_WITH_ESC_TELEM
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.
And then we won't need this check.
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.
Thank you @IamPete1, I have added the lines suggested into AP_ESC_Telem_config.h
@Pradeep-Carbonix I have done some the fixes for this PR here: https://github.com/IamPete1/ardupilot/tree/extended_esc. I can push over this branch if that is OK with you. Or you could do it yourself. |
- DroneCAN Callback function - handle_esc_ext_status definition
- ESCX structure definition - Backend function to update Extended telemetry data (ESCX) - Logging ESCX data - ESCX conditional compilation directives
cdfb37d
to
c67e661
Compare
Just to re-iterate, I have done all the fixes that I think this PR needs here: https://github.com/IamPete1/ardupilot/commits/extended_esc/ |
patches merged by Pete's PR #27755 |
Added support for ESC extended status telemetry data for CubeOrange and AP_Periph :