can you please explain how to get altitude measurement from pressure data from the sensor
The equation to convert barometric pressure to altitude, derived from the first principles, is as shown below.
this should work well for relative altitude measurements. you need to know the current environmental lapse rate. the equation assumes the atmosphere to have a constant lapse rate.