# Multicopter not holding position with collision avoidance enabled

**URL:** <https://discuss.px4.io/t/multicopter-not-holding-position-with-collision-avoidance-enabled/28788>\
**Category:** PX4 Autopilot\
**Created:** [August 22, 2022, 1:55pm UTC](https://discuss.px4.io/t/multicopter-not-holding-position-with-collision-avoidance-enabled/28788 "2022-08-22T13:55:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![chris\_app](https://discuss.px4.io/letter_avatar_proxy/v4/letter/c/9fc348/32.png) [@chris\_app](https://discuss.px4.io/u/chris_app)\
**Post date:** [August 22, 2022, 1:55pm UTC](https://discuss.px4.io/t/multicopter-not-holding-position-with-collision-avoidance-enabled/28788/1 "2022-08-22T13:55:25Z")

</div>

I am trying to enable collision avoidance on my quadcopter. My setup consists of a radar sensor connected to a microcontroller which sends obstacle distance messages via MAVLINK to the flight controller.

I have been struggling to get the system to work properly, so I disconnected the microcontroller from the flight controller. The expected system behavior was for the system to be incapable of moving in any direction due to the lack of obstacle distance messages. The observed behavior was that the system was able to move in an unrestricted way. The quadcopter was flying in position mode with CP\_DIST set to 2.

Here is my flight log: [Flight Review](https://logs.px4.io/plot_app?log=792b691e-f93f-4842-9e59-b21c59938799)

Any tips or assistance would be appreciated! Thanks.

---

<div class="post-metadata">

**Author:** ![chris\_app](https://discuss.px4.io/letter_avatar_proxy/v4/letter/c/9fc348/32.png) [@chris\_app](https://discuss.px4.io/u/chris_app)\
**Post date:** [August 22, 2022, 3:11pm UTC](https://discuss.px4.io/t/multicopter-not-holding-position-with-collision-avoidance-enabled/28788/2 "2022-08-22T15:11:48Z")

</div>

Resolved: It seems that according to the posts linked below, collision avoidance currently only works when MPC\_POS\_MODE is set to 3.

> [@Unable to move in Collision Prevention](https://discuss.px4.io/t/unable-to-move-in-collision-prevention/24931):
>
> Hi, I’m try to use Collision Prevention with OBSTACLE\_DISTANCE message in PX4 v1.11 My custom board (System 254) sends OBSTACLE\_DISTANCE dummy message and below is the message I received from QGC. (obstacle 5m, boresight) Changed CP\_DIST parameter to 3m and set to Position Mode. However, muticopter can’t go forward After changed CP\_NO\_DATA parameter to 1, muticopter can go except for the front direction. Since I sent a higher value(5m) than CP\_DIST(3m), I thought I sh…

> [@PX4 Dev Call: October 27, 2021](https://discuss.px4.io/t/px4-dev-call-october-27-2021/24634):
>
> October 27, 2021 Join us Agenda Community Q&A Roadmap High priority queue Release In-Depth discussions Community Q&A Jakob Strebel: Fixed-wing issue with the motor delay catapult launching [Catapult lauch: Motor delay not working · Issue #18416 · PX4/PX4-Autopilot · GitHub](https://github.com/PX4/PX4-Autopilot/issues/18416) Another related issue was found and fixed but apparently that was causing this problem. It would be really helpful to have a fresh log on master because it is not reproducable in simulation. Shai: Part of “AI f…
