1516X Push Back
1.0
1516X's robot code for the 2025-2026 VEX Robotics Competition
Toggle main menu visibility
Loading...
Searching...
No Matches
RCL.cpp
Go to the documentation of this file.
1
// Copyright 2026 California High Robotics, Team 1516X
2
// SPDX-License-Identifier: GPL-3.0-or-later
3
4
#include "RCL.h"
5
#include "distanceReset.h"
6
#include "globals.h"
7
8
RCL_Controller
rcl
;
9
10
void
RCL_Controller::start() {
11
if
(running.exchange(
true
)) {
12
return
;
13
}
14
15
task = std::make_unique<pros::Task>([
this
]() {
16
const
double
alpha = 0.1;
17
18
while
(running) {
19
distancePose
targetXY =
distanceReset
(
false
,
true
, 2, 10);
20
21
lemlib::Pose currentPose =
chassis
.getPose();
22
23
float
newX = currentPose.x + alpha * (targetXY.
x
- currentPose.x);
24
float
newY = currentPose.y + alpha * (targetXY.
y
- currentPose.y);
25
26
chassis
.setPose({newX, newY, currentPose.theta});
27
pros::delay(50);
28
}
29
},
"RCL Task"
);
30
}
31
32
void
RCL_Controller::end() {
33
if
(running.exchange(
false
)) {
34
pros::delay(60);
35
}
36
}
rcl
RCL_Controller rcl
Definition
RCL.cpp:8
distanceReset
distancePose distanceReset(bool setPose=false, bool filter=true, float filter_range=3.5, float heading_tolerance=40.0)
Definition
distanceReset.cpp:191
chassis
Chassis chassis(drivebase, lateral_controller, angular_controller, sensors, &throttle_curve, &steer_curve)
distancePose
Definition
distanceReset.cpp:37
distancePose::x
double x
Definition
distanceReset.cpp:38
distancePose::y
double y
Definition
distanceReset.cpp:39
src
localization
RCL.cpp
Generated on
for 1516X Push Back by
1.17.0