Go to Post -Best FIRST Robot: One that Makes it to Competition - Conor Ryan [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 05-02-2009, 22:26
dmoody92 dmoody92 is offline
Registered User
FRC #3015
 
Join Date: Jan 2009
Location: Spencerport, NY
Posts: 37
dmoody92 is a jewel in the roughdmoody92 is a jewel in the roughdmoody92 is a jewel in the roughdmoody92 is a jewel in the rough
Autonomous Issues!

Hello. We'll the build season is winding down and I am flipping out a little bit because I am running out of time with some major things to do. It was pretty tough to go from not even knowing what lab view was a few months to make an entire robot, oh yea..also our entire programming team consists of me and another kid who has no idea what he's doing, lol! Ok, enough self pity, here's whats going on.

Today was the first day I tested out our autonomous program that I made (we are having a very simple autonomous program as we are rookies). When I run it, I get an error code saying that the PWMs are already allocated even though I only have two motors being run during this time so there should be no conflicts. Soon after I realized that in autonomous I could also trigger teleop code! Then I realized that I had PWM 1 and 3 being used in both autonomous and teleop. When I switched the teleop PWMs it worked shortly until reverting back to the same error even though I was communicating to four different PWM slots.

So the issue is the fact I seem to get a degree of crossover between teleop and autonomous which doesn't make sense to me. I can't get my code up right now but I will soon, but I wanted to post this as soon as I could because of time. Any help would be REALLY appreciated!!
  #2   Spotlight this post!  
Unread 06-02-2009, 00:21
nathanww nathanww is offline
Hacker
FRC #1678 (Citrus Circuits)
Team Role: Programmer
 
Join Date: Dec 2008
Rookie Year: 2007
Location: Davis, CA
Posts: 224
nathanww is just really nicenathanww is just really nicenathanww is just really nicenathanww is just really nice
Re: Autonomous Issues!

I'm not exactly sure what your problem is--are you trying to declare new victors or jaguars in both your auto mode and your teleop mode? If so, it might make more sense just to do it in the constructor so that both modes can acsess the motors without conflicts.
__________________
Get yer robot source code here!
  #3   Spotlight this post!  
Unread 06-02-2009, 06:32
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: Autonomous Issues!

yes, try this
Code:
 #include "WPILib.h"
class RobotDemo:public SimpleRobot
{
    RobotDrive myRobot;
    Joystick stick;
public:
    RobotDemo():
    myRobot(1,3), stick(1){}
    void Autonomous()
    { 
      myRobot.Drive(1,0);
      Wait(1);
      myRobot.Drive(0);
    }
    void OperatorControl()
    {
     while (IsOperatorControl(){
       myRobot.ArcadeDrive(stick);
       }
    }
};
this creates them as accessable inside all the functions in the class
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib
  #4   Spotlight this post!  
Unread 06-02-2009, 09:24
Big Kid's Avatar
Big Kid Big Kid is offline
The Coach
AKA: Nick Acosta
FRC #0816 (WesTech Anomaly)
Team Role: Mentor
 
Join Date: Dec 2007
Rookie Year: 2008
Location: Westampton, NJ
Posts: 124
Big Kid is a jewel in the roughBig Kid is a jewel in the roughBig Kid is a jewel in the rough
Send a message via AIM to Big Kid
Re: Autonomous Issues!

if you are using labview you have to create global referances to run the motors in auto if you are opening them in the robot main.
__________________
Team 816
Student (2007-2011)
Mentor/Drive Coach (2013-)

Team 2495
Mentor (2016-)

Graduate Mech. Engineer at Lehigh University
  #5   Spotlight this post!  
Unread 07-02-2009, 11:02
dmoody92 dmoody92 is offline
Registered User
FRC #3015
 
Join Date: Jan 2009
Location: Spencerport, NY
Posts: 37
dmoody92 is a jewel in the roughdmoody92 is a jewel in the roughdmoody92 is a jewel in the roughdmoody92 is a jewel in the rough
Re: Autonomous Issues!

Thanks fro the responses.

I am not reinitializing new victors, I am getting error code -44037 saying that the PWMs are already allocated. I am using the global variable to share between the two modes as shown in the default code. I really need some help here if anyone might know the answer
  #6   Spotlight this post!  
Unread 07-02-2009, 13:34
domoarigato's Avatar
domoarigato domoarigato is offline
Team #1208 CCO
AKA: Coony
FRC #1208 (Metool Brigade)
Team Role: Engineer
 
Join Date: Nov 2008
Rookie Year: 2008
Location: O'Fallon, Il
Posts: 32
domoarigato is an unknown quantity at this point
Re: Autonomous Issues!

What are you trying to control with PWMs 1 and 3? If they're just drive motors, you should be able to control them by using a global variable and then wiring the global to the drive train.... But if you're using them for something else... I'm not too sure. Probably would have to use global variables for that too. If you are making your own globals, make sure you are changing them from write to read mode when in autonomous. (right click it and change to read mode before wiring a new global to your autonomous stuffs)
  #7   Spotlight this post!  
Unread 07-02-2009, 17:58
jnorris jnorris is offline
Registered User
FRC #1492
 
Join Date: Jan 2009
Location: scottsdale
Posts: 2
jnorris is an unknown quantity at this point
Re: Autonomous Issues!

We had seen this error code and it seems to be caused when you deploy from the autonomous vi window. Apparently this only downloads the autonomous VI or some how messes up the globals. After editing the autonomous vi always deploy from the MAIN PROJECT window.
Closed Thread


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Autonomous questions (Labview) and some general issues Daniel_H NI LabVIEW 15 08-01-2009 21:07
VICTOR ISSUES merybar Electrical 12 15-02-2008 18:47
Newer issues.... etdeshon Programming 4 26-01-2008 07:56
Fundraising Issues... IraJason Fundraising 32 04-09-2006 16:03
Weight Issues KathieK General Forum 1 05-11-2004 18:03


All times are GMT -5. The time now is 17:32.

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