Go to Post [In FIRST]...Arab and Israeli students speak on the same level, because they are alliance partners. - Tottanka [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 10-02-2013, 23:43
zackd97 zackd97 is offline
Registered User
FRC #4102
 
Join Date: Feb 2013
Rookie Year: 2013
Location: New Mexico
Posts: 16
zackd97 is an unknown quantity at this point
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.
Reply With Quote
  #2   Spotlight this post!  
Unread 11-02-2013, 08:14
kenfox kenfox is offline
Registered User
FRC #3322 (Eagle Imperium)
Team Role: Mentor
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Ann Arbor, MI
Posts: 52
kenfox is a glorious beacon of lightkenfox is a glorious beacon of lightkenfox is a glorious beacon of lightkenfox is a glorious beacon of lightkenfox is a glorious beacon of light
Re: Help With Command Based Programming

Quote:
Originally Posted by zackd97 View Post
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
Reply With Quote
  #3   Spotlight this post!  
Unread 11-02-2013, 11:26
zackd97 zackd97 is offline
Registered User
FRC #4102
 
Join Date: Feb 2013
Rookie Year: 2013
Location: New Mexico
Posts: 16
zackd97 is an unknown quantity at this point
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.
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 15:07.

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