41103C 26/27
Documentation for 41103C 1/3 for the 2026/2027 Vex V5 Season Override
Loading...
Searching...
No Matches
odom.hpp
1#pragma once
2#include "api.h"
3#include "helpers.hpp"
4#include "main.h"
5
6extern std::atomic<float> HorizontalWheelPosition;
7extern std::atomic<float> VerticalWheelPosition;
8
9const float leftOdomOffsetInches = 1.9375f;
10const float rightOdomOffsetInches = 1.9375f;
11const float backOdomOffsetInches = 0.0f;
12
13const float inverseOffset = 1.0f / (leftOdomOffsetInches + rightOdomOffsetInches);
14
15const float radiusLeftIn = 2.0f;
16const float radiusRightIn = 2.0f;
17const float radiusBackIn = 2.0f;
18
19const float circLeftIn = radiusLeftIn * radiusLeftIn * PI;
20const float circRightIn = radiusRightIn * radiusRightIn * PI;
21const float circBackIn = radiusBackIn * radiusBackIn * PI;
22
23const float inv2Pi = 1.0f / (2.0f * PI);
24const float deg2rad = PI / 180.0f;
25const float convertFactor = /* 2 * PI / 130.0f */ 1.0f;
26
27void odomCalcPos(void);
28void odomCalcPos2(void);
29void odomGetPos(void);
30void odomReset(void);
31void brainScreenManager(void);
32
33extern std::atomic<float> globalHeading;
34extern std::atomic<float> globalHeadingAtLastReset;
35extern float prevGlobalHeading;
36
37extern float lastLeft;
38extern float lastRight;
39extern float lastBack;
40
41extern std::atomic<float> globalXIn;
42extern std::atomic<float> globalYIn;
43extern std::atomic<float> lastGlobalXIn;
44extern std::atomic<float> lastGlobalYIn;
45
46extern std::atomic<float> leftAtLastReset;
47extern std::atomic<float> rightAtLastReset;
48
49extern std::atomic<float> odomLeftPosRads;
50extern std::atomic<float> odomRightPosRads;
51extern std::atomic<float> odomBackPosRads;
52
53extern std::atomic<int> dist;