# rover_commands.rs — Rover Science Commands

<p class="callout warning">This file is work in progress</p>

These commands are called by the frontend to request measurements or send data to the rover. All four are currently partially stubbed — they simulate a 1-second rover response delay and return dummy values, but the actual UDP dispatch logic is ready to be wired in.

**`<strong class="editor-theme-bold editor-theme-code">request_coordinates() → (i16, i16)</strong>`**<span style="white-space: pre-wrap;"> Requests the rover's current GPS coordinates. Returns a </span>`<span class="editor-theme-code">(latitude, longitude)</span>`<span style="white-space: pre-wrap;"> tuple.</span>

**`<strong class="editor-theme-bold editor-theme-code">request_weight() → i16</strong>`**<span style="white-space: pre-wrap;"> Requests the weight of a collected rock sample from the rover's load cell. Returns a weight value in grams.</span>

**`<strong class="editor-theme-bold editor-theme-code">request_measurement(camera1, x1, y1, camera2, x2, y2) → i16</strong>`**<span style="white-space: pre-wrap;"> Requests a stereo distance measurement. The frontend passes two pixel coordinates (one per camera) and the rover computes the real-world distance to that point. Returns the distance in a unit TBD.</span>

**`<strong class="editor-theme-bold editor-theme-code">send_pixel(camera, x, y)</strong>`**<span style="white-space: pre-wrap;"> Sends a single pixel coordinate from the frontend to the rover (e.g. operator clicking on an object in the video feed). Used to direct the rover's attention or arm toward a specific point in the image.</span>