Go to Post C'mon you guys you're all inventors. You guys should be making a portable cryogenic sleep chambers for those long bus trips! You got two weeks before you have to go. Get cracking! - Koko Ed [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
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 13-01-2017, 12:04
GavinL GavinL is offline
intensely stares at program
FRC #5726 (RhumBotz)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2016
Location: San Antonio, Texas
Posts: 42
GavinL is a splendid one to beholdGavinL is a splendid one to beholdGavinL is a splendid one to beholdGavinL is a splendid one to beholdGavinL is a splendid one to beholdGavinL is a splendid one to beholdGavinL is a splendid one to behold
Question Will this work?

To set the drive to tankdrive I put this in my DriveWithJoysticks command file, right?
(had to put spaces on oi because it would make the face)
void DriveWithJoysticks::Execute() {
Robot::driveTrain->robotDrive41->TankDrive(
Robot:: oi->getopStick()->GetRawAxis(1),
Robot:: oi->getopStick()->GetRawAxis(5));
}

OR

Should I just create an if statement that checks if getrawaxis(1) > deadZone, then set left motor outputs to 1.
Reply With Quote
  #2   Spotlight this post!  
Unread 13-01-2017, 13:43
euhlmann's Avatar
euhlmann euhlmann is offline
CTO, Programmer
AKA: Erik Uhlmann
FRC #2877 (LigerBots)
Team Role: Leadership
 
Join Date: Dec 2015
Rookie Year: 2015
Location: United States
Posts: 377
euhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud of
Re: Will this work?

One of my pet peeves is a "binary" joystick. That is one where the sticks aren't balanced well enough and you can't really hold them part of the way (so it's always close to either 0 or 1). Equally annoying is when someone uses an xbox 360 or xbox one controller as if it were binary. Essentially gunning the robot, realizing it's going too fast, immediately stopping, then full speed again, and so on; speed control by manual switching (bad!). There's actually a reason you want to use complicated motor controllers (instead of spikes) and high quality joysticks: because you don't want to be going top speed all the time!
__________________
Creator of SmartDashboard.js, an extensible nodejs/webkit replacement for SmartDashboard


https://ligerbots.org
Reply With Quote
  #3   Spotlight this post!  
Unread 13-01-2017, 17:07
bob.wolff68's Avatar
bob.wolff68 bob.wolff68 is offline
Da' Mentor Man
FRC #1967
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2007
Location: United States
Posts: 158
bob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nice
Re: Will this work?

Gavin,
First ... feel free to use the "["CODE"]" and "["/CODE"]" markers (without the double-quotes) around anything that you want NOT formatted (smiles etc) - works like a champ.
Code:
int i=25;
Now for TankDrive, this is the drive mechanism where you (usually) want two joysticks - one is all about the left wheels and the other is all about the right wheels. Right? If that's indeed what you're looking for, then only the Y-Axis would be looked at for each of the joysticks. As such, TankDrive() would have inputs from two different sticks like:

BTW - I'm not familiar with your Robot:: class so I'm going to use my own 'Joystick' instances - if you have your own already, feel free to substitute...

Found somewhere like RobotInit()...
Code:
JoyStick leftStick(0);
JoyStick rightStick(1);
Code:
TankDrive(leftStick.GetY(), rightStick.GetY());
This is the gist of it. Does that make sense? Let me know if not.

roboBob
__________________
~~~~~~~~~~~~~~~~~~~
Bob Wolff - Software from the old-school
Mentor / C / C++ guy
Team 1967 - The Janksters - San Jose, CA
Reply With Quote
  #4   Spotlight this post!  
Unread 14-01-2017, 02:50
GavinL GavinL is offline
intensely stares at program
FRC #5726 (RhumBotz)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2016
Location: San Antonio, Texas
Posts: 42
GavinL is a splendid one to beholdGavinL is a splendid one to beholdGavinL is a splendid one to beholdGavinL is a splendid one to beholdGavinL is a splendid one to beholdGavinL is a splendid one to beholdGavinL is a splendid one to behold
Re: Will this work?

Quote:
Originally Posted by bob.wolff68 View Post
Gavin,
First ... feel free to use the "["CODE"]" and "["/CODE"]" markers (without the double-quotes) around anything that you want NOT formatted (smiles etc) - works like a champ.
Code:
int i=25;
Now for TankDrive, this is the drive mechanism where you (usually) want two joysticks - one is all about the left wheels and the other is all about the right wheels. Right? If that's indeed what you're looking for, then only the Y-Axis would be looked at for each of the joysticks. As such, TankDrive() would have inputs from two different sticks like:

BTW - I'm not familiar with your Robot:: class so I'm going to use my own 'Joystick' instances - if you have your own already, feel free to substitute...

Found somewhere like RobotInit()...
Code:
JoyStick leftStick(0);
JoyStick rightStick(1);
Code:
TankDrive(leftStick.GetY(), rightStick.GetY());
This is the gist of it. Does that make sense? Let me know if not.

roboBob
Yes it makes sense. Its just that we are using a logitech f310 so I have to use one port. Also last year we had it set up with the if statement, worked pretty well. Just didn't know if we should keep doing that or go to the TankDrive().
Reply With Quote
  #5   Spotlight this post!  
Unread 14-01-2017, 04:21
GeeTwo's Avatar
GeeTwo GeeTwo is online now
Technical Director
AKA: Gus Michel II
FRC #3946 (Tiger Robotics)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Slidell, LA
Posts: 3,688
GeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond repute
Re: Will this work?

Quote:
Originally Posted by GavinL View Post
Yes it makes sense. Its just that we are using a logitech f310 so I have to use one port. Also last year we had it set up with the if statement, worked pretty well. Just didn't know if we should keep doing that or go to the TankDrive().
If you're going to stay with it, it doesn't make a lot of difference. If you think you might want to change driving mode (e.g. to arcade drive), then coding it as tank drive at this point would make a much easier transition.
__________________

If you can't find time to do it right, how are you going to find time to do it over?
If you don't pass it on, it never happened.
Robots are great, but inspiration is the reason we're here.
Friends don't let friends use master links.
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 13:31.

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