-
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
AP_ESC extended status packet addition #27248
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,6 +67,17 @@ class AP_ESC_Telem { | |
// get an individual ESC's consumption in milli-Ampere.hour if available, returns true on success | ||
bool get_consumption_mah(uint8_t esc_index, float& consumption_mah) const; | ||
|
||
#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 | ||
Comment on lines
+70
to
+79
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
|
||
// return the average motor frequency in Hz for dynamic filtering | ||
float get_average_motor_frequency_hz(uint32_t servo_channel_mask) const { return get_average_motor_rpm(servo_channel_mask) * (1.0f / 60.0f); }; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe 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 commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should just enable for all drone CAN builds. |
||
#endif | ||
|
||
// this is used as a general mechanism to make a 'small' build by | ||
// dropping little used features. We use this to allow us to keep | ||
// FMUv2 going for as long as possible | ||
|
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.