41103C 26/27
Documentation for 41103C 1/3 for the 2026/2027 Vex V5 Season Override
Loading...
Searching...
No Matches
movetopoint.hpp
1// doesn't work well but can be used for straight line movements and basic turning
2
3#pragma once
4// Set to true if the robot moves BACKWARD when moveToPoint is called
5// Set to false if the robot moves FORWARD (normal)
6extern bool AUTON_REVERSED;
7
8// Pose: represents a target position based on tracking wheel measurements
9struct Pose {
10 float x; // target VERT (vertical wheel) position in inches
11 float y; // target HORZ (horizontal wheel) position in inches
12 float heading; // heading in radians (for reference only)
13
14 Pose(void) : x(0), y(0), heading(0) {}
15 Pose(float x, float y) : x(x), y(y), heading(0) {}
16 Pose(float x, float y, float heading) : x(x), y(y), heading(heading) {}
17};
18
19/*
20 * Simple straight-line movement to a target using tracking wheels
21 * Goes FORWARD by default (set AUTON_REVERSED = true to reverse)
22 * vert: target vertical wheel position in inches
23 * horz: target horizontal wheel position in inches
24 * maxPower: maximum motor power (-127 to 127)
25 * heading: target heading in radians (0 = no heading control, just move forward/backward)
26 */
27void moveToPoint(float vert, float horz, int maxPower = 80, float heading = 0.0f);
28
29// Print current tracking wheel pos to brain screen
30void printCurrentPosition(void);