PX4 SITL vs actual flight

After a good deal of work, I came up with an algorithm for drone guidance. It works unbelievably well on gazebo running px4 sitl with iris model.

Will the actual flight using a quadcopter give similar result?

@BossHater It largely depends on what aspect you are looking for, but in my experience, the SITL is fairly accurate as long as you don’t reach high speeds.

This video is a comparison between SITL and real world flight of a drone following a circular trajectory.

Thank you for the quick response!
I will be flight testing on Tuesday. Will let you know the result.

@Jaeyoung-Lim I could not do the flight test due to some reasons.

Can you please help me with one more issue. In lab, when I was testing MAVROS, I found that the x and y values of local position varies a lot while the drone is held on table. X varies from -10 to +10, and Y position varies from -5 to +5.

Is it the standard case or can I tune some parameters to improve the accuracy?

@BossHater What are the units of your variations?

I was monitoring/mavros/local_position/pose.
It is in metres, right?

@BossHater It is in meters. How are you getting the position information to the flight controller?

I have a GPS module and IMU. I am ising PX4 Stack. So I assume, there is a EKF filter in place.

My commands to drone is target attitude and thrust, computed based on position data.

@BossHater Your GPS data is not available if you are receiving from inside the lab I believe that is the reason you have high variance in position

I tried to run my code on the drone. Unfortunately, it didnot respond to /mavros/setpoint_raw/attitude.
It is responding to velocity and position commands.

Any idea why?

@BossHater It shouldn’t be the case. Have you set the correct flags?

I set the type_mask to 1.
Is it sufficient?

@BossHater If you want to ignore the roll rate, I guess so.

Do I have to edit something in px4_config.yaml for enabling attitude control?