Hello. everyone.
I am doing research about quadcopter position control based on GPS coordinates.
I am using pixhawk4 mini for flight control.
I have a landing target in a distance from the quadcopter and it subscribes the target’s GPS coordinates(latitude, longitude).
I used “/mavros/setpoint_raw/global”, GlobalPositionTarget,
self.sp_glob = GlobalPositionTarget()
# self.sp_glob.header.stamp = rospy.get_time()
self.sp_glob.header.frame_id = 'map'
self.sp_glob.type_mask = int('111111111000', 2)
self.sp_glob.coordinate_frame = 6
self.sp_glob.latitude = 0
self.sp_glob.longitude = 0
self.sp_glob.altitude = 0
I used latitude, longitude from Raspberry Pi (ex 37.xxxxx, 132.xxxx)
and altitude value of 5 or 10m.
But when I published message through python code, The Drone moved to the right latitude and longitude, But just crushed to the ground.
How can I solve this problem?
Should I have to change the value of altitude? (The drone skyrocketed when I used the value of 150, and the MSL of home position was 150~160m)
Or should I have to consider the frame of GlobalPositionTarget() message type?
Here is the log file
https://logs.px4.io/plot_app?log=b1142e0d-eb96-47ed-9fe3-c810d3ecef0f
And the full codes.
Quadcopter skyrockets when I publish "mavros/setpoint_raw/global"