Rc_override or position_set


#1

Hi,
I am trying to implement obstacle avoidance using Pixhawk. I wanted to override RC in my onboard app when the drone faces obstacles. I was wondering if position_set or velocity_set means overriding RC. Or how can I use rc_override from mavros for this sort of implementation?
Thank you!


#2

Hi @kellykhoooo,

Sorry for the delayed response.
If you have Position estimation of the drone, then it is better to use position_set or velocity_set API.
If you are worried, whether RC stick commands would override your position_set API, then answer is ‘NO’. For position_set or velocity_set API to work, FlytOS changes the Pixhawk’s vehicle mode to ‘OFFBOARD’ or ‘GUIDED’, and RC sticks have no effect in this mode.

Does this sort your problem?


#3

Hi! Thanks for your response!

I have two questions,

  1. Will use of any navigation APIs result in the pixhawk’s mode switching to ‘offboard’ or ‘guided’?

  2. Is there any way I can code my script to change the mode of the vehicle?


#4

If you are testing this on FlytSim, FlytOS will automatically do the switching for you.
But in case of real drone, you have to configure a mode switch in RC. When you want FlytOS to take control of your drone, flip the mode switch to ‘Offboard’/‘Guided’ mode. If you do not want to configure switch in RC, take a look at ‘access_request’ API.