mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-01 02:55:07 +08:00
Old style exceptions are Python 3 syntax errors
This commit is contained in:
committed by
Daniel Agar
parent
bc35251799
commit
41516fbd55
@@ -108,7 +108,7 @@ def run_tidy(args, tmpdir, build_path, queue):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
subprocess.check_call(invocation, stdin=None, stdout=open(os.devnull, 'wb'), stderr=subprocess.STDOUT)
|
subprocess.check_call(invocation, stdin=None, stdout=open(os.devnull, 'wb'), stderr=subprocess.STDOUT)
|
||||||
except subprocess.CalledProcessError, e:
|
except subprocess.CalledProcessError as e:
|
||||||
sys.stdout.write(' '.join(invocation) + '\n')
|
sys.stdout.write(' '.join(invocation) + '\n')
|
||||||
subprocess.call(invocation)
|
subprocess.call(invocation)
|
||||||
global tidy_failures
|
global tidy_failures
|
||||||
|
|||||||
@@ -518,7 +518,7 @@ class OutputGraphviz(object):
|
|||||||
graph.edge('t_'+topic, 'm_'+module,
|
graph.edge('t_'+topic, 'm_'+module,
|
||||||
color=topic_colors[topic])
|
color=topic_colors[topic])
|
||||||
|
|
||||||
graph.render(file_name, view=False)
|
graph.render(file_name, view=False)
|
||||||
|
|
||||||
|
|
||||||
class OutputJSON(object):
|
class OutputJSON(object):
|
||||||
@@ -633,6 +633,3 @@ elif args.output == 'graphviz':
|
|||||||
output_graphviz.write(args.file+'_pubs.fv', show_subscriptions=False, engine=engine)
|
output_graphviz.write(args.file+'_pubs.fv', show_subscriptions=False, engine=engine)
|
||||||
else:
|
else:
|
||||||
print('Error: unknown output format '+args.output)
|
print('Error: unknown output format '+args.output)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -86,10 +86,10 @@ def read_mission_json(f):
|
|||||||
current = True
|
current = True
|
||||||
missionlist=[]
|
missionlist=[]
|
||||||
for wp in d['items']:
|
for wp in d['items']:
|
||||||
cmd = Command( 0, 0, 0, int(wp['frame']), int(wp['command']), current, int(wp['autoContinue']), float(wp['param1']), float(wp['param2']), float(wp['param3']), float(wp['param4']), float(wp['coordinate'][0]), float(wp['coordinate'][1]), float(wp['coordinate'][2]))
|
cmd = Command( 0, 0, 0, int(wp['frame']), int(wp['command']), current, int(wp['autoContinue']), float(wp['param1']), float(wp['param2']), float(wp['param3']), float(wp['param4']), float(wp['coordinate'][0]), float(wp['coordinate'][1]), float(wp['coordinate'][2]))
|
||||||
missionlist.append(cmd)
|
missionlist.append(cmd)
|
||||||
if current:
|
if current:
|
||||||
current = False
|
current = False
|
||||||
return missionlist
|
return missionlist
|
||||||
|
|
||||||
|
|
||||||
@@ -99,7 +99,7 @@ def upload_mission(aFileName):
|
|||||||
"""
|
"""
|
||||||
#Read mission from file
|
#Read mission from file
|
||||||
with open(aFileName) as f:
|
with open(aFileName) as f:
|
||||||
missionlist = read_mission_json(f)
|
missionlist = read_mission_json(f)
|
||||||
|
|
||||||
#Clear existing mission from vehicle
|
#Clear existing mission from vehicle
|
||||||
cmds = vehicle.commands
|
cmds = vehicle.commands
|
||||||
@@ -126,7 +126,7 @@ home_position_set = False
|
|||||||
@vehicle.on_message('MISSION_CURRENT')
|
@vehicle.on_message('MISSION_CURRENT')
|
||||||
def listener(self, name, mission_current):
|
def listener(self, name, mission_current):
|
||||||
global current_sequence, current_sequence_changed
|
global current_sequence, current_sequence_changed
|
||||||
if (current_sequence <> mission_current.seq):
|
if (current_sequence != mission_current.seq):
|
||||||
current_sequence = mission_current.seq;
|
current_sequence = mission_current.seq;
|
||||||
current_sequence_changed = True
|
current_sequence_changed = True
|
||||||
print('current mission sequence: %s' % mission_current.seq)
|
print('current mission sequence: %s' % mission_current.seq)
|
||||||
@@ -135,7 +135,7 @@ def listener(self, name, mission_current):
|
|||||||
@vehicle.on_message('EXTENDED_SYS_STATE')
|
@vehicle.on_message('EXTENDED_SYS_STATE')
|
||||||
def listener(self, name, extended_sys_state):
|
def listener(self, name, extended_sys_state):
|
||||||
global current_landed_state
|
global current_landed_state
|
||||||
if (current_landed_state <> extended_sys_state.landed_state):
|
if (current_landed_state != extended_sys_state.landed_state):
|
||||||
current_landed_state = extended_sys_state.landed_state;
|
current_landed_state = extended_sys_state.landed_state;
|
||||||
|
|
||||||
#Create a message listener for home position fix
|
#Create a message listener for home position fix
|
||||||
|
|||||||
Reference in New Issue
Block a user