Complete the code to start the SITL simulator with the default plane model.
import dronekit_sitl sitl = dronekit_sitl.start_default([1])
The default plane model is started by specifying model='plane' in start_default().
Complete the code to connect to the SITL instance using the correct connection string.
from dronekit import connect connection_string = '[1]' vehicle = connect(connection_string, wait_ready=True)
The SITL simulator usually listens on UDP port 14550 on localhost, so the connection string is 'udp:127.0.0.1:14550'.
Fix the error in the code to properly stop the SITL simulator.
sitl = dronekit_sitl.start_default() # some code sitl.[1]()
shutdown() or terminate() which do not exist for SITL.The correct method to stop the SITL simulator is stop().
Fill both blanks to create a dictionary comprehension that maps each waypoint index to its latitude if latitude is greater than 0.
waypoint_dict = {i: wp[1] for i, wp in enumerate(waypoints) if wp[2] 0}We access the latitude with .lat and check if it is greater than 0 with >.
Fill all three blanks to create a dictionary comprehension that maps the uppercase waypoint name to its altitude if altitude is above 10.
altitude_map = [1]: [2] for wp in waypoints if wp.altitude [3] 10}
The key is the uppercase name wp.name.upper(), the value is wp.altitude, and the condition checks if altitude is greater than 10 with >.