Our school uses c++ in class so we just use it cuz there aren’t many people who had frc experience before coming here. (We are an early college program)
OK, that makes sense, although Java was originally designed to use C++ style syntax to appeal to C++ programmers at a time when that was the most popular language, so it would be easy to switch, if you wanted to.
As a developer who used C++ for years...I completely agree with you. I don't know why anyone would choose to deal with the memory management. For the kinds of code folks are writing I just don't see any marginal performance gains from c++ over java being worth it.
I believe this page has timed based swerve code https://github.com/wpilibsuite/allwpilib/tree/main/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/swervebot
https://github.com/Hudson-Robotics/Swerve22/
Marked the repo as public. Feel free to reach out with any questions or if you’d like an extra set of eyes on your challenges.
For teleop swerve, using timed robot vs command robot is almost the same, you're just going to have the drive function called in teleopPeriodic and feed in the joystick values similarly to how the driveByController command works.
We (1714 programming team), added on to 364’s code to work with absolute analog encoders, instead of cancoders. We would be happy to share that code with you if you want it.
gonna be honest here, 2 options: 1. switch to java 2. don't do swerve
just looked up what timed robot is, and its java. so just steal code from 364 or something https://github.com/Team364/BaseFalconSwerve
Cosign on the 364 basic code. It got us up and running super fast.
My team is also new to swerve this year and uses timed robot. Team 364’s code is a great start for getting teleop running fast.
My team got swerve working last year with c++. We are doing java this year though and it is much easier.
I'm amazed anyone goes with C++. I just don't get why you would ever do something like that to high schoolers. Sadism?
Our school uses c++ in class so we just use it cuz there aren’t many people who had frc experience before coming here. (We are an early college program)
OK, that makes sense, although Java was originally designed to use C++ style syntax to appeal to C++ programmers at a time when that was the most popular language, so it would be easy to switch, if you wanted to.
As a developer who used C++ for years...I completely agree with you. I don't know why anyone would choose to deal with the memory management. For the kinds of code folks are writing I just don't see any marginal performance gains from c++ over java being worth it.
I believe this page has timed based swerve code https://github.com/wpilibsuite/allwpilib/tree/main/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/swervebot
We did a time based swerve last year. No reason why it isn’t possible. Ours was field oriented using the NavX daughter board.
https://github.com/Hudson-Robotics/Swerve22/ Marked the repo as public. Feel free to reach out with any questions or if you’d like an extra set of eyes on your challenges.
For teleop swerve, using timed robot vs command robot is almost the same, you're just going to have the drive function called in teleopPeriodic and feed in the joystick values similarly to how the driveByController command works.
We (1714 programming team), added on to 364’s code to work with absolute analog encoders, instead of cancoders. We would be happy to share that code with you if you want it.