Module#
Introduction#
The VEX AIR Drone features a Mission Module Port, which can slot in various VEX AIR Modules. These allow the drone to drop and hold different payloads. Only the Motorized Mission Module and Magnet Mission Module can be coded.
Below is a list of all available methods:
Actions
Getters
get_type – Returns the module type.
is_holding – Returns whether or not a payload is held.
Actions#
drop#
drop
releases the currently held payload.
The Motorized Mission Module will raise its hook releasing any hooked object.
The Magnet Mission Module will extend its lever and detach the payload from its magnet.
Usage:
drone.module.drop()
Parameters |
Description |
---|---|
This method has no parameters. |
# Example coming soon
hold#
hold
picks up the payload.
The Motorized Mission Module will lower its hook so objects can be attached.
The Magnet Mission Module does not do anything with this function.
Note: This method will prevent any commands after it from running for about one second.
Usage:
drone.module.hold()
Parameters |
Description |
---|---|
This method has no parameters. |
# Example coming soon
Getters#
get_type#
get_type
returns one of the following based on the current module:
DroneModuleType.HOOK
– The drone has the Motorized Mission Module.DroneModuleType.PASSIVE
– The drone has the Passive Mission Module.DroneModuleType.MAGNET
– The drone has the Magnet Mission Module.
Usage:
drone.module.get_type()
Parameters |
Description |
---|---|
This method has no parameters. |
# Example coming soon
is_holding#
is_holding
returns a Boolean indicating whether the drone’s module is currently in the holding state from drone.module.hold()
, or in the drop state from drone.module.drop()
. Note that this method only works with the Motorized Mission Module as the Magnet Mission Module will always display True and the Passive Mission Module does not interact with hold
and drop
.
True
– The drone is in the hold state.False
– The drone is in the drop state.
Usage:
drone.module.is_holding()
Parameters |
Description |
---|---|
This method has no parameters. |
drone.take_off(500)
# Use the controller use a Motorized Mission Module
while True:
if controller.button5.pressing():
drone.module.drop()
else if controller.button6.pressing():
drone.module.hold()
else:
wait(0.1, SECONDS)