Brake mode without gps

Hi I’m new in this platform. I want to code a brake mode but without gps, actually a hover mode. I can control a copter with SET_ATTITUDE_TARGET message from dronekit. At first, I disable sitl’s gps via set SIM_GPS_DISABLE to 1 (I’m trying this on sitl and gazebo). In this situation, I can’t change mode to BRAKE because it needs gps data. I can find these with dronekit: Roll angle, pitch angle, yaw angle and groundspeed. Can I stop a drone while it’s moving on guided mode with that datas

Yes, you can. But not in guided.

You need to use guided_nogps flight mode instead. And you need to fulfill the requirements of that flight mode

Thanks, SET_ATTITUDE_TARGET message is only acceptable message in guided_nogps mode but actually I didn’t mean that. Let me change the question as “Can I stop a drone while it’s moving on guided_nogps mode with roll, pitch, yaw and groundspeed”.

I mean how can I calculate how many second will it stay at which angle etc. Maybe I need a PID controller (but drone has an embedded PID controller and when I say an angle with set_attitude_target, it uses that PID to get to the given angles.)

There is an example:
Drone goes forward with 20 degree pitch angle. When I run this script that I want to write, in 1st second it will get to -20 degree, in 2nd second it will be -15 degree … and finally it will be hover but this should be smooth.

Thank you

Tune the loiter controller. Follow this guide until you react step 47. You may skip steps 40-46.

Then the vehicle will do what you want without having to calculate all that.