Trait vex_rt::robot::Robot[][src]

pub trait Robot {
    fn new(peripherals: Peripherals) -> Self;

    fn initialize(&'static self, _ctx: Context) { ... }
fn autonomous(&'static self, _ctx: Context) { ... }
fn opcontrol(&'static self, _ctx: Context) { ... }
fn disabled(&'static self, _ctx: Context) { ... } }

A trait representing a competition-ready VEX Robot.

Required methods

fn new(peripherals: Peripherals) -> Self[src]

Runs at startup, constructing your robot. This should be non-blocking, since the FreeRTOS scheduler doesn’t start until it returns.

Loading content...

Provided methods

fn initialize(&'static self, _ctx: Context)[src]

Runs immediately after Robot::new. The FreeRTOS scheduler is running by this point.

The purpose of this method is to provide a hook to run things on startup which require a reference to all or part of the robot structure; since it takes &'static self as its parameter, the lifetime of the robot object is guaranteed to be static (i.e., forever), and so the implementation may pass references around (e.g., to new tasks) at will without issue.

fn autonomous(&'static self, _ctx: Context)[src]

Runs during the autonomous period.

fn opcontrol(&'static self, _ctx: Context)[src]

Runs during the opcontrol period.

fn disabled(&'static self, _ctx: Context)[src]

Runs when the robot is disabled.

Loading content...

Implementors

Loading content...