Inertial navigation system get relative position

from dronekit python , we can get the vehicle location, Is the vehicle.location relative takeoff position get from IMU accelerometer and gyroscope rather than GPS system? If not how to get the vehicle location relative takeoff position that get from IMU inertial navigation system

The local NED coordinates are relative to the take off position.

You can use those.

But the EKF fuses and corrects that information with GPS and magnetometer data.

So there is NO fully GPS independent odometry data.

Can I only use imu for navigation without gps,What are the risks?

I had try to control the movement of drone without GPS, it is sucess. But I not yet compare with GPS, I think it might have some error. And for long distance, it will cause error accumulation.

I tried to perform xy position control (disable gps, only use imu) in the fixed height mode, but it made an error in the simulation. I don’t know where to set except the problem. What important parameters need to be set? thank you

The documentation is your friend:

I have a code about noGPS that my friend writed, but I cannot share it on here due to some intellectual property. I can only tell you noGPS is using mode: GUIDE_NOGPS, and set the pitch/yaw/roll rate and angel, then also set the thrust