Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   Help With Command Based Programming (http://www.chiefdelphi.com/forums/showthread.php?t=113225)

zackd97 10-02-2013 23:43

Help With Command Based Programming
 
Hi all,

This is my first year doing FRC and I've been given the task of programming. I don't have a lot of experience, but I've managed to put together a program in RobotBuilder. So far the only subsystem I've written functional stuff for has been the LaunchingWheel. I'm working on getting the chassis working now, but I've hit a big road block. Following this tutorial (http://wpilib.screenstepslive.com/s/...-and-joysticks) I've managed to put together a code that builds, but it doesn't do anything. I think the problem has something to do with the chassis.cpp because I don't really understand much of what I did in it. If anyone could offer any help, it would be greatly appreciated.

The code can be found here- https://github.com/zackd97/RobotProject3

Sorry for spelling mistakes in the program. This is also my first time using github, so if I did something wrong let me know.

kenfox 11-02-2013 08:14

Re: Help With Command Based Programming
 
Quote:

Originally Posted by zackd97 (Post 1231337)
This is my first year doing FRC and I've been given the task of programming. I don't have a lot of experience, but I've managed to put together a program in RobotBuilder.

You're doing really well so far! Just keep asking here if you get stuck.

Quote:

I've managed to put together a code that builds, but it doesn't do anything.
For teleop driving, you need to set the default command on your Chasis subsystem. This command runs when no other command wants to do something with the chassis drivetrain. DriveWithJoystick will work fine as the default Chasis command. Set that in robot builder and regenerate C++ code. (Make sure you have the 2nd mid-season C++ update)

The file Subsystems/Chasis.cpp won't compile after you add the default command because C++ doesn't know where to find the definition of DriveWithJoystick.

To fix that, near the top of Chasis.cpp, after all the other #include commands, add this:

Code:

#include "../Commands/DriveWithJoystick.h"
Now it should compile and you can control the motors with the right joystick's X and Y axes.

Quote:

The code can be found here- https://github.com/zackd97/RobotProject3
Put your code directly into github without zipping it up first. This lets you track changes on individual files. Here's one of our robot tests so you have an example of how it will look in github: https://github.com/FRC3322/ShooterFeederTest

zackd97 11-02-2013 11:26

Re: Help With Command Based Programming
 
Thanks a ton! I had a feeling the problem had something to do with the default command, but I had no idea how to fix it.


All times are GMT -5. The time now is 13:39.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi