Go to Post Imagine a time before alliances. A time when secrecy was rampid and the Delphi Forum was just in it's baby stage. - Andy Grady [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-04-2013, 16:19
tuXguy15's Avatar
tuXguy15 tuXguy15 is offline
Team Mentor
AKA: Devin Kolarac
FRC #2559 (Normality Zero)
 
Join Date: Apr 2012
Rookie Year: 2012
Location: Harrisburg, PA
Posts: 127
tuXguy15 is an unknown quantity at this point
Stop Driving

Hello. My team I was running some simulations for my teams robot before we go to the regional competition and I found out an issue with our pneumatic gearbox. To resolve this I was thinking about making a button that when the driver presses and holds it will set our drive motors (jaguar1, jaguar2, jaguar4, & jaguar5) to off even if the driver is pushing forward on the joystick. Is there a way I can do this. I can't try anything because we can't take our robot out of the bag. Can i make this button override robot drive and make it stop driving when the button is pressed? Thanks!
Reply With Quote
  #2   Spotlight this post!  
Unread 05-04-2013, 17:02
themccannman's Avatar
themccannman themccannman is offline
registered lurker
AKA: Jake McCann
FRC #3501
Team Role: Mentor
 
Join Date: Feb 2013
Rookie Year: 2011
Location: San Jose, CA
Posts: 432
themccannman has a reputation beyond reputethemccannman has a reputation beyond reputethemccannman has a reputation beyond reputethemccannman has a reputation beyond reputethemccannman has a reputation beyond reputethemccannman has a reputation beyond reputethemccannman has a reputation beyond reputethemccannman has a reputation beyond reputethemccannman has a reputation beyond reputethemccannman has a reputation beyond reputethemccannman has a reputation beyond repute
Re: Stop Driving

I'm not a programmer so I'm not entirely sure what I'm talking about, but there should be a way to program your motors to brake so that when there is no driver input the motors will actively fight forces trying to turn them instead of freely spinning. I'm not sure if that would solve the issue your having but I just thought it might help.
__________________
All posts here are purely my own opinion.
2011-2015: 1678
2016: 846
2017 - current: 3501
Reply With Quote
  #3   Spotlight this post!  
Unread 05-04-2013, 17:15
tuXguy15's Avatar
tuXguy15 tuXguy15 is offline
Team Mentor
AKA: Devin Kolarac
FRC #2559 (Normality Zero)
 
Join Date: Apr 2012
Rookie Year: 2012
Location: Harrisburg, PA
Posts: 127
tuXguy15 is an unknown quantity at this point
Re: Stop Driving

Im trying to get it so that the button overrides joystick input and stops the robot and continues driving when the button is released.
Reply With Quote
  #4   Spotlight this post!  
Unread 05-04-2013, 17:18
Owen Makin Owen Makin is offline
Registered User
FRC #1972
 
Join Date: Jan 2013
Location: CUHS El Centro
Posts: 50
Owen Makin is an unknown quantity at this point
Re: Stop Driving

Set a button to that allow motors to move when not pressed, but when pressed overrides all values to zero. I dont know how java works because i only know labview. but im sure its not that different.
Reply With Quote
  #5   Spotlight this post!  
Unread 05-04-2013, 17:36
thecakeisalie's Avatar
thecakeisalie thecakeisalie is offline
Registered User
FRC #0293
 
Join Date: Mar 2012
Location: Pennington
Posts: 37
thecakeisalie is an unknown quantity at this point
Re: Stop Driving

Not sure if this is what you mean, but:
Code:
if(button.get()) {
    Drivetrain.tankDrive(0,0);
}
else {
    DriveTrain.tankDrive(leftJoystick.getY(), rightJoystick.getY());
}
Reply With Quote
  #6   Spotlight this post!  
Unread 05-04-2013, 18:14
ekapalka's Avatar
ekapalka ekapalka is offline
Registered User
FRC #3216
 
Join Date: Dec 2012
Location: Bermuda
Posts: 277
ekapalka has a spectacular aura aboutekapalka has a spectacular aura about
Re: Stop Driving

How about this?
Code:
bool stopp = false;
[...]
if (!stopp)
{
    DriveTrain.tankDrive(leftJoystick.getY(), rightJoystick.getY());
}
if (button.get())
{
    stopp = true;
}
Does this help?

Last edited by ekapalka : 05-04-2013 at 18:24. Reason: ... making it look more like java...
Reply With Quote
  #7   Spotlight this post!  
Unread 05-04-2013, 21:06
tuXguy15's Avatar
tuXguy15 tuXguy15 is offline
Team Mentor
AKA: Devin Kolarac
FRC #2559 (Normality Zero)
 
Join Date: Apr 2012
Rookie Year: 2012
Location: Harrisburg, PA
Posts: 127
tuXguy15 is an unknown quantity at this point
Re: Stop Driving

Ok thanks ill start writing out some code for it and test it at the regionals
Reply With Quote
  #8   Spotlight this post!  
Unread 06-04-2013, 02:00
Ginto8's Avatar
Ginto8 Ginto8 is offline
Programming Lead
AKA: Joe Doyle
FRC #2729 (Storm)
Team Role: Programmer
 
Join Date: Oct 2010
Rookie Year: 2010
Location: Marlton, NJ
Posts: 174
Ginto8 is a glorious beacon of lightGinto8 is a glorious beacon of lightGinto8 is a glorious beacon of lightGinto8 is a glorious beacon of lightGinto8 is a glorious beacon of light
Re: Stop Driving

Quote:
Originally Posted by ekapalka View Post
How about this?
Code:
bool stopp = false;
[...]
if (!stopp)
{
    DriveTrain.tankDrive(leftJoystick.getY(), rightJoystick.getY());
}
if (button.get())
{
    stopp = true;
}
Does this help?
This example will only work if you're using RobotDrive, have its safety feature enabled, and have the timeout set low enough. Otherwise, it'll just stop changing the motors' speeds instead of actually stopping them.
__________________
I code stuff.
Reply With Quote
  #9   Spotlight this post!  
Unread 06-04-2013, 10:20
tuXguy15's Avatar
tuXguy15 tuXguy15 is offline
Team Mentor
AKA: Devin Kolarac
FRC #2559 (Normality Zero)
 
Join Date: Apr 2012
Rookie Year: 2012
Location: Harrisburg, PA
Posts: 127
tuXguy15 is an unknown quantity at this point
Re: Stop Driving

Is the safety feature enabled by default?
Reply With Quote
  #10   Spotlight this post!  
Unread 06-04-2013, 13:51
ekapalka's Avatar
ekapalka ekapalka is offline
Registered User
FRC #3216
 
Join Date: Dec 2012
Location: Bermuda
Posts: 277
ekapalka has a spectacular aura aboutekapalka has a spectacular aura about
Re: Stop Driving

?
Code:
bool stopp = false;
[...]
if (!stopp)
{
    DriveTrain.tankDrive(leftJoystick.getY(), rightJoystick.getY());
}
if (button.get())
{
    stopp = true;
    DriveTrain.tankDrive(0.0, 0.0);
}
Sorry. I've actually been programming in C++. This year we had a function using something like this that would take control from the driver and autonomously take control using the sensors. It was flawless (we programmed it during the final three rounds of the competition :P )
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 12:48.

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