MCPcopy Create free account
hub / github.com/ecto/muni / encode_pose

Function encode_pose

depot/sim-bridge/src/can_protocol.rs:50–57  ·  view source on GitHub ↗

Serialize a pose update for TCP wire. Returns: type(0x02) + x(f64 LE) + y(f64 LE) + theta(f64 LE)

(x: f64, y: f64, theta: f64)

Source from the content-addressed store, hash-verified

48/// Serialize a pose update for TCP wire.
49/// Returns: type(0x02) + x(f64 LE) + y(f64 LE) + theta(f64 LE)
50pub fn encode_pose(x: f64, y: f64, theta: f64) -> Vec<u8> {
51 let mut buf = Vec::with_capacity(25);
52 buf.push(MSG_POSE);
53 buf.extend_from_slice(&x.to_le_bytes());
54 buf.extend_from_slice(&y.to_le_bytes());
55 buf.extend_from_slice(&theta.to_le_bytes());
56 buf
57}
58
59/// Parse the next message from a byte buffer.
60/// Returns (message, bytes_consumed) or None if incomplete.

Callers 1

run_rover_sessionFunction · 0.85

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected