At the moment, the waypoints coming from obstacle avoidance override the setpoints generated by a FlightTask: https://github.com/PX4/Firmware/blob/f1d17c9003280498724211310c6e5601b1df44da/src/modules/mc_pos_control/mc_pos_control_main.cpp#L693
In order to benefit from smoothing features given by the "Smooth" FlightTasks, we need to read and use those setpoints directly in the FlightTask.
Since the avoidance is only used in the Auto FlightTasks, the setpoints should be read in the AutoMapper.
Tasks:
@Stifael @MaEtUgR Please comment
@mrivi FYI
Update after discussion with @mrivi :
Sidenote: it's confusing when the @AuterionWrikeBot creates issues. Could at least be in the description who wrote it?
we need to read and use those setpoints directly in the FlightTask
yes ok, but we should keep it contained in a library like @mrivi started out in #11561 because if it's modular in this way it's better maintainable.
We need to have avoidance available in manual position and auto modes.
Does the avoidance always react the same way? I expected a different behavior when flying manually compared to a mission.
We need to have avoidance available in manual position and auto modes.
Does the avoidance always react the same way? I expected a different behavior when flying manually compared to a mission.
PX4 avoidance can be run only in auto modes. However the current interface supports pos control modes as well (even if they are not enabled by default).
We have collision prevention available in manual position control, using the laser scanner message.
We have collision prevention available in manual position control, using the laser scanner message.
Ok, that's what I expected, the implementation here https://github.com/PX4/Firmware/tree/6c3e79f3614f0060d5998c39be358512101252ff/src/lib/CollisionPrevention is used with distance data from the external module in manual position flight.
The PX4 collision prevention doesn't uses the vehicle_trajectory_waypoint interface these changes don't have an impact on that feature.
However I am aware of other obstacle avoidance system integrated with PX4 that can be used in position control mode. Therefore the current master implementation is thought for pos control mode as well even if it's not enabled by default upstream since PX4 avoidance doesn't support it.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This is fixed now.
Most helpful comment
Update after discussion with @mrivi :