View Full Version : Is there an open source robot project out there based of of WPI's SimpleTemplate
pipsqueaker
06-05-2013, 21:13
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?
mlbernardoni
06-05-2013, 23:13
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
virtuald
06-05-2013, 23:14
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/
bob.wolff68
08-05-2013, 15:57
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
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!!
ekapalka
27-11-2013, 12:14
Something like this? #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: #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?
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.