Go to Post Might change next year. Read the manual then too. - Billfred [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 05-29-2018, 04:57 PM
Nevada Reno's Avatar
Nevada Reno Nevada Reno is offline
Safety, Scout
FRC #5430 (Piraterobolution)
Team Role: Programmer
 
Join Date: Oct 2015
Rookie Year: 2016
Location: Pittsburg,california
Posts: 15
Nevada Reno is an unknown quantity at this point
Java Programming Help

Hello, everyone.

I need help with making a tank drive controlled with a xbox controller. I need it for java programming.

if anyone wants to help that would be helpful. also examples would be appreciated. if you can send me your entire code would also be nice.

thanks
__________________
You have to learn the rules of the game. And then you have to play better than anyone else.
-Albert Einstein

2015 Cal Games
2016 FIRST Stronghold
2016 Cal Games
2017 FIRST Steamworks
2018 FIRST Power UP
2019 Destination: Deep Space
Reply With Quote
  #2   Spotlight this post!  
Unread 05-29-2018, 05:07 PM
EmileH's Avatar
EmileH EmileH is offline
Passion breeds passion.
FRC #1058 (PVC Pirates)
 
Join Date: Dec 2014
Rookie Year: 2011
Location: New Hampshire
Posts: 794
EmileH has a reputation beyond reputeEmileH has a reputation beyond reputeEmileH has a reputation beyond reputeEmileH has a reputation beyond reputeEmileH has a reputation beyond reputeEmileH has a reputation beyond reputeEmileH has a reputation beyond reputeEmileH has a reputation beyond reputeEmileH has a reputation beyond reputeEmileH has a reputation beyond reputeEmileH has a reputation beyond repute
Re: Java Programming Help

wpilib.screenstepslive.com is a fantastic resource with plenty of examples and guides on how to accomplish exactly this. If you have further questions feel free to ask! Good luck!
__________________
2016-present: FRC 1058
2013-2015: FRC 3467

Member of the New England FRC community? Join the FRC New England Alliance Facebook Group!
Reply With Quote
  #3   Spotlight this post!  
Unread 05-29-2018, 05:07 PM
BenBernard's Avatar
BenBernard BenBernard is offline
Programming and Controls Mentor
FRC #5687 (The Outliers)
Team Role: Mentor
 
Join Date: Jan 2016
Rookie Year: 2015
Location: Portland, ME
Posts: 129
BenBernard will become famous soon enoughBenBernard will become famous soon enough
Re: Java Programming Help

We have a very simple implementation of this available on our github site: https://github.com/frc5687/2017-simplebot

This was written last year so it targets the steamworks game...but it's really very generic.
Reply With Quote
  #4   Spotlight this post!  
Unread 06-08-2018, 08:45 AM
juhi02 juhi02 is offline
Registered User
AKA: Juhi Agrawal
FRC #6898 (The Undergraduate School of Carrots)
Team Role: Programmer
 
Join Date: Dec 2017
Rookie Year: 2017
Location: Texas
Posts: 9
juhi02 is an unknown quantity at this point
Re: Java Programming Help

I definitely recommend checking out http://wpilib.screenstepslive.com/s/...p-test-program. For an xbox controller, you will want to create a joystick object, motor controllers for the drive train, and a DifferentialDrive object. In teleopPeriodic(), you should create two double variables, one for each axis of the controller you want to use. Make the double equal to joystick.getRawAxis(axis), where the axis is the number of the axis you want to use. Then, add drivetrain.tankDrive(leftSpeed, rightSpeed). Let me know if you need any help!
Reply With Quote
  #5   Spotlight this post!  
Unread 06-08-2018, 09:11 AM
gerthworm's Avatar
gerthworm gerthworm is online now
Making the 1's and 0's
FRC #1736 (Robot Casserole)
Team Role: Mentor
 
Join Date: Jan 2015
Rookie Year: 2015
Location: Peoria, IL
Posts: 515
gerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond repute
Re: Java Programming Help

OP, any luck yet? Any specific issues we can help with?
Reply With Quote
  #6   Spotlight this post!  
Unread 06-10-2018, 07:56 AM
NewtonCrosby NewtonCrosby is offline
Registered User
FRC #1895 (LamdaCorps)
Team Role: Mentor
 
Join Date: Jan 2018
Rookie Year: 2012
Location: Virginia
Posts: 36
NewtonCrosby is an unknown quantity at this point
Re: Java Programming Help

You can check out our public github that has 2017 Steamworks code. That code base has lots of different functionality to it, you really only need to focus on the DriveTrain subsystem.

Also, there are other built-in WPI classes that will help, the DifferentialDrive being one of them.

Reach out for more help if you need, our team will be happy to help.
Reply With Quote
  #7   Spotlight this post!  
Unread 06-10-2018, 11:28 AM
alst alst is offline
Programming Mentor
AKA: Alan
FRC #0830 (RatPack)
Team Role: Mentor
 
Join Date: Jul 2015
Rookie Year: 1188
Location: MI
Posts: 28
alst is a jewel in the roughalst is a jewel in the roughalst is a jewel in the rough
Re: Java Programming Help

The Eclipse plugins come with a number of sample programs that you can select when making a new project. They're also viewable on GitHub: https://github.com/wpilibsuite/allwp...ilibj/examples

I directed at least one rookie team to this one, and it worked pretty well for them.
__________________
FiM CSA/FTAA/etc.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 01:53 PM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi