[−][src]Struct ds::DriverStation
Represents a connection to the roboRIO acting as a driver station
This struct will contain relevant functions to update the state of the robot, and also manages the threads that manage network connections and joysticks
Methods
impl DriverStation
[src]
pub fn new_team(team_number: u32, alliance: Alliance) -> DriverStation
[src]
pub fn new(ip: &str, team_number: u32, alliance: Alliance) -> DriverStation
[src]
Creates a new driver station for the given alliance station and team number
Connects to the roborio at ip
. To infer the ip from team_number, use new_team
instead.
pub fn connected(&self) -> Result<bool>
[src]
Queries subthreads to see if this DriverStation is currently connected to a roboRIO
pub fn set_joystick_supplier(
&mut self,
supplier: impl Fn() -> Vec<Vec<JoystickValue>> + Send + Sync + 'static
)
[src]
&mut self,
supplier: impl Fn() -> Vec<Vec<JoystickValue>> + Send + Sync + 'static
)
Provides a closure that will be called when constructing outbound packets to append joystick values
pub fn set_tcp_consumer(
&mut self,
consumer: impl FnMut(TcpPacket) + Send + Sync + 'static
)
[src]
&mut self,
consumer: impl FnMut(TcpPacket) + Send + Sync + 'static
)
pub fn set_alliance(&mut self, alliance: Alliance)
[src]
Changes the alliance for the given DriverStation
pub fn set_mode(&mut self, mode: Mode)
[src]
Changes the given mode
the robot will be in
pub fn set_game_specific_message(&mut self, message: &str) -> Result<()>
[src]
Sets the game specific message sent to the robot, and used during the autonomous period
pub fn mode(&self) -> Mode
[src]
Returns the current mode of the robot
pub fn enable(&mut self)
[src]
Enables outputs on the robot
pub fn restart_code(&mut self)
[src]
Instructs the roboRIO to restart robot code
pub fn restart_roborio(&mut self)
[src]
Instructs the roboRIO to reboot
pub fn enabled(&self) -> bool
[src]
Returns whether the robot is currently enabled
pub fn trace(&self) -> Trace
[src]
Returns the last received Trace from the robot
pub fn battery_voltage(&self) -> f32
[src]
Returns the last received battery voltage from the robot
pub fn queue_udp(&mut self, udp_tag: UdpTag)
[src]
Queues a UDP tag to be transmitted with the next outbound packet to the roboRIO
pub fn udp_queue(&self) -> Vec<UdpTag>
[src]
Returns a Vec of the current contents of the UDP queue
pub fn queue_tcp(&mut self, tcp_tag: TcpTag)
[src]
Queues a TCP tag to be transmitted to the roboRIO
pub fn tcp_queue(&self) -> Vec<TcpTag>
[src]
Returns a Vec of the current contents of the TCP queue
pub fn estop(&mut self)
[src]
Disables outputs on the robot and disallows enabling it until the code is restarted.
pub fn estopped(&self) -> bool
[src]
Returns whether the robot is currently E-stopped
pub fn disable(&mut self)
[src]
Disables outputs on the robot
Trait Implementations
impl Drop for DriverStation
[src]
Auto Trait Implementations
impl Send for DriverStation
impl Sync for DriverStation
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,