Go to Post Upon entering FIRST you immediately apply Murphy's Laws. - A_Reed [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 23-01-2015, 12:24
4373Henry's Avatar
4373Henry 4373Henry is offline
Registered User
FRC #4373
 
Join Date: Jan 2015
Location: Pennsylvania
Posts: 5
4373Henry is an unknown quantity at this point
Java Command Based Layout - Using a Command Twice

Looking at examples of command based robots online, I noticed that most people tend to instantiate commands within the subsystem that uses them.

Our code has two drive related subsystems, one for the strafe motor and one for the tank drive motors. Both of these subsystems use the same command- Drive.

I have a feeling that a single command shouldn't be instantiated twice. Is the correct solution to use different commands? Or is it not proper convention to make these separate subsystems?
Reply With Quote
  #2   Spotlight this post!  
Unread 23-01-2015, 12:44
notmattlythgoe's Avatar
notmattlythgoe notmattlythgoe is offline
Flywheel Police
AKA: Matthew Lythgoe
FRC #2363 (Triple Helix)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Newport News, VA
Posts: 1,728
notmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond repute
Re: Java Command Based Layout - Using a Command Twice

Quote:
Originally Posted by 4373Henry View Post
Looking at examples of command based robots online, I noticed that most people tend to instantiate commands within the subsystem that uses them.

Our code has two drive related subsystems, one for the strafe motor and one for the tank drive motors. Both of these subsystems use the same command- Drive.

I have a feeling that a single command shouldn't be instantiated twice. Is the correct solution to use different commands? Or is it not proper convention to make these separate subsystems?
Can you link me to these ones you are seeing online?

Please take a look at our code from last year. We do as much as we can to make our commands reusable.

If you have any questions please don't hesitate to ask.
Reply With Quote
  #3   Spotlight this post!  
Unread 23-01-2015, 12:49
Fauge7 Fauge7 is offline
Head programmer
FRC #3019 (firebird robotics)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Scottsdale
Posts: 195
Fauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to all
Re: Java Command Based Layout - Using a Command Twice

Make the drive train subsystem have all the motors controlling the drive train. As for coding it I would suggest making your own drive code, if your going with the 5 wheel H drive its similar to arcade drive but assign the 5th or 3rd motor controller to some value like the x value of the joystick. Also you should have 1 default command for the drive train and that should be the one you use for teleop. Good question though!
Reply With Quote
  #4   Spotlight this post!  
Unread 23-01-2015, 13:11
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,590
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Java Command Based Layout - Using a Command Twice

I would tend to think that both parts of an H-drive should probably be part of the same subsystem. Is there ever a time that you would have two one command controlling tank drive and a different command controlling strafe?

A command can require multiple subsystems, which we've done before. I have not tried it, but I think that multiple subsystems should probably not add the same command as defaults. I think they would constantly interrupt each other.
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:25.

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