|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#16
|
||||
|
||||
|
Re: Problem Loading Java Code
Quote:
for instance you could try Code:
public void operatorControl()
{
drivetrain.Drive(1, 0);
Timer.delay(0.005);
}
|
|
#17
|
||||
|
||||
|
Re: Problem Loading Java Code
I know that we declare what port to use for the power distribution block thru out our code for example
Code:
drivetrain = new RobotDrive(1, 2); |
|
#18
|
||||
|
||||
|
Re: Problem Loading Java Code
Quote:
The code you posted is creating a RobotDrive using Jaguar controllers on PWMs 1 and 2 on the default digital sidecar (CRIO slot 4). If you want to use different PWM outputs you could modify it like so: Code:
drivetrain = new RobotDrive(3, 4); //Uses PWM outputs 3 and 4. drivetrain = new RobotDrive(1, 2, 3, 4); //Used PWMs 1 and 2 for the left drives, and 3 and 4 for the right drives. |
|
#19
|
|||
|
|||
|
Re: Problem Loading Java Code
Trevor,
Your solution trouble-shoots the joystick/jaguar issue, not whether operatorControl() is being called. I might give that a try, but I'm reasonably certain I don't have 2 joysticks failing spontaneously, or 2 jaguars etc. Ehaskins, Got a reply on official FIRST forums (this does not mean it's correct of course) that the RobotMain() function is not the problem (and boy do I hate the casing of that method name - why did they make it look like a constructor?) At the moment I'm most interested in examining the WatchDog angle - does anyone fully understand this and could explain to the unenlightened? |
|
#20
|
||||
|
||||
|
Re: Problem Loading Java Code
Are you getting any text output at all to indicate that the autonomous() or operatorControl() methods are being called? Some more print statements can help here...
|
|
#21
|
|||
|
|||
|
Re: Problem Loading Java Code
I am having the exact same problem with our robot. I download the code to the robot, but when I try to run it it just says watchdog where it usually says enabled. I put a print statement in the autonomous() and operatorControl() methods and it printed to the screen, so it's to that part. Then I made it print something if the trigger was pressed on the joystick and that worked too. Please help.
|
|
#22
|
|||
|
|||
|
Re: Problem Loading Java Code
I figured out the problem, I disabled the watchdog in the wrong part of the code. In the getting started PDF file, it said to put it in the constructor, but that doesn't work, you have to put it in the operator control method. Hope this helps anyone else who might have this problem.
|
|
#23
|
|||
|
|||
|
Re: Problem Loading Java Code
What is the fix for the "[cRIO] Information: No user-supplied RobotMain()" problem? We are still stuck with that...
Thank you, Chris |
|
#24
|
|||
|
|||
|
Re: Problem Loading Java Code
The "[cRIO] Information: No user-supplied RobotMain()" is not an issue. If you look at the simple robot class (the superclass), there is a method called RobtMain() with a print statment that says "Information: No user-supplied RobotMain()". If you don't override it, it will print that on the screen. The comment above the method says you only need to oeverride it if you don't want to use the operatorControl() and autonomous() methods, and just want to program them in manually.
|
|
#25
|
|||
|
|||
|
Re: Problem Loading Java Code
Java example code is wrong. Disable the watch dog at the top of autonomous and/or operatorControl. The disable of the watchdog in the constructor is cancelled out by code in the startApp method of RobotBase which is called after the instance is created but before autonomous or driverControl is called.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| problems loading code with Easy C | Clayton | Programming | 1 | 01-31-2008 03:15 PM |
| Loading Code Onto 2005 RC | chris31 | Programming | 13 | 11-08-2006 07:45 AM |
| Ways to speed up code loading process? | Makubesu | Programming | 10 | 01-21-2006 05:23 PM |
| Java headache problem | MisterX | Programming | 8 | 03-30-2005 11:09 AM |
| problem loading code with ifi loader | psych0gambit | Programming | 7 | 02-25-2005 08:43 PM |