Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Autonomous with Mechanum Wheels (http://www.chiefdelphi.com/forums/showthread.php?t=125617)

jls667 01-02-2014 14:15

Autonomous with Mechanum Wheels
 
It looks like I got driving mechanum wheels working. How do I get autonomous working? I use command like the ones below.

drive.mecanumDrive_Polar(.5,0,0);
timer(1,0);
drive.mechanumDrive_Polar(0,45,0);
timer(1,0);
drive.mecanumDrive_Polar(0,0,0);

I get an error, "Output not updated often enough." Any ideas?

pblankenbaker 02-02-2014 06:17

Re: Autonomous with Mechanum Wheels
 
That sounds like the motor safety mechanism is kicking in and stopping your motors because you are not setting the output powers quickly enough (the one second pause from your timer delay).

So, you have two choices. The simple solution is to disable the motor safety feature.

Code:

// Turn off drive safety feature as there are long delays between
// changing motor speeds during autonomous
drive.setSafetyEnabled(false);

// Your autonomous code

// Optionally turn drive safety feature back on (if you want it for teleop)
drive.setSafetyEnabled(true);

Alternatively, you can break your time delay up into smaller chunks.

Our team leaves the drive safety feature disabled for the entire match and rely on manual intervention to hit the Enter key when we need to disable a run away robot.

Joe Ross 03-02-2014 12:07

Re: Autonomous with Mechanum Wheels
 
The first important question is whether you're using SimpleTemplate or IterativeTemplate. If you're using SimpleTemplate, then your only problem is Motor Safety. If you are using IterativeRobot, you will need to restructure your code to remove the delays.

Here's a description of motor safety: http://wpilib.screenstepslive.com/s/...safety-feature The example Java program disabled motor safety in autonomous and enables it in teleop. See http://wpilib.screenstepslive.com/s/...ot-programming

jls667 06-02-2014 12:59

Re: Autonomous with Mechanum Wheels
 
I am using the SimpleRobot class. It turns out that I did turn safety off. My robot does nothing in autonomous. The robot works great in TeleOperator mode. I must have missed something else.

notmattlythgoe 06-02-2014 13:04

Re: Autonomous with Mechanum Wheels
 
Quote:

Originally Posted by jls667 (Post 1338538)
I am using the SimpleRobot class. It turns out that I did turn safety off. My robot does nothing in autonomous. The robot works great in TeleOperator mode. I must have missed something else.

Can you post your code including the method for autonomous? Also, please post it in CODE tags so it will be easier to read.

jls667 06-02-2014 15:42

Re: Autonomous with Mechanum Wheels
 
Public void automous() {
myDrive.setSafetyEnabled(false);
myDrive.mecanumDrive_Polar(.5,0,0);
Timer.delay(1.0);
}

notmattlythgoe 07-02-2014 07:55

Re: Autonomous with Mechanum Wheels
 
Quote:

Originally Posted by jls667 (Post 1338646)
Public void automous() {
myDrive.setSafetyEnabled(false);
myDrive.mecanumDrive_Polar(.5,0,0);
Timer.delay(1.0);
}

You have autonomous spelled wrong.

Is this what your code looks like, or is it spelled wrong in your code also?

Code:

public void autonomous() {
    myDrive.setSafetyEnabled(false);
    myDrive.mecanumDrive_Polar(.5,0,0);
    Timer.delay(1.0);
}


jls667 07-02-2014 14:21

Re: Autonomous with Mechanum Wheels
 
I made a different spelling mistake on my program. Thanks.

jls667 07-02-2014 23:21

Re: Autonomous with Mechanum Wheels
 
I have another related question. I want to use the method myDrive.mecanumDrive.Polar(x,y,z) in my autonomous method. Please explain the three numbers x,y,z. What does each do to the robot?

Domenic Rodriguez 08-02-2014 00:11

Re: Autonomous with Mechanum Wheels
 
Quote:

Originally Posted by jls667 (Post 1339488)
I have another related question. I want to use the method myDrive.mecanumDrive.Polar(x,y,z) in my autonomous method. Please explain the three numbers x,y,z. What does each do to the robot?

RobotDrive#mecanumDrive_Polar() takes input in the form of polar coordinates, as opposed to RobotDrive#mecanumDrive_Cartesian() which takes Cartesian (Rectangular) coordinates. The three parameters for RobotDrive#mecanumDrive_Polar() are as follows:

Quote:

Originally Posted by FRC Javadocs
magnitude - The speed that the robot should drive in a given direction.
direction - The direction the robot should drive in degrees. The direction and magnitude are independent of the rotation rate.
rotation - The rate of rotation for the robot that is completely independent of the magnitude or direction. [-1.0..1.0]

You can find information like this in the Javadocs in the sunspotfrcsdk directory.


All times are GMT -5. The time now is 11:35.

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