Closed pieniacy closed 2 years ago
Thanks for the PR. Since we need quick revisions, I just pulled your changes in and created #196 with some modifications, see PR description. We'll do more testing but take a look and see if it still satisfies your use case.
replaced by #196
Change suction gripper mass
Scales down mbzirc_suction_gripper mass from 2 kg to 1 kg. Full rationale is here: #190
Fix copter controller to work with attached payloads
The existing design of the controller is definitely not suitable for drones carrying unknown payloads in the first place. Controller needs to know the mass of the drone to calculate the thrust to be applied and then it does not care whether it actually outputs enough thrust or not. Ideal solution would be to just drop the controller altogether and allow users to control attitude and thrust of the drone. However, since we cannot do any significant changes at this stage of the competition we believe our proposal is the best fit to solve the issue.
This change fixes the fact that
LeeVelocityController
uses the mass of the drone, but it does not take into account the mass of the payload object attached with a suction gripper.LeeVelocityController::CalculateRotorVelocities
now takes payload mass, which is taken into account in thrust calculation.MulticopterVelocityControl::PreUpdate
now checks for attached payloads and passes their mass down to theCalculateRotorVelocities
function.