Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨Tracking is now an std::function #247

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open

Conversation

ssejrog
Copy link
Member

@ssejrog ssejrog commented Dec 19, 2024

Summary:

Users can now make their own tracking functions.

Motivation:

With teams wanting to use MCL and VEXU teams using the sparkfun OTOS, EZ-Template needs a way to support custom tracking.

References (optional):

#246

Test Plan:

  • Run this code and ensure that XYT doesn't updating.
void new_tracking() {
  printf("custom tracking task\n");
}

void initialize() {
  // Print our branding over your terminal :D
  ez::ez_template_print();

  pros::delay(500);  // Stop the user from doing anything while legacy ports configure

  chassis.odom_tracking_set(new_tracking);
  // . . .
  • Comment out the line of code below and ensure XYT does update.
// chassis.odom_tracking_set(new_tracking);
  • Ensure that setting a custom XYT actually works
void new_tracking() {
  chassis.odom_current.x = something;
  chassis.odom_current.y = something;
  chassis.odom_current.theta = chassis.drive_imu_get();
}

void initialize() {
  // Print our branding over your terminal :D
  ez::ez_template_print();

  pros::delay(500);  // Stop the user from doing anything while legacy ports configure

  chassis.odom_tracking_set(new_tracking);
  // . . .

Download the template for this pull request:

Note

This is auto generated from Add Template to Pull Request

curl -o [email protected]+3e584a.zip https://nightly.link/EZ-Robotics/EZ-Template/actions/artifacts/2341902030.zip;
pros c fetch [email protected]+3e584a.zip;
pros c apply [email protected]+3e584a;
rm [email protected]+3e584a.zip;

@ssejrog ssejrog changed the title Tracking is now an std::function ✨Tracking is now an std::function Jan 2, 2025
@ssejrog
Copy link
Member Author

ssejrog commented Jan 2, 2025

Examples tested and work, ready to merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant