# PX4 not react to Terrain Following and Collision Prevention Messages

**URL:** <https://discuss.px4.io/t/px4-not-react-to-terrain-following-and-collision-prevention-messages/12397>\
**Category:** PX4 Autopilot\
**Created:** [August 12, 2019, 8:56am UTC](https://discuss.px4.io/t/px4-not-react-to-terrain-following-and-collision-prevention-messages/12397 "2019-08-12T08:56:03Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![pbarretomarques](https://discuss.px4.io/user_avatar/discuss.px4.io/pbarretomarques/32/4421_2.png) [@pbarretomarques](https://discuss.px4.io/u/pbarretomarques)\
**Post date:** [August 12, 2019, 8:56am UTC](https://discuss.px4.io/t/px4-not-react-to-terrain-following-and-collision-prevention-messages/12397/1 "2019-08-12T08:56:03Z")

</div>

Hi,  
I use an arduino to send DISTANCE\_SENSOR ([#132] and OBSTACLE\_DISTANCE ([#330] messages through serial interface to a CUBE flight controller.  
I can see with success the messages in the QGroundcontrol but when I test my hexacopter, it react to theses messages in order to do the terrain following or the collision prevention.  
For Collision Prevention I set the MPC\_COL\_PREV\_D to 6 m.  
For Terrain Following I set:  
EKF2\_HGT\_MODE=0  
EKF2\_RNG\_AID=1  
MPC\_ALT\_MODE=1

I need help to understand why the flight controller receive the messages with success but don’t react to them.

---

<div class="post-metadata">

**Author:** ![pbarretomarques](https://discuss.px4.io/user_avatar/discuss.px4.io/pbarretomarques/32/4421_2.png) [@pbarretomarques](https://discuss.px4.io/u/pbarretomarques)\
**Post date:** [August 12, 2019, 8:57am UTC](https://discuss.px4.io/t/px4-not-react-to-terrain-following-and-collision-prevention-messages/12397/2 "2019-08-12T08:57:31Z")

</div>

I mean: the hexacopter never react to these messages.

---

<div class="post-metadata">

**Author:** ![pbarretomarques](https://discuss.px4.io/user_avatar/discuss.px4.io/pbarretomarques/32/4421_2.png) [@pbarretomarques](https://discuss.px4.io/u/pbarretomarques)\
**Post date:** [August 12, 2019, 8:59am UTC](https://discuss.px4.io/t/px4-not-react-to-terrain-following-and-collision-prevention-messages/12397/3 "2019-08-12T08:59:00Z")

</div>

> [@pbarretomarques](#):
>
> it react to theses messages in order to do the terrain following or the collision prevention.

I mean: it don’t react to theses messages in order to do the terrain following or the collision prevention.

---

<div class="post-metadata">

**Author:** ![mrivi](https://discuss.px4.io/letter_avatar_proxy/v4/letter/m/58f4c7/32.png) [@mrivi](https://discuss.px4.io/u/mrivi)\
**Post date:** [August 12, 2019, 10:04am UTC](https://discuss.px4.io/t/px4-not-react-to-terrain-following-and-collision-prevention-messages/12397/4 "2019-08-12T10:04:24Z")

</div>

Can you share the flight controller log?

---

<div class="post-metadata">

**Author:** ![pbarretomarques](https://discuss.px4.io/user_avatar/discuss.px4.io/pbarretomarques/32/4421_2.png) [@pbarretomarques](https://discuss.px4.io/u/pbarretomarques)\
**Post date:** [August 12, 2019, 11:25am UTC](https://discuss.px4.io/t/px4-not-react-to-terrain-following-and-collision-prevention-messages/12397/5 "2019-08-12T11:25:41Z")

</div>

Thanks for your reply.  
I’ll share the log in about 8 hours. I have not access to the system now.

---

<div class="post-metadata">

**Author:** ![pbarretomarques](https://discuss.px4.io/user_avatar/discuss.px4.io/pbarretomarques/32/4421_2.png) [@pbarretomarques](https://discuss.px4.io/u/pbarretomarques)\
**Post date:** [August 12, 2019, 7:41pm UTC](https://discuss.px4.io/t/px4-not-react-to-terrain-following-and-collision-prevention-messages/12397/6 "2019-08-12T19:41:40Z")

</div>

You can find the logs at: [https://drive.google.com/open?id=1azjmhl9LGGcKabGm8IvIzIQE6E73mZmt](https://drive.google.com/open?id=1azjmhl9LGGcKabGm8IvIzIQE6E73mZmt)  
I will appreciate your help

---

<div class="post-metadata">

**Author:** ![mrivi](https://discuss.px4.io/letter_avatar_proxy/v4/letter/m/58f4c7/32.png) [@mrivi](https://discuss.px4.io/u/mrivi)\
**Post date:** [August 13, 2019, 7:41am UTC](https://discuss.px4.io/t/px4-not-react-to-terrain-following-and-collision-prevention-messages/12397/7 "2019-08-13T07:41:24Z")

</div>

could you please upload the log to [https://review.px4.io/](https://review.px4.io/) and share the link? thank you

---

<div class="post-metadata">

**Author:** ![pbarretomarques](https://discuss.px4.io/user_avatar/discuss.px4.io/pbarretomarques/32/4421_2.png) [@pbarretomarques](https://discuss.px4.io/u/pbarretomarques)\
**Post date:** [August 13, 2019, 7:52am UTC](https://discuss.px4.io/t/px4-not-react-to-terrain-following-and-collision-prevention-messages/12397/8 "2019-08-13T07:52:25Z")

</div>

Ok. The log is available at [https://review.px4.io/plot\_app?log=934893d6-eed4-4f92-b6c0-cae769854695](https://review.px4.io/plot_app?log=934893d6-eed4-4f92-b6c0-cae769854695)  
Thanks

---

<div class="post-metadata">

**Author:** ![mrivi](https://discuss.px4.io/letter_avatar_proxy/v4/letter/m/58f4c7/32.png) [@mrivi](https://discuss.px4.io/u/mrivi)\
**Post date:** [August 13, 2019, 12:42pm UTC](https://discuss.px4.io/t/px4-not-react-to-terrain-following-and-collision-prevention-messages/12397/9 "2019-08-13T12:42:27Z")

</div>

Thanks for the log. Unfortunately I cannot tell much from it because the logging profile doesn’t contain the messages used to do Collision Prevention. Could you please provide a log with the parameter SDLOG\_PROFILE set to also log Computer Vision and Avoidance topics. Thanks

---

<div class="post-metadata">

**Author:** ![pbarretomarques](https://discuss.px4.io/user_avatar/discuss.px4.io/pbarretomarques/32/4421_2.png) [@pbarretomarques](https://discuss.px4.io/u/pbarretomarques)\
**Post date:** [August 13, 2019, 3:01pm UTC](https://discuss.px4.io/t/px4-not-react-to-terrain-following-and-collision-prevention-messages/12397/10 "2019-08-13T15:01:22Z")

</div>

I’ll will do other flight with SDLOG\_PROFILE set to log Computer Vision and Avoidance topics and I make it available.  
Thank you for you help in this issue

---

<div class="post-metadata">

**Author:** ![pbarretomarques](https://discuss.px4.io/user_avatar/discuss.px4.io/pbarretomarques/32/4421_2.png) [@pbarretomarques](https://discuss.px4.io/u/pbarretomarques)\
**Post date:** [August 16, 2019, 4:34pm UTC](https://discuss.px4.io/t/px4-not-react-to-terrain-following-and-collision-prevention-messages/12397/11 "2019-08-16T16:34:54Z")

</div>

Hi,  
The log with SDLOG\_PROFILE set to log Computer Vision and Avoidance is available in [https://review.px4.io/plot\_app?log=4f68dcbc-5faa-44e7-91d7-474c5eb1dbe9](https://review.px4.io/plot_app?log=4f68dcbc-5faa-44e7-91d7-474c5eb1dbe9)  
The terrain following is not working also. Do you think there are some connection between the 2 issues?

This time I notice an alarm of Collision but the hexacopter didn’t stop.

I appreciate your help

---

<div class="post-metadata">

**Author:** ![pbarretomarques](https://discuss.px4.io/user_avatar/discuss.px4.io/pbarretomarques/32/4421_2.png) [@pbarretomarques](https://discuss.px4.io/u/pbarretomarques)\
**Post date:** [August 16, 2019, 4:56pm UTC](https://discuss.px4.io/t/px4-not-react-to-terrain-following-and-collision-prevention-messages/12397/12 "2019-08-16T16:56:15Z")

</div>

Maybe this [https://github.com/PX4/Firmware/issues/11133](https://github.com/PX4/Firmware/issues/11133) is related with the issue of terrain following not working?

---

<div class="post-metadata">

**Author:** ![mrivi](https://discuss.px4.io/letter_avatar_proxy/v4/letter/m/58f4c7/32.png) [@mrivi](https://discuss.px4.io/u/mrivi)\
**Post date:** [August 19, 2019, 6:41am UTC](https://discuss.px4.io/t/px4-not-react-to-terrain-following-and-collision-prevention-messages/12397/13 "2019-08-19T06:41:37Z")

</div>

As far as I can tell the collision prevention is working. This is from your log. In flight review if you scroll down the bottom you can see the collision prevention warning

 ![col_prev](https://discuss.px4.io/uploads/default/original/2X/2/270d9e3d66bb44bae29a8964828b8cabc5d8c721.png)
