0
0
Drone Programmingprogramming~10 mins

Software-In-The-Loop (SITL) concept in Drone Programming - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to start the SITL simulator.

Drone Programming
sitl = dronekit_sitl.SITL()
sitl.[1]()
Drag options to blanks, or click blank then click option'
Astart
Brun
Claunch
Dinit
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'run' instead of 'start' causes an attribute error.
Using 'launch' is not a valid method here.
2fill in blank
medium

Complete the code to connect to the vehicle using SITL.

Drone Programming
vehicle = connect('[1]', wait_ready=True)
Drag options to blanks, or click blank then click option'
Ahttp://localhost:8080
Budp:127.0.0.1:14550
Cserial:/dev/ttyUSB0:57600
Dtcp:127.0.0.1:5760
Attempts:
3 left
💡 Hint
Common Mistakes
Using TCP or serial connection strings will not connect to SITL.
HTTP is not used for vehicle connection here.
3fill in blank
hard

Fix the error in the code to stop the SITL simulator.

Drone Programming
sitl.[1]()
Drag options to blanks, or click blank then click option'
Aterminate
Bshutdown
Cclose
Dstop
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'shutdown' or 'terminate' causes attribute errors.
Using 'close' is not defined for SITL.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that maps vehicle modes to descriptions if the mode name length is greater than 4.

Drone Programming
mode_descriptions = {mode: desc for mode, desc in modes.items() if len(mode) [1] [2]
Drag options to blanks, or click blank then click option'
A>
B==
C4
D3
Attempts:
3 left
💡 Hint
Common Mistakes
Using '==' instead of '>' changes the filter logic.
Using 3 instead of 4 changes the length condition.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps uppercase mode names to their descriptions only if the description length is greater than 10.

Drone Programming
filtered_modes = {mode[1]: desc for mode, desc in modes.items() if len(desc) [2] [3]
Drag options to blanks, or click blank then click option'
A.upper()
B>
C10
D.lower()
Attempts:
3 left
💡 Hint
Common Mistakes
Using '.lower()' instead of '.upper()' changes the case.
Using '<' instead of '>' changes the filter condition.