pub enum SimulatorMessage {
ControllerUpdate(Option<ControllerState>, Option<ControllerState>),
LcdButtonsUpdate([bool; 3]),
PhaseChange(CompetitionPhase),
}
Expand description
A message sent to the simulator to control the robot code environment.
The pros-simulator
API accepts these over an async stream, and API consumers can use
them to simulate changes in robot hardware (like controller input and LCD touch events).
Variants§
ControllerUpdate(Option<ControllerState>, Option<ControllerState>)
Master and Partner controllers have updated (in that order). None = disconnected.
LcdButtonsUpdate([bool; 3])
An LCD button has been pressed/released. The 3 booleans represent whether each button is being pressed, from left to right. This API technically supports pressing multiple buttons at once, but that won’t ever happen on a real robot.
PhaseChange(CompetitionPhase)
The robot has switched competition modes (opcontrol or autonomous or disabled).
Trait Implementations§
Source§impl Clone for SimulatorMessage
impl Clone for SimulatorMessage
Source§fn clone(&self) -> SimulatorMessage
fn clone(&self) -> SimulatorMessage
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for SimulatorMessage
impl Debug for SimulatorMessage
Source§impl<'de> Deserialize<'de> for SimulatorMessage
impl<'de> Deserialize<'de> for SimulatorMessage
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for SimulatorMessage
impl PartialEq for SimulatorMessage
Source§impl Serialize for SimulatorMessage
impl Serialize for SimulatorMessage
impl Eq for SimulatorMessage
impl StructuralPartialEq for SimulatorMessage
Auto Trait Implementations§
impl Freeze for SimulatorMessage
impl RefUnwindSafe for SimulatorMessage
impl Send for SimulatorMessage
impl Sync for SimulatorMessage
impl Unpin for SimulatorMessage
impl UnwindSafe for SimulatorMessage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more