mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-21 01:12:11 +00:00
CI: remove old mission formats
This commit is contained in:
committed by
Daniel Agar
parent
e9c7023083
commit
4158b5e6a9
@@ -50,7 +50,6 @@ import os
|
|||||||
import px4tools
|
import px4tools
|
||||||
import sys
|
import sys
|
||||||
from mavros import mavlink
|
from mavros import mavlink
|
||||||
from mavros.mission import QGroundControlWP
|
|
||||||
from mavros_msgs.msg import Mavlink, Waypoint, WaypointReached
|
from mavros_msgs.msg import Mavlink, Waypoint, WaypointReached
|
||||||
from mavros_test_common import MavrosTestCommon
|
from mavros_test_common import MavrosTestCommon
|
||||||
from pymavlink import mavutil
|
from pymavlink import mavutil
|
||||||
@@ -71,26 +70,12 @@ def get_last_log():
|
|||||||
def read_mission(mission_filename):
|
def read_mission(mission_filename):
|
||||||
wps = []
|
wps = []
|
||||||
with open(mission_filename, 'r') as f:
|
with open(mission_filename, 'r') as f:
|
||||||
mission_filename_ext = os.path.splitext(mission_filename)[1]
|
for waypoint in read_plan_file(f):
|
||||||
if mission_filename_ext == '.plan':
|
wps.append(waypoint)
|
||||||
for waypoint in read_plan_file(f):
|
rospy.logdebug(waypoint)
|
||||||
wps.append(waypoint)
|
|
||||||
rospy.logdebug(waypoint)
|
|
||||||
elif mission_filename_ext == '.mission':
|
|
||||||
for waypoint in read_mission_file(f):
|
|
||||||
wps.append(waypoint)
|
|
||||||
rospy.logdebug(waypoint)
|
|
||||||
elif mission_filename_ext == '.txt':
|
|
||||||
mission = QGroundControlWP()
|
|
||||||
for waypoint in mission.read(f):
|
|
||||||
wps.append(waypoint)
|
|
||||||
rospy.logdebug(waypoint)
|
|
||||||
else:
|
|
||||||
raise IOError("unknown mission file extension",
|
|
||||||
mission_filename_ext)
|
|
||||||
|
|
||||||
# set first item to current
|
# set first item to current
|
||||||
if wps[0]:
|
if wps:
|
||||||
wps[0].is_current = True
|
wps[0].is_current = True
|
||||||
|
|
||||||
return wps
|
return wps
|
||||||
@@ -122,27 +107,6 @@ def read_plan_file(f):
|
|||||||
else:
|
else:
|
||||||
raise IOError("no mission items")
|
raise IOError("no mission items")
|
||||||
|
|
||||||
|
|
||||||
def read_mission_file(f):
|
|
||||||
d = json.load(f)
|
|
||||||
if 'items' in d:
|
|
||||||
for wp in d['items']:
|
|
||||||
yield Waypoint(
|
|
||||||
is_current=False,
|
|
||||||
frame=int(wp['frame']),
|
|
||||||
command=int(wp['command']),
|
|
||||||
param1=float(wp['param1']),
|
|
||||||
param2=float(wp['param2']),
|
|
||||||
param3=float(wp['param3']),
|
|
||||||
param4=float(wp['param4']),
|
|
||||||
x_lat=float(wp['coordinate'][0]),
|
|
||||||
y_long=float(wp['coordinate'][1]),
|
|
||||||
z_alt=float(wp['coordinate'][2]),
|
|
||||||
autocontinue=bool(wp['autoContinue']))
|
|
||||||
else:
|
|
||||||
raise IOError("no mission items")
|
|
||||||
|
|
||||||
|
|
||||||
class MavrosMissionTest(MavrosTestCommon):
|
class MavrosMissionTest(MavrosTestCommon):
|
||||||
"""
|
"""
|
||||||
Run a mission
|
Run a mission
|
||||||
|
|||||||
@@ -1,121 +0,0 @@
|
|||||||
{
|
|
||||||
"MAV_AUTOPILOT": 12,
|
|
||||||
"complexItems": [
|
|
||||||
],
|
|
||||||
"groundStation": "QGroundControl",
|
|
||||||
"items": [
|
|
||||||
{
|
|
||||||
"autoContinue": true,
|
|
||||||
"command": 22,
|
|
||||||
"coordinate": [
|
|
||||||
47.397739410400391,
|
|
||||||
8.5455904006958008,
|
|
||||||
5
|
|
||||||
],
|
|
||||||
"frame": 3,
|
|
||||||
"id": 1,
|
|
||||||
"param1": 15,
|
|
||||||
"param2": 0,
|
|
||||||
"param3": 0,
|
|
||||||
"param4": 0,
|
|
||||||
"type": "missionItem"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"autoContinue": true,
|
|
||||||
"command": 16,
|
|
||||||
"coordinate": [
|
|
||||||
47.397872924804688,
|
|
||||||
8.54559326171875,
|
|
||||||
5
|
|
||||||
],
|
|
||||||
"frame": 3,
|
|
||||||
"id": 2,
|
|
||||||
"param1": 0,
|
|
||||||
"param2": 0,
|
|
||||||
"param3": 0,
|
|
||||||
"param4": 0,
|
|
||||||
"type": "missionItem"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"autoContinue": true,
|
|
||||||
"command": 16,
|
|
||||||
"coordinate": [
|
|
||||||
47.397872924804688,
|
|
||||||
8.5453414916992188,
|
|
||||||
5
|
|
||||||
],
|
|
||||||
"frame": 3,
|
|
||||||
"id": 3,
|
|
||||||
"param1": 0,
|
|
||||||
"param2": 0,
|
|
||||||
"param3": 0,
|
|
||||||
"param4": 0,
|
|
||||||
"type": "missionItem"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"autoContinue": true,
|
|
||||||
"command": 16,
|
|
||||||
"coordinate": [
|
|
||||||
47.397739410400391,
|
|
||||||
8.5453367233276367,
|
|
||||||
5
|
|
||||||
],
|
|
||||||
"frame": 3,
|
|
||||||
"id": 4,
|
|
||||||
"param1": 0,
|
|
||||||
"param2": 0,
|
|
||||||
"param3": 0,
|
|
||||||
"param4": 0,
|
|
||||||
"type": "missionItem"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"autoContinue": true,
|
|
||||||
"command": 16,
|
|
||||||
"coordinate": [
|
|
||||||
47.397739410400391,
|
|
||||||
8.5455904006958008,
|
|
||||||
5
|
|
||||||
],
|
|
||||||
"frame": 3,
|
|
||||||
"id": 5,
|
|
||||||
"param1": 0,
|
|
||||||
"param2": 0,
|
|
||||||
"param3": 0,
|
|
||||||
"param4": 0,
|
|
||||||
"type": "missionItem"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"autoContinue": true,
|
|
||||||
"command": 21,
|
|
||||||
"coordinate": [
|
|
||||||
47.397739410400391,
|
|
||||||
8.5455913543701172,
|
|
||||||
5
|
|
||||||
],
|
|
||||||
"frame": 3,
|
|
||||||
"id": 6,
|
|
||||||
"param1": 0,
|
|
||||||
"param2": 0,
|
|
||||||
"param3": 0,
|
|
||||||
"param4": 0,
|
|
||||||
"type": "missionItem"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"plannedHomePosition": {
|
|
||||||
"autoContinue": true,
|
|
||||||
"command": 16,
|
|
||||||
"coordinate": [
|
|
||||||
47.397806167602539,
|
|
||||||
8.5454649925231934,
|
|
||||||
0
|
|
||||||
],
|
|
||||||
"frame": 0,
|
|
||||||
"id": 0,
|
|
||||||
"param1": 0,
|
|
||||||
"param2": 0,
|
|
||||||
"param3": 0,
|
|
||||||
"param4": 0,
|
|
||||||
"type": "missionItem"
|
|
||||||
},
|
|
||||||
"version": "1.0"
|
|
||||||
}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
# New style transitions, takeoff not at home
|
|
||||||
QGC WPL 110
|
|
||||||
0 1 3 84 15.0 0 0 0 47.397731862593744 8.543269295853861 15.0 1
|
|
||||||
1 0 3 85 0.0 0.0 -0.0 0.0 47.39651890962795 8.5433217125134888 0.0 1
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
# New style transitions, takeoff at home
|
|
||||||
QGC WPL 110
|
|
||||||
0 1 3 84 15.0 0 0 0 47.397746387399621 8.5455920888607579 12.0 1
|
|
||||||
1 0 3 16 0.0 0.0 0.0 0.0 47.399093548895856 8.5455438069836305 12.0 1
|
|
||||||
2 0 3 85 0.0 0.0 -0.0 0.0 47.39903545 8.5432263800000001 0.0 1
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
# Old style transitions, takeoff and landing WPs away from home and last WP
|
|
||||||
QGC WPL 110
|
|
||||||
0 1 3 22 15.0 0 0 0 47.398046406687619 8.5458366721115908 12.0 1
|
|
||||||
1 0 2 3000 4 0.0 0.0 0.0 47.398033142089844 8.5457897186279297 12.0 1
|
|
||||||
2 0 3 16 0 0.0 0.0 0.0 47.399269104003906 8.5455722808837891 12.0 1
|
|
||||||
3 0 3 16 0 0.0 0.0 0.0 47.399281145681528 8.547910568913295 12.0 1
|
|
||||||
4 0 2 3000 3 0.0 0.0 0.0 47.397785186767578 8.545262336730957 12.0 1
|
|
||||||
5 0 3 21 25.0 0.0 0.0 0.0 47.398884865088675 8.547918116539563 12.0 1
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
# Old style transitions, takeoff WP at home location, landing WP at last WP location
|
|
||||||
QGC WPL 110
|
|
||||||
0 1 3 22 15.0 0 0 0 47.397740722711738 8.5455944102696719 12.0 1
|
|
||||||
1 0 2 3000 4 0.0 0.0 0.0 47.397732380000001 8.5458224099999995 12.0 1
|
|
||||||
2 0 3 16 0 0.0 0.0 0.0 47.397749067235559 8.5429755110031351 12.0 1
|
|
||||||
3 0 3 16 0 0.0 0.0 0.0 47.399213119631852 8.5430124879018479 12.0 1
|
|
||||||
4 0 2 3000 3 0.0 0.0 0.0 47.399158900000003 8.5429077299999996 12.0 1
|
|
||||||
5 0 3 21 25.0 0.0 0.0 0.0 47.399211883544922 8.5430123448444419 12.0 1
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
# Old style transitions, takeoff with normal WP
|
|
||||||
QGC WPL 110
|
|
||||||
0 1 3 16 15.0 0 0 0 47.398157669127094 8.5460336317115377 12.0 1
|
|
||||||
1 0 2 3000 4 0.0 0.0 0.0 47.398033142089844 8.5457897186279297 12.0 1
|
|
||||||
2 0 3 16 0 0.0 0.0 0.0 47.399269104003906 8.5455722808837891 12.0 1
|
|
||||||
Reference in New Issue
Block a user