# How to activate collision prevention feature while quad is in offboard trajectory with mavros?

Source: https://forum.modalai.com/topic/1555/how-to-activate-collision-prevention-feature-while-quad-is-in-offboard-trajectory-with-mavros
Category: VOXL SDK and Software (https://forum.modalai.com/category/47/voxl-sdk-and-software)
Tags: ros
Posted: 2022-11-21 08:48:08 UTC by Tamas Pal 0
Replies: 3 · Views: 1529

## Tamas Pal 0 · 2022-11-21 08:48:08 UTC

I am using mavros setup for figure 8 trajectory in offboard mode with master branch.
https://gitlab.com/voxl-public/support/mavros_test.git
I want to active collison prevention while the quad is following the figure 8 trajectory in a way such that, when an object comes infront of it, it stops and holds the position and when the object is removed it continues to follow the same trajectory. How to do that ?

## Reply by Anubhav · 2022-11-21 10:41:26 UTC

@Chad-Sweet 
Can I do the same without ros? by just modifying offboard_figure_eight.c given [here](https://gitlab.com/voxl-public/voxl-sdk/services/voxl-vision-px4/-/blob/master/src/offboard_figure_eight.c) such that it uses it's depth map just to maintain certain distance from obstacles and stop if any obstacle new obstacle come in front of it.
If so, how can I do it?

## Reply by Arjun Jain 0 · 2022-11-21 15:30:05 UTC

Hi modal Ai, we are able to do a predefined zig zag pattern. However, we also need collision prevention. This is our last remaining challenge. We will be very greatly for your help.

## Reply by Tamas Pal 0 · 2022-11-22 11:20:46 UTC

@modaltb  Any suggestion ?
