Hello
I'm trying to move my drone to the GPS position(latitude, longitude, and altitude) I specified.
I'm using /mavros/setpoint_raw/global to publish specific GPS where the drone supposed to move to.
But when I experiment for the real drone, It only skyrockets.(It moves high up)
Following is my code.
Can anyone tell what's the problem?
Please focus on sp_glob, sp_glob_pub
!/usr/bin/env python
ROS python API
import rospy
3D point & Stamped Pose msgs
from geometry_msgs.msg import Point, PoseStamped #/opt/ros/melodic/share/geometry_msgs
import all mavros messages and services
from mavros_msgs.msg import
from mavros_msgs.srv import
from sensor_msgs.msg import NavSatFix
import a message from Raspberry pi CAMERA
Message name: /target_msg
from targetDetection_topic.msg import TargetPosition
Hello I'm trying to move my drone to the GPS position(latitude, longitude, and altitude) I specified. I'm using /mavros/setpoint_raw/global to publish specific GPS where the drone supposed to move to. But when I experiment for the real drone, It only skyrockets.(It moves high up) Following is my code. Can anyone tell what's the problem? Please focus on sp_glob, sp_glob_pub
!/usr/bin/env python
ROS python API
import rospy
3D point & Stamped Pose msgs
from geometry_msgs.msg import Point, PoseStamped #/opt/ros/melodic/share/geometry_msgs
import all mavros messages and services
from mavros_msgs.msg import from mavros_msgs.srv import from sensor_msgs.msg import NavSatFix
import a message from Raspberry pi CAMERA
Message name: /target_msg
from targetDetection_topic.msg import TargetPosition
import a message from Raspberry pi GPS
Message name: /Target_GPS_msg
from GPS_topic.msg import Target_GPS
Main function
Start
The sp_glob is as below.
header: seq: 0 stamp: secs: 0 nsecs: 0 frame_id: '' coordinate_frame: 6 type_mask: 1528 latitude: 37.4540748596 longitude: 126.951919556 altitude: 0 velocity: x: 0.0 y: 0.0 z: 0.0 acceleration_or_force: x: 0.0 y: 0.0 z: 0.0 yaw: 0.0 yaw_rate: 0.0
As you can see, we have latitude and longitude specified and zero altitude. Why does the drone goes high up instead of moving to the GPS position?