Can l install both the 2021 version and the 2022 version on my laptop? Since l want to use a trajectory planner , however , it only supports WPILIB 2022. As we all know , the WPILIB 2022 is now in beta version , so l don’t want to use it as my major developing tool. l just want to test it . Will l have two vscode on my laptop after l install the 2022 version? Besides , can l update to the latest official version?
Yes, you can install both in parallel, they install to separate directories, and you will have two copies of vscode (one for 2021 and one for 2022).
And when the offcial version is released , l can still install and cover the beta version?
Yes, the final release will install over the beta, or you can do a “clean” install by deleting the beta install first. You may need to recreate any projects you have created with the beta though, as we make no guarantees there won’t be breaking project changes between the beta and the final release.
Hi , in WPILIB 2022 , how can l use the XboxController.
In the WPILIB 2021 , l use it as below.
However , when l import it to 2022 ,
How to solve it?
l have solved the problem. Sorry to bother you.
The other way (at least how we have done it in the past is to import Hand.
edu.wpi.first.wpilibj.GenericHID.Hand
You can also use ....getRawAxis()
or ...getRawButton()
Hard to tell, what class it the drive_motor_ did you get the 2022 versions of phoenix and rev dependencies?
GenericHID.Hand
was removed for 2022, and replaced with separate getLeftX
and getRightX
etc methods.
l have updated them into 2022 beta version amd they both work well.
Thank you I have not delved that deep into the new API. Sorry. How then does one call the left and right triggers (when they are supported as sticks)?
In terms of 2021 code I made a trigger button class
package frc.robot;
import edu.wpi.first.wpilibj.GenericHID;
import edu.wpi.first.wpilibj2.command.button.Button;
/**
* Add your docs here.
*/
public class TriggerButton extends Button {
private GenericHID m_controller;
private Trigger m_trigger;
private double m_deadband;
public static enum Trigger {
LEFT(2), RIGHT(3);
int axis;
private Trigger(int axis) {
this.axis = axis;
}
}
public TriggerButton(GenericHID joystick, Trigger trigger, double deadband) {
this.m_controller = joystick;
this.m_trigger = trigger;
this.m_deadband = deadband;
}
public boolean get() {
double axis = m_controller.getRawAxis(m_trigger.axis);
//SmartDashboard.putNumber("Trigger Value", axis);
return axis > m_deadband;
}
}
Can l update the version of WPILIB 2021’s vscode manually?
I just find that the WPILIB 2022 need the 2022 version image of roborio. So , where to download the FRC Game Tools in 2022. Is there any beta version of it?
You had to sign up as a beta team to get access to the 2022 beta Game Tools.
How to do it?
Or can anyone share his install files? l think that is possible.
We’re not allowed to share files, but you can still apply to be a beta team until Dec 17. See
Thanks a lot!
Most of the changes were just replacing getXxx(Hand)
methods with getLeftXxx()
and getRightX()
methods. In the case of Xbox trigger axes, I think what you’re looking for is getLeftTriggerAxis()
etc.
Other changes in the same PR include adding a PS4Controller
class and making GenericHID
concrete with only getRaw...(int)
methods (the getX
etc methods were pushed down to the appropriate subclasses).