VRAD Martian Survival User Guide 2021-22

Appendix A: Documentation

A.1 What is Python Python is a general purpose programming language. Python is a very versatile language which is famous for its simple programming syntax, code readability and English-like commands which make coding in Python very easy and efficient. Python is used for many different things such as web development, AI, machine learning, operating systems, mobile application development, robotics and video games. The VRAD Martian Survival competition features an in-browser python code editor which allows you to program your drones using the Python programming language.

A.2 Importing Modules

There are four drones that can be programmed in VRAD, drone1, drone2, drone3, drone4.

Modules can be imported with the following code at the top of your script:

import drone1 # import drone1 module import drone2 # import drone2 module import drone3 # import drone3 module import drone4 # import comms module

import currentDrone # import currentDrone module

import VRADDrone # import VRRADDrone module

VRADDrone is used for static functions:

Static functions: bool VRADDrone.take_control(id) - Sets the camera to focus on the specified drone. If you take control of an RC drone, you will be able to control it with the keyboard now

21

Made with FlippingBook HTML5