Go to Post Now, I either need to convince Mike Martus to start the webhug early (or move it back 1 hour), skip the webhug, miss the first part of the presentation, or just clone myself. - Andy Baker [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 Rating: Thread Rating: 5 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 04-02-2014, 15:40
Team 4939 Team 4939 is offline
Registered User
AKA: Anshul Shah
FRC #4939 (All spark 9)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Brampton
Posts: 52
Team 4939 is an unknown quantity at this point
Re: [cRIO] Robot Drive... Output not updated often enough.

Ok so thank you for all your help. We fixed our problem by changing our code. The new code is posted below. But now the problem is that when we turn the joystick left the robot goes right and vice-versa. Though it goes back and forth perfectly. Any input would be appreciated. When running the program no errors show up.

Code:
package edu.wpi.first.wpilibj.templates;
 
import edu.wpi.first.wpilibj.Jaguar;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.SimpleRobot;
import edu.wpi.first.wpilibj.Timer;
 
public class RobotTemplate extends SimpleRobot {
    
    RobotDrive chassis = new RobotDrive(1,2);
    Joystick mainStick = new Joystick(1);
    
    public void autonomous() {
        
    }
    
    public void operatorControl() {
        chassis.setSafetyEnabled(true);
        while (isOperatorControl() && isEnabled()) {
            double speed;
            double rot;
            speed = mainStick.getY();
            rot = mainStick.getX();
            chassis.arcadeDrive (speed, rot);
    }
    }
   
    public void test() {
       
    }
}
Reply With Quote
  #2   Spotlight this post!  
Unread 04-02-2014, 15:59
wireties's Avatar
wireties wireties is offline
Principal Engineer
AKA: Keith Buchanan
FRC #1296 (Full Metal Jackets)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Rockwall, TX
Posts: 1,170
wireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond repute
Send a message via AIM to wireties
Re: [cRIO] Robot Drive... Output not updated often enough.

How can this work with the following addresses? Did you fix this?

...
Host JVM: Java HotSpot(TM) Client VM 24.51-b03
Target IP: 10.49.39.2
Network interfaces on host:
Intel(R) Centrino(R) Wireless-N 2200: address: 10.49.39.64 netmask: 255.255.255.254
WARNING: Host is not on same subnet as robot. May not be able to complete all communication with robot.
...

Your computer (if you are also running the driver station) needs to be 10.49.39.5 or 10.49.39.9 and the netmask wide enough to cover all the relevant addresses, so maybe 255.255.255.0 or wider. If another computer is used as the DS you still need to fix that netmask.

HTH
__________________
Fast, cheap or working - pick any two!
Reply With Quote
  #3   Spotlight this post!  
Unread 04-02-2014, 16:09
Team 4939 Team 4939 is offline
Registered User
AKA: Anshul Shah
FRC #4939 (All spark 9)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Brampton
Posts: 52
Team 4939 is an unknown quantity at this point
Re: [cRIO] Robot Drive... Output not updated often enough.

I'm not sure what you mean, could you please expand. If you are talking about changing the IP address when transferring code and using the driver station we make sure of this every time. We use the classmates for the driver stations and personal laptops for running the code.
Reply With Quote
  #4   Spotlight this post!  
Unread 04-02-2014, 16:14
wireties's Avatar
wireties wireties is offline
Principal Engineer
AKA: Keith Buchanan
FRC #1296 (Full Metal Jackets)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Rockwall, TX
Posts: 1,170
wireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond repute
Send a message via AIM to wireties
Re: [cRIO] Robot Drive... Output not updated often enough.

Quote:
Originally Posted by Team 4939 View Post
I'm not sure what you mean, could you please expand. If you are talking about changing the IP address when transferring code and using the driver station we make sure of this every time. We use the classmates for the driver stations and personal laptops for running the code.
I was commenting on some of your debug output. Two computers set with the addresses 10.49.39.2:255.0.0.0 and 10.49.39.64:255.255.255.254 might have trouble talking to each other. The 10.49.39.64 machine would conclude that 10.49.39.2 is NOT on the same logical network and would forward packets destined to 10.49.39.2 to a router/gateway.

HTH
__________________
Fast, cheap or working - pick any two!
Reply With Quote
  #5   Spotlight this post!  
Unread 04-02-2014, 16:20
Ty Tremblay's Avatar
Ty Tremblay Ty Tremblay is offline
Robotics Engineer
FRC #0319 (Big Bad Bob)
Team Role: Mentor
 
Join Date: Feb 2006
Rookie Year: 2004
Location: Alton NH
Posts: 832
Ty Tremblay has a reputation beyond reputeTy Tremblay has a reputation beyond reputeTy Tremblay has a reputation beyond reputeTy Tremblay has a reputation beyond reputeTy Tremblay has a reputation beyond reputeTy Tremblay has a reputation beyond reputeTy Tremblay has a reputation beyond reputeTy Tremblay has a reputation beyond reputeTy Tremblay has a reputation beyond reputeTy Tremblay has a reputation beyond reputeTy Tremblay has a reputation beyond repute
Re: [cRIO] Robot Drive... Output not updated often enough.

Quote:
Originally Posted by Team 4939 View Post
Code:
    
    public void operatorControl() {
        chassis.setSafetyEnabled(true);
        while (isOperatorControl() && isEnabled()) {
            double speed;
            double rot;
            speed = mainStick.getY();
            rot = mainStick.getX();
            chassis.arcadeDrive (speed, rot);
    }
    }

}

A quick fix for your turning backwardness is to invert the sign of your stick values (value * -1):
Code:
rot = -mainStick.getX();
Additionally, you could check to make sure your motors are wired correctly to the speed controllers, that your PWM cables are plugged into the controllers you want them to be plugged into, or that you set up your arcadeDrive/controllers in the right way in your code.
__________________

Last edited by Ty Tremblay : 04-02-2014 at 16:24.
Reply With Quote
  #6   Spotlight this post!  
Unread 04-02-2014, 17:00
Team 4939 Team 4939 is offline
Registered User
AKA: Anshul Shah
FRC #4939 (All spark 9)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Brampton
Posts: 52
Team 4939 is an unknown quantity at this point
Re: [cRIO] Robot Drive... Output not updated often enough.

Thank you everybody we were able to fix our problems. We really appreciate it.
Reply With Quote
  #7   Spotlight this post!  
Unread 04-02-2014, 17:10
wireties's Avatar
wireties wireties is offline
Principal Engineer
AKA: Keith Buchanan
FRC #1296 (Full Metal Jackets)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Rockwall, TX
Posts: 1,170
wireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond repute
Send a message via AIM to wireties
Re: [cRIO] Robot Drive... Output not updated often enough.

Good luck!
__________________
Fast, cheap or working - pick any two!
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 05:37.

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