pub struct FrequentServerToRobot {Show 24 fields
pub grid: StandardGrid,
pub target_velocity: VelocityControl,
pub motors_override: [Option<f32>; 3],
pub pwm_override: [[Option<u16>; 2]; 3],
pub motor_config: [[usize; 2]; 3],
pub encoder_config: [(usize, bool); 3],
pub dist_sensor_config: [usize; 4],
pub pid: [f32; 3],
pub cv_location: Option<Point2<i8>>,
pub localization_algorithm: LocalizationAlgorithmSource,
pub target_path: Vec<Point2<i8>, MAX_ROBOT_PATH_LENGTH>,
pub follow_target_path: bool,
pub angle_offset: f32,
pub lookahead_dist: f32,
pub robot_speed: f32,
pub snapping_dist: f32,
pub cv_error: f32,
pub enable_imu: bool,
pub enable_extra_imu_data: bool,
pub enable_dists: bool,
pub enable_battery_monitor: bool,
pub enable_display: bool,
pub enable_gamepad: bool,
pub display_loop_interval: u64,
}Expand description
This is sent regularly and frequently to robots via ServerToRobotMessage::FrequentRobotItems
Holds information that may change often, or where low latency is critical. Its contents should be passed along as quickly as possible.
Fields§
§grid: StandardGridWhich grid is currently in use
target_velocity: VelocityControlOverall requested velocity of the robot, ex. using WASD or controller manual input
motors_override: [Option<f32>; 3]Requested velocity for each individual motor, forwards (+) or backwards (-), for testing
pwm_override: [[Option<u16>; 2]; 3]Requested output for each PWM pin, for testing
motor_config: [[usize; 2]; 3]Which pwm pin corresponds to which motor
Example: for the config [[0, 1], [5, 4], [2, 3]]:
- Raising the first physical pin (denoted
0) causes motor 0 to turn clockwise - Raising pin
1causes motor 0 to turn counter-clockwise - Raising pin
5causes motor 1 to turn clockwise 4-> motor 1 counter-clockwise2-> motor 2 clockwise3-> motor 2 counter-clockwise
encoder_config: [(usize, bool); 3]Which encoder belongs to which motor, and whether the encoder is reversed
dist_sensor_config: [usize; 4]The order of the distance sensors
pid: [f32; 3]Basic parameters for the PID controller
cv_location: Option<Point2<i8>>The grid cell the CV system thinks the robot is in
Not used when this struct functions as a configuration in server settings
localization_algorithm: LocalizationAlgorithmSourceWhat localization strategy the robot should use
target_path: Vec<Point2<i8>, MAX_ROBOT_PATH_LENGTH>The points the robot should try to go to
follow_target_path: boolWhether the robot should try to follow the target path (including maintaining heading 0)
angle_offset: f32This angle should be considered angle 0
lookahead_dist: f32§robot_speed: f32§snapping_dist: f32§cv_error: f32§enable_imu: bool§enable_extra_imu_data: bool§enable_dists: bool§enable_battery_monitor: bool§enable_display: bool§enable_gamepad: bool§display_loop_interval: u64Implementations§
Trait Implementations§
Source§impl Clone for FrequentServerToRobot
impl Clone for FrequentServerToRobot
Source§fn clone(&self) -> FrequentServerToRobot
fn clone(&self) -> FrequentServerToRobot
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FrequentServerToRobot
impl Debug for FrequentServerToRobot
Source§impl<'de> Deserialize<'de> for FrequentServerToRobot
impl<'de> Deserialize<'de> for FrequentServerToRobot
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>,
Source§impl PartialEq for FrequentServerToRobot
impl PartialEq for FrequentServerToRobot
Source§impl PartialOrd for FrequentServerToRobot
impl PartialOrd for FrequentServerToRobot
Source§impl Serialize for FrequentServerToRobot
impl Serialize for FrequentServerToRobot
impl StructuralPartialEq for FrequentServerToRobot
Auto Trait Implementations§
impl Freeze for FrequentServerToRobot
impl RefUnwindSafe for FrequentServerToRobot
impl Send for FrequentServerToRobot
impl Sync for FrequentServerToRobot
impl Unpin for FrequentServerToRobot
impl UnwindSafe for FrequentServerToRobot
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
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.