Hello, does anyone know how to solve these errors:
GF: upload failed: Generic error / not accepting mission commands at all right now.
GF: upload failed: Coordinate frame is not supported.
I’m using Mavros, a Mocap System to estimate position and i want to send a Polygon Fence in Local Frame NED.
I initially run these commands:
- roslaunch mavros apm.launch
- roslaunch mocap_optitrack mocap.launch
- rosrun topic_tools relay /mocap_node/cialdellaMav/pose /mavros/vision_pose/pose
- I’m able to see /mavros/local_position/pose (because I’ve enabled “vision_pose_estimate” plugin in apm_pluginlists.yaml included in mavros package)
But then i wrote this code to create a polygon fence through mavros services (Waypoint) and i obtain those errors.
#!/usr/bin/env python3
import rospy
from mavros_msgs.msg import Waypoint
from mavros_msgs.srv import WaypointPush, WaypointClear
rtl_command = 5000
vertex_inclusion_command = 5001
frame = 1
def create_polygon():
waypoint_clear()
wl = []
# Return Point (Home = Center of the polygon)
wp = Waypoint()
wp.frame = frame
wp.command = rtl_command
wp.is_current = False
wp.autocontinue = True
wp.param1 = 0
wp.param2 = 0
wp.param3 = 0
wp.param4 = 0
wp.x_lat = 0.25
wp.y_long = 1.0
wp.z_alt = 0
wl.append(wp)
# First Vertex Waypoint
wp = Waypoint()
wp.frame = frame
wp.command = vertex_inclusion_command
wp.is_current = False
wp.autocontinue = True
wp.param1 = 0
wp.param2 = 0
wp.param3 = 0
wp.param4 = 0
wp.x_lat = 1
wp.y_long = 2.5
wp.z_alt = 0
wl.append(wp)
# Second Vertex
wp = Waypoint()
wp.frame = frame
wp.command = vertex_inclusion_command
wp.is_current = False
wp.autocontinue = True
wp.param1 = 0
wp.param2 = 0
wp.param3 = 0
wp.param4 = 0
wp.x_lat = -0.5
wp.y_long = 2.5
wp.z_alt = 0
wl.append(wp)
# Third Vertex
wp = Waypoint()
wp.frame = frame
wp.command = vertex_inclusion_command
wp.is_current = False
wp.autocontinue = True
wp.param1 = 0
wp.param2 = 0
wp.param3 = 0
wp.param4 = 0
wp.x_lat = -0.5
wp.y_long = -0.3
wp.z_alt = 0
wl.append(wp)
# Fourth Vertex
wp = Waypoint()
wp.frame = frame
wp.command = vertex_inclusion_command
wp.is_current = False
wp.autocontinue = True
wp.param1 = 0
wp.param2 = 0
wp.param3 = 0
wp.param4 = 0
wp.x_lat = 1
wp.y_long = -0.3
wp.z_alt = 0
wl.append(wp)
# Fifth Vertex (N) = First Vertex (1)
wp = Waypoint()
wp.frame = frame
wp.command = vertex_inclusion_command
wp.is_current = False
wp.autocontinue = True
wp.param1 = 0
wp.param2 = 0
wp.param3 = 0
wp.param4 = 0
wp.x_lat = 1
wp.y_long = 2.5
wp.z_alt = 0
wl.append(wp)
# print(wl)
try:
# service = handle for calling the service
service = rospy.ServiceProxy('mavros/geofence/push', WaypointPush, persistent=True)
service = service.call(waypoints=wl)
if service.success:
print('Polygon Fence Write Success')
else:
print('Polygon Fence Write Fail')
except rospy.ServiceException as e:
print("Service call failed: %s" % e)
def waypoint_clear():
try:
response = rospy.ServiceProxy(‘mavros/geofence/clear’, WaypointClear)
return response.call().success
except rospy.ServiceException as e:
print(“Service call failed: %s” % e)
return False
if name == ‘main’:
rospy.init_node(‘polygon_node’, anonymous=True)
create_polygon()
I tried a lot of “frame” in ENUM MAV_FRAME and I’ve also tried to send these messages by publishing on “mavros/geofence/waypoints” topic or by sending Mavlink messages but with no success.
Please help me. Thansk in advance.