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

Swerve Setpoint Generator causing std::out_of_range error. #1055

Open
boltsforcup opened this issue Feb 8, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@boltsforcup
Copy link

After properly configuring the RobotConig and Swerve Setpoint Generator, I attempt to call the method generateSetpoint in my Drive method, but when called after the robot is enabled, it throws a runtime error with the following message:
 vector::_M_range_check: __n (which is 2) >= this->size() (which is 2) 
 terminate called after throwing an instance of 'std::out_of_range' 
 what(): vector::_M_range_check: __n (which is 2) >= this->size() (which is 2) 

To Reproduce
Steps to reproduce the behavior:
Initialize and create everything as outlined in the docs here.
Deploy and enable the program and the error should immediately be thrown.

Expected behavior
No error should be thrown, and the new setpoint should be created and used to drive the robot.

Screenshots
This is where the next setpoint is generated:

Image

And this is the definition of SetModuleStates:

Image

Versions:

  • OS: Windows 11
  • GUI Version: 2024.2.2
  • PPLib Version: 2024.2.3
  • PPLib Language: C++
@boltsforcup boltsforcup added the bug Something isn't working label Feb 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant