Go to Post Programmer says autonomous will work 100% perfectly...Great way to clear the room of all mechanicals and all but the boldest electricals - EricH [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 29-03-2014, 18:55
DavisC DavisC is offline
Registered User
FRC #0539 (Titans)
Team Role: College Student
 
Join Date: Jul 2011
Rookie Year: 2010
Location: Virginia
Posts: 200
DavisC is just really niceDavisC is just really niceDavisC is just really niceDavisC is just really nice
Command Based Programming

Hello,

I have been trying to switch over to Command based programming and have not had any success. I have attempted to follow the guide on the Screen Steps site with no luck.

Anyone know of a good guide/intro to follow?
__________________
FRC Team 539
Student Member: 2010 Breakaway - 2014 Aerial Assist
Mentor: 2015 Recycle Rush - present
Reply With Quote
  #2   Spotlight this post!  
Unread 30-03-2014, 01:02
SoftwareBug2.0's Avatar
SoftwareBug2.0 SoftwareBug2.0 is offline
Registered User
AKA: Eric
FRC #1425 (Error Code Xero)
Team Role: Mentor
 
Join Date: Aug 2004
Rookie Year: 2004
Location: Tigard, Oregon
Posts: 486
SoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant future
Re: Command Based Programming

I know this isn't the question that you're asking but my recommendation is don't bother. It makes it harder to reason about what the code is doing.
Reply With Quote
  #3   Spotlight this post!  
Unread 30-03-2014, 14:28
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,570
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: Command Based Programming

Take a look at Brad Miller's youtube playlist: https://www.youtube.com/watch?v=k7Pa...lgn vhGObeKzp While it uses Java, the concepts are the same.

I disagree with Eric. I think that the Command programming model makes it much easier for multiple programmers to work on the code in a coherent fashion. It makes the code easier to read and follow once you go beyond the simplest of programs.

Some teams may have a good framework in place, in which case the Command programming model is not helpful, but that doesn't describe most teams.
Reply With Quote
  #4   Spotlight this post!  
Unread 31-03-2014, 00:29
kylelanman's Avatar
kylelanman kylelanman is offline
Programming Mentor
AKA: Kyle
FRC #2481 (Roboteers)
Team Role: Mentor
 
Join Date: Feb 2008
Rookie Year: 2007
Location: Tremont Il
Posts: 189
kylelanman is a name known to allkylelanman is a name known to allkylelanman is a name known to allkylelanman is a name known to allkylelanman is a name known to allkylelanman is a name known to all
Re: Command Based Programming

I too disagree with SoftwareBug2.0 and agree with Joe Ross...

The command based programming model empowered our team to create more sophisticated robots the past two years.

We were able to cleanly have multiple autonomous modes and create new ones minutes before matches.

In 2013 it allowed us a have completely autonomous 30 pt climb sequence.

In 2014 it allowed us to easily create a two ball autonomous the night before bagging.

I won't say there isn't a lot of overhead required in the command based model. It certainly requires writing a lot more code so it might not be best for beginners. In the end it encourages good OO code that is both more reusable and easier to maintain.
__________________
"May the coms be with you"

Is this a "programming error" or a "programmer error"?

Reply With Quote
  #5   Spotlight this post!  
Unread 31-03-2014, 00:40
jmullins16's Avatar
jmullins16 jmullins16 is offline
Registered User
AKA: Jeff Mullins
FRC #2135 (Presentation Invasion)
Team Role: Mentor
 
Join Date: Nov 2011
Rookie Year: 2011
Location: San Jose, CA
Posts: 23
jmullins16 is an unknown quantity at this point
Re: Command Based Programming

Our team has also used command based programming to get non-programmers up to speed and using object oriented concepts. Also using the Robotbuilder tool provided in the WPILiB directory has helped us create an initial set of files without getting mired in the C++ structure and semantics, and I recommend it. We can get them focused on controlling the robot actuators and sensors. But it can be a little constraining, and I do understand there are lots of teams who have passed this level of skill.

We're very willing to share our experience with C++ and RobotBuilder if needed.
Reply With Quote
  #6   Spotlight this post!  
Unread 04-04-2014, 19:25
bvisness's Avatar
bvisness bvisness is offline
Programming Mentor, Former Driver
FRC #2175 (The Fighting Calculators)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Woodbury, MN
Posts: 181
bvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of light
Re: Command Based Programming

Back to the OP's question...the YouTube playlist that Joe Ross shared looks it should give you a great start.

Beyond those tutorials, I would recommend taking one of your team's old robots and trying to write new code for it using the command-based model. You'll often find that writing even simple robot code can be a difficult challenge when you're unfamiliar with a language or framework.
Reply With Quote
  #7   Spotlight this post!  
Unread 05-04-2014, 18:05
jalburty jalburty is offline
Joe Alburty
AKA: Joe Alburty
FRC #1763 (Paseo Pirates)
Team Role: Mentor
 
Join Date: Oct 2006
Rookie Year: 2005
Location: Kansas City
Posts: 25
jalburty will become famous soon enoughjalburty will become famous soon enough
Send a message via ICQ to jalburty
Re: Command Based Programming

Watch the videos very closely and repeatedly if you have to until you understand each concept. In fact, I would recommend slowing down the video and watching it that way. Brad goes very fast. You can do this in YouTube if you upgrade your browser to HTML5 without distorting the audio.
Here's how: https://www.youtube.com/html5
Reply With Quote
  #8   Spotlight this post!  
Unread 05-04-2014, 22:42
Jasonism4me Jasonism4me is offline
Registered User
FRC #1806
 
Join Date: Jan 2014
Location: Smithville
Posts: 1
Jasonism4me is an unknown quantity at this point
Question Re: Command Based Programming

Hi! My team would like to switch to C++ next year but would like to have a programmer (me) that knows what they are doing before the year starts. I cannot find a good C++ guide or something similar to get me started and I am kind of confused with how the structure is supposed to work. Any good suggestions?
Reply With Quote
  #9   Spotlight this post!  
Unread 06-04-2014, 01:49
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: Command Based Programming

Quote:
Originally Posted by Jasonism4me View Post
Hi! My team would like to switch to C++ next year but would like to have a programmer (me) that knows what they are doing before the year starts. I cannot find a good C++ guide or something similar to get me started and I am kind of confused with how the structure is supposed to work. Any good suggestions?
That is a little hard to believe. There are hundreds of C++ books and/or "guides" out there. Where have you looked? What sort of background do you have? FIRST has a decent how-to-get started guide. Have you looked at that?

http://wpilib.screenstepslive.com/s/3120/m/7913
http://www.usfirst.org/roboticsprogr...twareresources
http://www.cplusplus.com/doc/tutorial/
http://www.cprogramming.com/tutorial/c++-tutorial.html
http://www.informit.com/store/accele...-9780201703535
http://www.stroustrup.com/Programming/

... google is your friend.

HTH
__________________
Fast, cheap or working - pick any two!
Reply With Quote
  #10   Spotlight this post!  
Unread 07-04-2014, 01:22
jmullins16's Avatar
jmullins16 jmullins16 is offline
Registered User
AKA: Jeff Mullins
FRC #2135 (Presentation Invasion)
Team Role: Mentor
 
Join Date: Nov 2011
Rookie Year: 2011
Location: San Jose, CA
Posts: 23
jmullins16 is an unknown quantity at this point
Re: Command Based Programming

I agree there are lots of good tutorials on getting started with C++. Keith has a very good list and I've been through many of them in getting our team started using C++ two years ago. Some are focused on writing a generic C++ program, Object-Oriented programming, or specifically using C++ with WPILib for an FRC robot (screenstepslive).

I recommend that if you have a robot to test with, stay close to the WPILib/screensteps tutorials which get you going very quickly. And if you want to have an initial set of template headers and source files to see how a project fits together, take a look at RobotBuilder. It will get you a working C++ project that is driving with only a few lines of your own code. It can sometimes be easier learning the language when you see lots of the structure in place for you to modify.

If you don't have a robot to learn the language right away, then I would focus on the more generic C++ tutorials that can be run with most C++ compilers. Retention is always better when you have to debug something and make it work.

By using RobotBuilder our team spends more time figuring out WPILib calls to add robot functionality than how to use C++ as a language. And that's what I want them to do.
Reply With Quote
  #11   Spotlight this post!  
Unread 06-02-2015, 11:31
King Nerd III's Avatar
King Nerd III King Nerd III is offline
Chief Programmer/Head of Autonomous
AKA: Isaac
FRC #1410 (The Kraken)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Denver, CO
Posts: 116
King Nerd III is an unknown quantity at this point
Re: Command Based Programming

I created a new template with a huge amount of comments and examples if you want to check it out:
http://www.chiefdelphi.com/forums/sh...d.php?t=133961
This is based off of how our robot will be set up this year, and should be rather easy to follow. Just make sure you don't miss the Robot::insertobjecthere or most things as it is what causes most errors for my under programmers.
-Lord Supreme Programmer for Team 1410 Isaac

Last edited by King Nerd III : 06-02-2015 at 11:34.
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 01:14.

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