1- #!/usr/bin/env python3
2- '''waypoint command handling'''
1+ '''
2+ waypoint command handling
3+
4+ AP_FLAKE8_CLEAN
5+ '''
36
47from MAVProxy .modules .lib import mission_item_protocol
58from MAVProxy .modules .lib import mp_util
@@ -233,15 +236,14 @@ def get_default_frame(self):
233236 return mavutil .mavlink .MAV_FRAME_GLOBAL_TERRAIN_ALT
234237 return mavutil .mavlink .MAV_FRAME_GLOBAL_RELATIVE_ALT
235238
236-
237239 def get_WP0 (self , home_only = False ):
238240 '''get a location for WP0 when building a mission
239241 this ideally should be home, but if home is not available then use a click position
240242 '''
241- (lat ,lon ,alt ) = (None ,None ,None )
243+ (lat , lon , alt ) = (None , None , None )
242244 if 'HOME_POSITION' in self .master .messages :
243245 h = self .master .messages ['HOME_POSITION' ]
244- (lat ,lon ,alt ) = (h .latitude * 1.0e-7 , h .longitude * 1.0e-7 , h .altitude * 1.0e-3 )
246+ (lat , lon , alt ) = (h .latitude * 1.0e-7 , h .longitude * 1.0e-7 , h .altitude * 1.0e-3 )
245247 elif home_only :
246248 return None
247249 elif self .wploader .count () > 0 :
@@ -250,7 +252,7 @@ def get_WP0(self, home_only=False):
250252 latlon = self .mpstate .click_location
251253 if latlon is None :
252254 return None
253- (lat ,lon ,alt ) = (latlon [0 ],latlon [1 ],0 )
255+ (lat , lon , alt ) = (latlon [0 ], latlon [1 ], 0 )
254256 if lat is None or lon is None :
255257 return None
256258 w = mavutil .mavlink .MAVLink_mission_item_message (self .target_system ,
@@ -259,13 +261,13 @@ def get_WP0(self, home_only=False):
259261 0 ,
260262 mavutil .mavlink .MAV_CMD_NAV_WAYPOINT ,
261263 0 , 0 , 0 , 0 , 0 , 0 ,
262- lat ,lon ,alt )
264+ lat , lon , alt )
263265 return w
264266
265267 def get_home (self ):
266268 '''get a location for home'''
267269 return self .get_WP0 (home_only = True )
268-
270+
269271 def wp_draw_callback (self , points ):
270272 '''callback from drawing waypoints'''
271273 if len (points ) < 2 :
0 commit comments