Go to Post This looks like a job for duct tape! - JoeXIII'007 [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
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-02-2015, 11:20
LFRobotics's Avatar
LFRobotics LFRobotics is offline
Registered User
FRC #4623
 
Join Date: Jan 2014
Location: Little Falls, MN
Posts: 95
LFRobotics is on a distinguished road
Re: How to Program Mecanum

Okay that didn't work either. Nothing works. The program uploads - the DS doesn't through any errors - it shows all green lights - but nothing happens with the Joysticks - I can press anything on the XBox controller and nothing happens. I can still make the robot move using ,my preassigned values in autonomous.

Here is the upload for Eclipse:

Code:
Buildfile: C:\Users\Kristen\Documents\GitHub\Copy of Copy of Getting Started\build.xml
Trying to override old definition of task classloader
clean:
   [delete] Deleting directory C:\Users\Kristen\Documents\GitHub\Copy of Copy of Getting Started\build
   [delete] Deleting directory C:\Users\Kristen\Documents\GitHub\Copy of Copy of Getting Started\dist
compile:
    [mkdir] Created dir: C:\Users\Kristen\Documents\GitHub\Copy of Copy of Getting Started\build
     [echo] [athena-compile] Compiling src with classpath=C:\Users\Kristen/wpilib/java/current/lib/WPILib.jar:C:\Users\Kristen/wpilib/java/current/lib/NetworkTables.jar to build
    [javac] Compiling 8 source files to C:\Users\Kristen\Documents\GitHub\Copy of Copy of Getting Started\build
jar:
     [echo] [athena-jar] Making jar dist/FRCUserProgram.jar.
    [mkdir] Created dir: C:\Users\Kristen\Documents\GitHub\Copy of Copy of Getting Started\dist
    [mkdir] Created dir: C:\Users\Kristen\Documents\GitHub\Copy of Copy of Getting Started\build\jars
     [echo] [athena-jar] Copying jars from C:\Users\Kristen/wpilib/java/current/lib/WPILib.jar:C:\Users\Kristen/wpilib/java/current/lib/NetworkTables.jar to build/jars.
     [copy] Copying 2 files to C:\Users\Kristen\Documents\GitHub\Copy of Copy of Getting Started\build\jars
      [jar] Building jar: C:\Users\Kristen\Documents\GitHub\Copy of Copy of Getting Started\dist\FRCUserProgram.jar
get-target-ip:
     [echo] Trying Target: roboRIO-4623.local
     [echo] roboRIO found via mDNS
dependencies:
     [echo] roboRIO image version validated
     [echo] Checking for JRE. If this fails install the JRE using these instructions: https://wpilib.screenstepslive.com/s/4485/m/13503/l/288822-installing-java-8-on-the-roborio-using-the-frc-roborio-java-installer-java-only
  [sshexec] Connecting to roboRIO-4623.local:22
  [sshexec] cmd : test -d /usr/local/frc/JRE
deploy:
     [echo] [athena-deploy] Copying code over.
      [scp] Connecting to roboRIO-4623.local:22
      [scp] done.
      [scp] Connecting to roboRIO-4623.local:22
      [scp] done.
     [echo] [athena-deploy] Starting program.
  [sshexec] Connecting to roboRIO-4623.local:22
  [sshexec] cmd : . /etc/profile.d/natinst-path.sh; /usr/local/frc/bin/frcKillRobot.sh -t -r;
  [sshexec] stopped process in pidfile '/var/run/natinst/FRC_UserProgram.pid' (pid 4205)
BUILD SUCCESSFUL
Total time: 13 seconds
Here is the link to the updated code:

https://github.com/MrSTUDofCODE/NewM...team4623/robot

Also we have another person programming in labview - so I went into the web interface and checked disable RT startup - which should have switched it back to JAVA

PLEASE help - THANKS!

Last edited by LFRobotics : 05-02-2015 at 11:23.
Reply With Quote
  #2   Spotlight this post!  
Unread 05-02-2015, 12:03
cstelter cstelter is offline
Programming Mentor
AKA: Craig Stelter
FRC #3018 (Nordic Storm)
Team Role: Mentor
 
Join Date: Apr 2012
Rookie Year: 2012
Location: Mankato, MN
Posts: 77
cstelter will become famous soon enough
Re: How to Program Mecanum

I think you need to add Scheduler.run() in TeleopPerodic()

Edit: Never go off memory-- it should be

Code:
    public void teleopPeriodic() {
        Scheduler.getInstance().run();
    }

Last edited by cstelter : 05-02-2015 at 12:07.
Reply With Quote
  #3   Spotlight this post!  
Unread 05-02-2015, 12:24
cstelter cstelter is offline
Programming Mentor
AKA: Craig Stelter
FRC #3018 (Nordic Storm)
Team Role: Mentor
 
Join Date: Apr 2012
Rookie Year: 2012
Location: Mankato, MN
Posts: 77
cstelter will become famous soon enough
Re: How to Program Mecanum

Building on last post--

When you push teleop mode on Drive station, IterativeRobot will call teleopInit() and then call teleopPeriodic() every 20ms.

Similarly when you press Autonomous from drive station, it calls autonomousInit() and then autonomousPeriodic() every 20ms after that.

Your autonomousPeriodic() directly calls your drivetrain so you are making that call every 20ms in autonomous. This is why this mode works for you.

Note, you should *never* call any subsytem functionality from anything but a command. You are only asking for trouble.

Your autonomousPeriodic() *should* be:

Code:
    public void autonomousPeriodic() {
        Scheduler.getInstance().run();
    }
You should create a command field in your Robot class
Code:
public class Robot extends IterativeRobot {
    Command autonomousCommand;
    ...
and then you can do something like this in autonomousInit:
Code:
    public void autonomousInit() {
        // schedule the autonomous command (example)
        if (autonomousCommand == null) {
            autonomousCommand=new leftStraffe();
        } 
        autonomousCommand.start();
    }
Now, when you run autonomous, we simply run the scheduler. The autonomous starts your leftStraffe command (note, java convention is to name classes with a captial so LeftStraffe may be a better name because you will have to look back less to see how you spelled it if you are consistent with your naming conventions), so that command is now being controlled by the scheduler. It will call execute() which in turn will be the appropriate way call your mecanum drive function.
Reply With Quote
  #4   Spotlight this post!  
Unread 05-02-2015, 12:31
cstelter cstelter is offline
Programming Mentor
AKA: Craig Stelter
FRC #3018 (Nordic Storm)
Team Role: Mentor
 
Join Date: Apr 2012
Rookie Year: 2012
Location: Mankato, MN
Posts: 77
cstelter will become famous soon enough
Re: How to Program Mecanum

Just one more thing I'm compelled to point out....

Quote:
Originally Posted by LFRobotics View Post
Okay that didn't work either. Nothing works.
FRC is the hardest fun you'll ever have. If it always worked the first time you might have fun, but it wouldn't be hard and you probably would learn less.


Quote:
Originally Posted by LFRobotics View Post
The program uploads - the DS doesn't through any errors - it shows all green lights - but nothing happens with the Joysticks - I can press anything on the XBox controller and nothing happens. I can still make the robot move using ,my preassigned values in autonomous.
Wait a second! The above is in direct contradiction to your 'Nothing Works' assertion! (all is not lost-- your autonomous moves!!!!)

Don't be discouraged. You're living the FRC dream my friend. You're facing challenges looking for answers. This is my life too-- I'm a 25 year professional software engineer. I've had these moments too.

But the true joy will come in learning, and building on what you have learned. Every time I get stuck in my job, I'm on stackoverflow or google searching for a solution to my particular problem. But I would not have gotten as far as I have by concluding 'Nothing Works'. Don't go there.

You *will* get through this.
Reply With Quote
  #5   Spotlight this post!  
Unread 09-02-2015, 13:51
mac mac is offline
Registered User
AKA: Thomas (just give me a crabcake)McCubbin
FRC #0686 (Bovine Intervention/Jagbots)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2005
Location: Mt.Airy Md.
Posts: 52
mac is a jewel in the roughmac is a jewel in the roughmac is a jewel in the roughmac is a jewel in the rough
Re: How to Program Mecanum

Hello. How far have you trouble shot. Is the radio working both ways? Has the robot done any commands? Can you hard wire it to run? Fresh battery? My 3 cents. Thank You Thomas (just give me a crabcake) McCubbin
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 11:16.

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