How to use Logitech Dual Action Controller

Hello,
I am trying to control some robot functions with a Logitech Dual Action controller. Am I able to program it as an Xbox controller, or do I have to program it as a joystick.

Thank you for any help!

Pic: image

I am not extremely familiar with the XboxController interface in WPILib, but it is just a wrapper of the GenericHID interface. It makes some assumptions about the button order and number of buttons on a controller, and those assumptions may not be true for the Logitech controller.

I personally always use the Joystick interface, both for Xbox/PS style controllers and for actual joysticks, though I should probably use a GenericHID object.

I would recommend using a GenericHID object. Makes your life easier if you ever decide to change away from an XboxController compatible controller.

We use Xbox controller because the wrapper makes it easy to deal with all of the Axis beyonf the frist two. You will not have working rumble however as there is not a working rumble motor in it.

We use the Joystick interface for that controller. You can use getX() and getY() for the left joystick and getRawAxis(2) and getRawAxis(3) for the right joystick and getPOV(0) for the POV control and getRawButton(1) through getRawButton(10) for all of the buttons.

I am pretty sure (i am not part of the programing team on my team) that we program those as x box controllers. My team uses x box elite series 2 controllers for the drive team and anyone that just messes surround with the robot we give those and we do not have to change the program to accommodate they just have fewer buttons than the elite controllers.

Thanks, I’ve programmed it using the Xbox controller class. However, it seems like there is no method to get the right or left trigger in the WPI 2022 API. Is there any way to use them?

1 Like

They changed the classes in 2022.
I think the getTriggerAxis()method still works. The get trigger was depreciated. You could us getButton to get the trigger button though.

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.