Removed negative sign from _takeoff_ramp_vz_init #12304
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Describe problem solved by the proposed pull request
If the initial
_takeoff_ramp_vz_init
value is negative, as it is now in master, the takeoff ramp will go from that negative value to the parameter 'MPC_Z_VEL_MAX_UP', which is positive:https://github.com/PX4/Firmware/blob/e0f3fc8d00850292a8309416574b34f6fbabaaa3/src/lib/FlightTasks/tasks/FlightTask/FlightTask.cpp#L141
In mc_pos_control.cpp we assign the output of this ramp to constraint.ramp_up:
https://github.com/PX4/Firmware/blob/e0f3fc8d00850292a8309416574b34f6fbabaaa3/src/modules/mc_pos_control/mc_pos_control_main.cpp#L579
Which is then used in PositionControl.cpp:
https://github.com/PX4/Firmware/blob/e0f3fc8d00850292a8309416574b34f6fbabaaa3/src/modules/mc_pos_control/PositionControl.cpp#L229
Negative values in
constraints.speed_up
make no sense, that's why I think that this negative sign might be a bug.