Go to Post Success is realizing that anything is possible, persistence is the key. - SlamminSammy [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 06-05-2013, 21:13
pipsqueaker pipsqueaker is offline
Registered User
FRC #1124
 
Join Date: Apr 2013
Location: Avon
Posts: 57
pipsqueaker is a name known to allpipsqueaker is a name known to allpipsqueaker is a name known to allpipsqueaker is a name known to allpipsqueaker is a name known to allpipsqueaker is a name known to all
Is there an open source robot project out there based of of WPI's SimpleTemplate

I'm new to c++ and I'm trying to code our bot in it, and I really need a reference point (none of the upperclassman coders are helping me). Are there any open source projects for robots out there I could just look at from time to time to learn what I should be doing?
Reply With Quote
  #2   Spotlight this post!  
Unread 06-05-2013, 23:13
mlbernardoni mlbernardoni is offline
Registered User
FRC #2704
 
Join Date: Mar 2011
Location: Batavia, IL
Posts: 11
mlbernardoni is on a distinguished road
Re: Is there an open source robot project out there based of of WPI's SimpleTemplate

Team 2704's code from 2013 season is posted at:
http://www.firstplusplus.com/samplerobot-code.html

If you have any questions, or to set up a skype session contact us at:
http://www.firstplusplus.com/contact-us.html
Reply With Quote
  #3   Spotlight this post!  
Unread 06-05-2013, 23:14
virtuald's Avatar
virtuald virtuald is offline
RobotPy Guy
AKA: Dustin Spicuzza
FRC #1418 (), FRC #1973, FRC #4796, FRC #6367 ()
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2003
Location: Boston, MA
Posts: 1,039
virtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant future
Re: Is there an open source robot project out there based of of WPI's SimpleTemplate

Quote:
Originally Posted by pipsqueaker View Post
I'm new to c++ and I'm trying to code our bot in it, and I really need a reference point (none of the upperclassman coders are helping me). Are there any open source projects for robots out there I could just look at from time to time to learn what I should be doing?
Our 2009 and 2010 robots were done in C++. http://www.virtualroadside.com/FRC/
__________________
Maintainer of RobotPy - Python for FRC
Creator of pyfrc (Robot Simulator + utilities for Python) and pynetworktables/pynetworktables2js (NetworkTables for Python & Javascript)

2017 Season: Teams #1973, #4796, #6369
Team #1418 (remote mentor): Newton Quarterfinalists, 2016 Chesapeake District Champion, 2x Innovation in Control award, 2x district event winner
Team #1418: 2015 DC Regional Innovation In Control Award, #2 seed; 2014 VA Industrial Design Award; 2014 Finalists in DC & VA
Team #2423: 2012 & 2013 Boston Regional Innovation in Control Award


Resources: FIRSTWiki (relaunched!) | My Software Stuff
Reply With Quote
  #4   Spotlight this post!  
Unread 08-05-2013, 15:57
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: 152
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: Is there an open source robot project out there based of of WPI's SimpleTemplate

Team 1967's code is open source at github.

https://github.com/bobwolff68/FRCTeam1967

There are several test jig programs that keep it simple as well as competition sources too.

Feel free to ask questions.

bob
__________________
~~~~~~~~~~~~~~~~~~~
Bob Wolff - Software from the old-school
Mentor / C / C++ guy
Team 1967 - The Janksters - San Jose, CA
Reply With Quote
  #5   Spotlight this post!  
Unread 27-11-2013, 08:26
MichelB's Avatar
MichelB MichelB is offline
Jack Of All Trades
FRC #3941 (Absolute Zero Electricity)
Team Role: Electrical
 
Join Date: Nov 2013
Rookie Year: 2012
Location: Havre De Grace, MD
Posts: 51
MichelB is an unknown quantity at this point
Re: Is there an open source robot project out there based of of WPI's SimpleTemplate

I was looking for sample robot code and stumbled upon this thread. Its great but I am looking for specific pieces of code and it seems like I need to download each code seperately. Can someone post the element of each code so that this won't be necessary?

Thank y'all!!
Reply With Quote
  #6   Spotlight this post!  
Unread 27-11-2013, 12: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: Is there an open source robot project out there based of of WPI's SimpleTemplate

Something like this?
Code:
#include <WPILib.h>
//Import necessary libraries here
class DefaultRobot : public SimpleRobot{
	//allocate all required components
	public:
	DefaultRobot(void){	
		//Initialize components
	}
	void Autonomous(void){
		//Run once at the beginning of autonomous
		while(IsAutonomous()){
			//Code that runs throughout autonomous
		}	
	}
	void OperatorControl(void){
		//Run once at the beginning of teleop
		while (IsOperatorControl()){
			//Code that runs throughout teleop
		}
	}
};
START_ROBOT_CLASS(DefaultRobot);
The most basic thing I would then do with this is the following:
Code:
#include <WPILib.h>
class DefaultRobot : public SimpleRobot{	
	Joystick *leftStick;			       
	Joystick *rightStick;          
	RobotDrive *myRobot;                   
	public:
	DefaultRobot(void){	
		leftStick = new Joystick(1);  //USB port 1
		rightStick = new Joystick(2);  //USB port 2
		myRobot = new RobotDrive(1,2); //motor controllers plugged into PWM 1 and 2
	}
	void Autonomous(void){
		while(IsAutonomous()){
		}				
	}
	void OperatorControl(void){
		while (IsOperatorControl()){	
			float leftStickYAxis = leftStick->GetY();
			float rightStickYAxis = rightStick->GetY();	
			myRobot->TankDrive(-leftStickYAxis, rightStickYAxis);  //negate axes depending on the robot's behaviour
		}
	}
};

START_ROBOT_CLASS(DefaultRobot);
Does this help at all? What type of drivetrain are you programming?

Last edited by ekapalka : 27-11-2013 at 12:16.
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 02:45.

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