Go to Post I'm frustrated by the world's reluctance to bend over backwards for FIRST. - Madison [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 14-01-2012, 21:10
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,169
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
SimpleTemplate project not working

We can build, deploy and run the BuiltinDefault project and it works as expected. The SimpleTemplate project does not run the motors. We printed out the joystick inputs and they look correct. Anyone else have the same issue?
Reply With Quote
  #2   Spotlight this post!  
Unread 14-01-2012, 22:45
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 588
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
Are the motor ports correctly set to match your robot?

Brad
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
Reply With Quote
  #3   Spotlight this post!  
Unread 14-01-2012, 22:55
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,169
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: SimpleTemplate project not working

Quote:
Originally Posted by BradAMiller View Post
Are the motor ports correctly set to match your robot?
Brad

Left and right are connected to PWM 1 & 2 - the BuitinDefault example project works w/o touching the hardware.
Reply With Quote
  #4   Spotlight this post!  
Unread 15-01-2012, 11:25
pmalmsten pmalmsten is offline
Registered User
no team
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2006
Location: United States
Posts: 9
pmalmsten is on a distinguished road
Re: SimpleTemplate project not working

Would you mind posting the SimpleTemplate-based code which does not work?
Reply With Quote
  #5   Spotlight this post!  
Unread 15-01-2012, 11:32
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,169
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: SimpleTemplate project not working

Quote:
Originally Posted by pmalmsten View Post
Would you mind posting the SimpleTemplate-based code which does not work?
I'll post the code when I get back to our lab. But it is the SimpleTemplate example with NO alterations.

I know this sounds weird. We must be missing something simple. I did not beleive the students when they first asked for my help. But I'm an expert with Workbench and VxWorks and I can't see why it should not work. The BuiltinDefaultCode project works but the SimpleTemplate does not. We can load one right after the other and reproduce this every time so we KNOW there are no hardware configuration issues.

Could it be the safety functions? That is the only real difference in the 2 examples.


Thanks
Reply With Quote
  #6   Spotlight this post!  
Unread 15-01-2012, 12:42
pmalmsten pmalmsten is offline
Registered User
no team
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2006
Location: United States
Posts: 9
pmalmsten is on a distinguished road
Re: SimpleTemplate project not working

The SimpleRobotTemplateProject does not include any code to read sensors, drive wheels, etc. It's only a template for a project, not an example. It will do nothing.

To make this do something, you will need to create your own motor objects and joystick objects. There's a method called operatorControl() in the code included within the SimpleRobotTemplateProject; this will be called when the robot enters teleoperated mode. Put your code there.

Take a look inside the sample projects or look at the documentation for WPILib to see how this works.
__________________
~Paul Malmsten
Reply With Quote
  #7   Spotlight this post!  
Unread 15-01-2012, 12:50
RufflesRidge RufflesRidge is offline
Registered User
no team
 
Join Date: Jan 2012
Location: USA
Posts: 989
RufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant future
Re: SimpleTemplate project not working

Paul,
The C++ simple Template code does indeed contain code for doing arcade drive of a two motor robot.

Keith,
Are you seeing any errors in the Messages box on the Driver Station Diagnostics tab?
Reply With Quote
  #8   Spotlight this post!  
Unread 15-01-2012, 12:57
pmalmsten pmalmsten is offline
Registered User
no team
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2006
Location: United States
Posts: 9
pmalmsten is on a distinguished road
Re: SimpleTemplate project not working

My apologies, I mostly work with the Java branch of WPILib, and nothing is included in the equivalent SimpleRobotTemplateProject in that world. Ignore my previous post.

Have you tried using the NetConsole to look for errors? You can enable this from the FRC cRIO Imaging Tool, and then run the NetConsole on your laptop. In some cases error messages will appear there.
__________________
~Paul Malmsten
Reply With Quote
  #9   Spotlight this post!  
Unread 15-01-2012, 17:24
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,169
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: SimpleTemplate project not working

Thanks for the input guys. There are no messages coming from the console after the code starts up (but I have not run it from the debugger yet) . I am thinking it has something to do with the safety functions but have not gotten back to the lab to try anything new.

We do not use SimpleTemplate for anything on the competition robot. Our "real" code is built directly on the RobotBase classes and uses multi-tasking and a message system (using VxWorks msqQLib) to implement all the competition features. Our rookies built the kitbot at a QuickBuild session and were trying to practice some programming skills.
Reply With Quote
  #10   Spotlight this post!  
Unread 15-01-2012, 20:22
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,169
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: SimpleTemplate project not working

This the code for the simple robot template project.


-------------------------

#include "WPILib.h"

/**
* This is a demo program showing the use of the RobotBase class.
* The SimpleRobot class is the base of a robot application that will automatically call your
* Autonomous and OperatorControl methods at the right time as controlled by the switches on
* the driver station or the field controls.
*/
class RobotDemo : public SimpleRobot
{
RobotDrive myRobot; // robot drive system
Joystick stick; // only joystick

public:
RobotDemo(void):
myRobot(1, 2), // these must be initialized in the same order
stick(1) // as they are declared above.
{
myRobot.SetExpiration(0.1);
}

/**
* Drive left & right motors for 2 seconds then stop
*/
void Autonomous(void)
{
myRobot.SetSafetyEnabled(false);
myRobot.Drive(0.5, 0.0); // drive forwards half speed
Wait(2.0); // for 2 seconds
myRobot.Drive(0.0, 0.0); // stop robot
}

/**
* Runs the motors with arcade steering.
*/
void OperatorControl(void)
{
myRobot.SetSafetyEnabled(true);
while (IsOperatorControl())
{
myRobot.ArcadeDrive(stick); // drive with arcade style (use right stick)
Wait(0.005); // wait for a motor update time
}
}
};

START_ROBOT_CLASS(RobotDemo);
Reply With Quote
  #11   Spotlight this post!  
Unread 16-01-2012, 02:20
enrique's Avatar
enrique enrique is offline
Registered User
FRC #1251 (Tech Tigers)
Team Role: Electrical
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Florida
Posts: 87
enrique will become famous soon enough
Send a message via Yahoo to enrique
Smile Re: SimpleTemplate project not working

A couple of things to check:

In the code, make sure your speed controller declarations match the speed controllers your using. (Victor, Jaguar)

Make sure the digital side car shows 3 green lights in the area that shows 5v.
If it does not then your missing the digital side car power.

Make sure the side car cable is tight on both sides.

Make sure the modules are in the correct slot.

If you tried the above then try a new side car.
If still having problems then try changing the actual module.
Reply With Quote
  #12   Spotlight this post!  
Unread 16-01-2012, 02:40
enrique's Avatar
enrique enrique is offline
Registered User
FRC #1251 (Tech Tigers)
Team Role: Electrical
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Florida
Posts: 87
enrique will become famous soon enough
Send a message via Yahoo to enrique
Re: SimpleTemplate project not working

Also check side car data cable to see if you got one of the ones that need the rework:
http://www.usfirst.org/sites/default...structions.pdf
Reply With Quote
  #13   Spotlight this post!  
Unread 16-01-2012, 06:27
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,169
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: SimpleTemplate project not working

Quote:
Originally Posted by enrique View Post
A couple of things to check:

In the code, make sure your speed controller declarations match the speed controllers your using. (Victor, Jaguar)

Make sure the digital side car shows 3 green lights in the area that shows 5v.
If it does not then your missing the digital side car power.

Make sure the side car cable is tight on both sides.

Make sure the modules are in the correct slot.

If you tried the above then try a new side car.
If still having problems then try changing the actual module.

Thanks for the advice! But note from comments above that the BuiltinDefaultCode project works w/o any hardware changes. It can't possibly be a simple hardware issue.
Reply With Quote
  #14   Spotlight this post!  
Unread 16-01-2012, 13:24
enrique's Avatar
enrique enrique is offline
Registered User
FRC #1251 (Tech Tigers)
Team Role: Electrical
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Florida
Posts: 87
enrique will become famous soon enough
Send a message via Yahoo to enrique
Smile Re: SimpleTemplate project not working

Quote:
Originally Posted by wireties View Post
Thanks for the advice! But note from comments above that the BuiltinDefaultCode project works w/o any hardware changes. It can't possibly be a simple hardware issue.
Yes, you are correct, but my suggestions are based on common mistakes putting together the hardware. And the second post is based on a mistake from whom ever put the data cables together for First. The default project would work the first time every single time if humans never made mistakes.

Except for the declarations part and dout that is a problem.

Last edited by enrique : 16-01-2012 at 13:26.
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 12:22.

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