-
Notifications
You must be signed in to change notification settings - Fork 13.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
[WIP] remove the use of param_find("") #13076
[WIP] remove the use of param_find("") #13076
Conversation
param_find() does binary search every time any other parameter is beeeing changed. which is extensive CPU proccess. This commit doesn't compile, because of calling non existing parameters FW_MAN_R_SC, FW_MAN_P_SC, FW_MAN_Y_SC
param_t param_fw_man_p_sc = param_handle(px4::params::FW_MAN_P_SC); | ||
param_t param_fw_man_y_sc = param_handle(px4::params::FW_MAN_Y_SC); | ||
|
||
float roll_trim_active, pitch_trim_active, yaw_trim_active, roll_scale, pitch_scale, yaw_scale; |
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.
It's probably a bit pedantic here, but I think it's good practice to declare and initialize each of these on a separate line with a sane default value.
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.
@dagar the issue here is not mainly about the searching of the parameter, but about the problem that the rc_calibration search for parameter that doesn't exists, on some compilation
Cool, I forgot we had this now. Thanks for the reminder. #13081 |
d26943c
to
655cdbc
Compare
Nice work, this saves ~8.7KB of flash on px4_fmu-v5_default. |
@@ -380,7 +381,7 @@ FixedwingAttitudeControl::vehicle_status_poll() | |||
|
|||
int32_t vt_type = -1; | |||
|
|||
if (param_get(param_find("VT_TYPE"), &vt_type) == PX4_OK) { | |||
if (param_get(param_handle(px4::params::VT_TYPE), &vt_type) == PX4_OK) { |
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.
VTOL needs to be optional for FW & MC controllers.
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.
there are many issues about mixing VTOL/Rover/Multicopter/Fixwing
655cdbc
to
bf0052a
Compare
778886c
to
13d0f2a
Compare
for most of the parameters
13d0f2a
to
af62eac
Compare
closed in favor to reduce the use of param_find("XXX") #13089 |
param_find() does binary search every time any other parameter is beeing changed. which is extensive CPU process.
This commit doesn't compile, because of calling non existing parameters FW_MAN_R_SC, FW_MAN_P_SC, FW_MAN_Y_SC
Describe problem solved by the proposed pull request
described on: 'extensive on every parameter change #12992'
The current problem is that do_trim_calibration() can be called on systems that doesn't has FW_MAN_* parameters. and in the new method, that does not compile