Thread: Broken Code
View Single Post
  #2   Spotlight this post!  
Unread 03-01-2016, 07:15 PM
yonip yonip is offline
Registered User
FRC #0449 (The Blair Robot Project)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2014
Location: Silver Spring, MD
Posts: 24
yonip is an unknown quantity at this point
Broken Code

the error you are seeing is caused by one port being allocated to two objects. In this case, your problem is that both Chassis and Chassis2 have talons set to ports 1 through 4, and both are initialized in Robot.java, hence the crash originating on line 23 of Chassis2.
Is there any reason you have both Chassis and Chassis2 in your code?
EDIT: nevermind, i see. why do you have two controllers controlling on robot chassis? i'd recommend having a command that simply flips the sign on a constant in Chassis when a certain button is pressed (allowing you to keep to a single contoller).
if you *really* want two controllers, the only working solution i see is having one command for chassis that looks at the input from both controllers, picks the one that has a bigger value (or something like that) and if it picked the values from the inverted joustick, it negates them when it passes them to the Chassis's driveTele method.
If you'd like more specific tips and/or code snippets id be at my computer in ~30 mins to supply those

Last edited by yonip : 03-01-2016 at 07:28 PM.
Reply With Quote