Go to Post No, nothing secret unless you include the following: will it work?, can it be driven and will it release the balls. - twolf [more]
Home
Go Back   Chief Delphi > FIRST > General Forum
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 13-01-2015, 20:30
2B || !2B's Avatar
2B || !2B 2B || !2B is offline
/* No Comment */
FRC #1559 (DevilTech)
Team Role: Programmer
 
Join Date: Apr 2013
Rookie Year: 2013
Location: New York
Posts: 19
2B || !2B is a jewel in the rough2B || !2B is a jewel in the rough2B || !2B is a jewel in the rough2B || !2B is a jewel in the rough
Roborio issues??

It turns out that for some reason I do not understand, the ArcadeDrive class of RobotDrive does not work at all in java. Is anyone else having this problem? I am sure it is not the code, because I compared it to WPI tutorials, API, and numerous other examples.

Any suggestions?
__________________
There are no brakes on the software train
Reply With Quote
  #2   Spotlight this post!  
Unread 13-01-2015, 20:53
alopex_rex's Avatar
alopex_rex alopex_rex is offline
Rainbow Professionalism Dash
AKA: Scott Morton
FRC #0830 (The RatPack)
Team Role: Alumni
 
Join Date: Dec 2014
Rookie Year: 2012
Location: Ann Arbor, MI
Posts: 92
alopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond repute
Re: Roborio issues??

You'll probably have to provide some more specific information before we can do much with this. "Does not work" is pretty vague, and not very useful to anyone who can't see you code or test your robot.

My advice is always to break things down into the smallest steps. First try making a RobotDrive object and not doing anything with it, and see if it compiles. Next test your motor controllers directly, to make sure it's not an electrical issue. Next try using the arcade drive function, using constants for the inputs, not joystick input. Go on like this, and once you find something that doesn't work you'll have an idea where your problem lies.
__________________
Ratpack programming lead 2013 - 2015

ἔκλαγξαν δ᾽ ἄρ᾽ ὀϊστοὶ ἐπ᾽ ὤμων χωομένοιο / αὐτοῦ κινηθέντος: ὃ δ᾽ ἤϊε νυκτὶ ἐοικώς. (Ancient Greek nerds unite!)
Reply With Quote
  #3   Spotlight this post!  
Unread 13-01-2015, 21:25
2B || !2B's Avatar
2B || !2B 2B || !2B is offline
/* No Comment */
FRC #1559 (DevilTech)
Team Role: Programmer
 
Join Date: Apr 2013
Rookie Year: 2013
Location: New York
Posts: 19
2B || !2B is a jewel in the rough2B || !2B is a jewel in the rough2B || !2B is a jewel in the rough2B || !2B is a jewel in the rough
Re: Roborio issues??

Sorry about the vague description, but we actually isolated the RobotDrive class as the issue, because we can drive the motors directly, and everything else checks out OK. I was more interested in whether or not anyone else has this problem because we were so shocked that arguably the most important class in all of the WPI libraries does not work correctly.
__________________
There are no brakes on the software train
Reply With Quote
  #4   Spotlight this post!  
Unread 13-01-2015, 21:34
alopex_rex's Avatar
alopex_rex alopex_rex is offline
Rainbow Professionalism Dash
AKA: Scott Morton
FRC #0830 (The RatPack)
Team Role: Alumni
 
Join Date: Dec 2014
Rookie Year: 2012
Location: Ann Arbor, MI
Posts: 92
alopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond repute
Re: Roborio issues??

Quote:
Originally Posted by 2B || !2B View Post
we were so shocked that arguably the most important class in all of the WPI libraries does not work correctly.
Good rule of thumb here: All else being equal, it is far more likely that there is a problem on your end, rather than that you are the only one who noticed a major problem in a widely used library.

This would be as good a time as any to mention I don't actually program in Java for FRC. But, if you can provide some more information about your issue, I'm sure someone around here will be able to help out. To start, what is happening? (or not happening?) When you try to drive, does nothing happen, or does it drive wrong somehow? What code are you using? Is it only the ArcadeDrive function that's giving you trouble, or does none of the class work? If the motor controllers work otherwise, the simplest explanation would be that you somehow initialized the object wrong, although it sounds like you're pretty sure it's not a code issue. I've made plenty of embarrassing mistakes though, never hurts to check again.
__________________
Ratpack programming lead 2013 - 2015

ἔκλαγξαν δ᾽ ἄρ᾽ ὀϊστοὶ ἐπ᾽ ὤμων χωομένοιο / αὐτοῦ κινηθέντος: ὃ δ᾽ ἤϊε νυκτὶ ἐοικώς. (Ancient Greek nerds unite!)
Reply With Quote
  #5   Spotlight this post!  
Unread 14-01-2015, 08:35
2B || !2B's Avatar
2B || !2B 2B || !2B is offline
/* No Comment */
FRC #1559 (DevilTech)
Team Role: Programmer
 
Join Date: Apr 2013
Rookie Year: 2013
Location: New York
Posts: 19
2B || !2B is a jewel in the rough2B || !2B is a jewel in the rough2B || !2B is a jewel in the rough2B || !2B is a jewel in the rough
Re: Roborio issues??

I did not work on this project myself, I am just baffled that RobotDrive doesn't work. A mentor and a new student worked on some basic java code to make some motors move with joystick input. The report was that the code does not move the motors at all with ArcadeDrive. He also mentioned that they did get the same test robot to work with TankDrive (in the same class).

I can't provide code because the student who worked on it deleted it after be decided that it was busted. It sounds like it's not a FIRST issue, so I will investigate this further tonight.
__________________
There are no brakes on the software train
Reply With Quote
  #6   Spotlight this post!  
Unread 14-01-2015, 09:34
Pratik Kunapuli's Avatar
Pratik Kunapuli Pratik Kunapuli is offline
Probably browning-out on Astro-Turf
FRC #1648 (G3 Robotics)(EWCP)
Team Role: Mentor
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Atlanta, GA
Posts: 143
Pratik Kunapuli is a name known to allPratik Kunapuli is a name known to allPratik Kunapuli is a name known to allPratik Kunapuli is a name known to allPratik Kunapuli is a name known to allPratik Kunapuli is a name known to all
Re: Roborio issues??

To properly debug the code, try to use System.println() statements and determine where the issue is. It could be that the joysticks aren't in the default port number and the println will tell you that the joystick isn't responding how you expect it to. Remember that with the RoboRIO the port numbers are 0 based indexed, so the first port number is 0 rather than 1, which it previously used to be.
__________________
Official Driving Record: 101-59-0
2012-2015 Student 341 Miss Daisy
2015-Current Mentor 1648 G3 Robotics
Reply With Quote
  #7   Spotlight this post!  
Unread 14-01-2015, 20:34
2B || !2B's Avatar
2B || !2B 2B || !2B is offline
/* No Comment */
FRC #1559 (DevilTech)
Team Role: Programmer
 
Join Date: Apr 2013
Rookie Year: 2013
Location: New York
Posts: 19
2B || !2B is a jewel in the rough2B || !2B is a jewel in the rough2B || !2B is a jewel in the rough2B || !2B is a jewel in the rough
Re: Roborio issues??

It turns out that robot drive only works with PWM. No CAN support for driving as of yet.
__________________
There are no brakes on the software train
Reply With Quote
  #8   Spotlight this post!  
Unread 14-01-2015, 21:03
alopex_rex's Avatar
alopex_rex alopex_rex is offline
Rainbow Professionalism Dash
AKA: Scott Morton
FRC #0830 (The RatPack)
Team Role: Alumni
 
Join Date: Dec 2014
Rookie Year: 2012
Location: Ann Arbor, MI
Posts: 92
alopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond repute
Re: Roborio issues??

Really? RobotDrive has constructors that take SpeedController objects, which includes CAN motor controllers. You should be able to declare CAN<whatever> variables for each of your motor controllers and then initialize a RobotDrive using those. Now, if you use the constructor with channel numbers as arguments [new RobotDrive(1, 2, 3, 4)], it'll assume you're trying to use PWM talons, and won't work otherwise. That's probably the problem you guys had.
__________________
Ratpack programming lead 2013 - 2015

ἔκλαγξαν δ᾽ ἄρ᾽ ὀϊστοὶ ἐπ᾽ ὤμων χωομένοιο / αὐτοῦ κινηθέντος: ὃ δ᾽ ἤϊε νυκτὶ ἐοικώς. (Ancient Greek nerds unite!)
Reply With Quote
  #9   Spotlight this post!  
Unread 14-01-2015, 23:00
AubreyA AubreyA is offline
Registered User
AKA: Aubrey Anderson
FRC #2521 (SERT)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Eugene, OR
Posts: 3
AubreyA is an unknown quantity at this point
Re: Roborio issues??

I just found a solution to a similar problem today. If you are in fact using CAN and have declared the RobotDrive using new RobotDrive(new CANJaguar(id), etc...) as alopex_rex discussed then this should work.

We discovered that in the wpilibj RobotDrive class there is a member variable m_isCANInitialized which is set to false at construction. (There is a comment by this declaration, "TODO: fix can", which worries me.) This is the variable which controls whether the CAN motor controllers get updated. When true, RobotDrive will call CANJaguar.updateSyncGroup(syncGroup) for the sync group (byte)0x80. (This is the sync group which the class sets for all motor controllers.) However this never gets set to true which is where the problem arises.

We found two possible solutions to this issue. You could extend the RobotDrive class and set m_isCANInitialized to true at construction which would update the sync group indirectly. The other option is to call CANJaguar.updateSyncGroup(syncGroup) after every time you set your drive motors.
Reply With Quote
  #10   Spotlight this post!  
Unread 14-01-2015, 23:18
Joey1939's Avatar
Joey1939 Joey1939 is offline
Registered User
AKA: Joey Holliday
FRC #1939 (Kuhnigits)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Kansas City, Missouri
Posts: 142
Joey1939 has a spectacular aura aboutJoey1939 has a spectacular aura aboutJoey1939 has a spectacular aura about
Re: Roborio issues??

Quote:
Originally Posted by alopex_rex View Post
Really? RobotDrive has constructors that take SpeedController objects, which includes CAN motor controllers. You should be able to declare CAN<whatever> variables for each of your motor controllers and then initialize a RobotDrive using those. Now, if you use the constructor with channel numbers as arguments [new RobotDrive(1, 2, 3, 4)], it'll assume you're trying to use PWM talons, and won't work otherwise. That's probably the problem you guys had.
This is correct. Anything that extends SpeedController (Talons, Victors, Jaguars, CANTalons, etc.) will all work. Make sure if you are using CAN to give the the SpeedController objects instead of just the ports because it will assume you mean PWM.

I have been using TalonSRX's over CAN without problem.
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 18:07.

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


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