I have two point A and B, where A is lat, long of drone takeoff and B is lat log of goal target, now i have a senario i do the mission from takeoff(A) to target(B) in gazebo simulation and recored the gps data in a bag file, now i swtich to real drone which have bag file of simulated drone gps data now the drone follow the exact mission from exact coordinate as was in sumulation. Now, during real flight, while the drone is cursing and taking sensor value from GPS if it detects any jamming or getting miscalculated value during that if i shift the GPS data from the GPS sensor to the bag recorded GPS sensor, which was the exact same mission, will it work?
Very likely not. The position of the satellites in the sky has changed. I don’t precisely know what data is in the log you are using but it will relay on a “sky setup” that is no longer in place.
This will likely not work as stated in the previous reply. You are implicitly assuming that the UAV in real flight is behaving exactly like in simulation which is not the case. First, in simulation you are using a model which will not correspond exactly to your real drone (consider for example small imperfections in your hardware setups). Second, noise in sensors like IMU in simulation will not corresponds to what is on the real drone. Finally, your real UAV is subject to external disturbances (i.e. small wind gusts).