pub struct ControlMessage {
pub team: Team,
pub robot_id: u8,
pub shoot_mode: ShootMode,
pub trigger_mode: TriggerMode,
pub body_x: i16,
pub body_y: i16,
pub body_w: i16,
pub dribbler_speed: i8,
pub kick_strength: u8,
pub role: u8,
pub mode: Mode,
}Expand description
The Control Message is Sent from the Base Station to the Robots.
The Packed Format of this message is as follows: +———+———+———+———+———+———+———+———+ | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | +———+———+———+———+———+———+———+———+ | team | robot id | shoot_m | trigger_mode | +———+———+———+———+———+———+———+———+ | body_x (lsb) | +———+———+———+———+———+———+———+———+ | body_x (msb) | +———+———+———+———+———+———+———+———+ | body_y (lsb) | +———+———+———+———+———+———+———+———+ | body_y (msb) | +———+———+———+———+———+———+———+———+ | body_w (lsb) | +———+———+———+———+———+———+———+———+ | body_w (msb) | +———+———+———+———+———+———+———+———+ | dribbler_speed | +———+———+———+———+———+———+———+———+ | kick_strength | +———+———+———+———+———+———+———+———+ | role | mode | +———+———+———+———+———+———+———+———+
Size = 80 Bits = 10 Bytes
Fields§
§team: TeamTeam of the Robot (0: Blue) (1: Yellow)
robot_id: u8Id of the Robot
shoot_mode: ShootModeMode of kicking for the robot
trigger_mode: TriggerModeTrigger Mode for the Robot (TODO: Finish Docs)
body_x: i16X Coordinate of the Robot’s Body Frame (multiplied by VELOCITY_SCALE_FACTOR and truncated)
body_y: i16Y Coordinate of the Robot’s Body Frame (multiplied by VELOCITY_SCALE_FACTOR and truncated)
body_w: i16W Coordinate of the Robot’s Body Frame (multiplied by VELOCITY_SCALE_FACTOR and truncated))
dribbler_speed: i8Speed of the dribbler (TODO: Determine Units)
kick_strength: u8Strength of the kicker on kick (TODO: Determine Units)
role: u8Role of This Robot (TODO: Finish Docs)
mode: ModeThe mode of the robot
Implementations§
Source§impl ControlMessage
impl ControlMessage
Sourcepub fn get_velocity(&self) -> Vector3<f32>
pub fn get_velocity(&self) -> Vector3<f32>
Get the velocity (x, y, w) from the control message in a vector
Trait Implementations§
Source§impl Clone for ControlMessage
impl Clone for ControlMessage
Source§fn clone(&self) -> ControlMessage
fn clone(&self) -> ControlMessage
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ControlMessage
impl Debug for ControlMessage
Source§impl Packable for ControlMessage
impl Packable for ControlMessage
Source§impl PartialEq for ControlMessage
impl PartialEq for ControlMessage
impl Copy for ControlMessage
impl Eq for ControlMessage
impl StructuralPartialEq for ControlMessage
Auto Trait Implementations§
impl Freeze for ControlMessage
impl RefUnwindSafe for ControlMessage
impl Send for ControlMessage
impl Sync for ControlMessage
impl Unpin for ControlMessage
impl UnwindSafe for ControlMessage
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§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).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.