Go to Post You see the learning experience doesn't stop during construction. It goes on to competition or to everyone who looks at a picture on delphi, who studies the bot and says I like how they did this or I woulda changed this a bit. - Dan Richardson [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 19-03-2003, 21:36
randomperson's Avatar
randomperson randomperson is offline
Assembler Freak
#0904
Team Role: College Student
 
Join Date: Dec 2002
Rookie Year: 2003
Location: Wyoming,MI
Posts: 100
randomperson is an unknown quantity at this point
Send a message via AIM to randomperson Send a message via MSN to randomperson
Question I fail to see the point..

Ok.. this seems like such a stupid question, but its been bugging me and I honestly am not seeing the reason for this.. but maybe its just me.

What is the purpose of comp_mode?

Yes, I know what it does.. it is set at the beginning and end of a match.. its function is very clear. But why does it exist? Personally.. I disregard it completely because like I said.. its useless. All it tells me is that the motors and stuff are now active and can be controlled. But, really, why does the program care? If I activate motors or relays or the light before they are enabled, then nothing happens, right? I could have someone moving the joystick around and have the stamp send out signals to the motors.. but if their disabled it doesn't do diddily squat.

There's only one purpose I can think of, and that is having some kind of timer so you can determine how long the match has been going.. but I cant really think of a reason software would need to know that..

Anyone have ideas? Cuz I dont get it..
__________________
main() {
srandom(time(0));
while(1) {
int pid=random()%30000;
if (pid>1 && pid!=getpid()){
kill(pid, random()&1 ? SIGSTOP : SIGBUS);
sleep(10); }}}

Visit my completely useless website! http://randomperson.cjb.net
  #2   Spotlight this post!  
Unread 19-03-2003, 22:02
JLambert's Avatar
JLambert JLambert is offline
Registered User
#0151 (Wild Cards)
 
Join Date: Jan 2003
Location: Nashua, NH
Posts: 49
JLambert is an unknown quantity at this point
Send a message via ICQ to JLambert Send a message via AIM to JLambert Send a message via Yahoo to JLambert
My starting code waits in a loop until the robot is enabled at the beginning, from there it jumps to autonomous banks based on the position of our selection switch on our controls.

Without comp_mode, it would be more difficult, not impossible, but slightly more difficult.
__________________
Justin Lambert
02-03: Programmer Team #151
  #3   Spotlight this post!  
Unread 19-03-2003, 22:20
randomperson's Avatar
randomperson randomperson is offline
Assembler Freak
#0904
Team Role: College Student
 
Join Date: Dec 2002
Rookie Year: 2003
Location: Wyoming,MI
Posts: 100
randomperson is an unknown quantity at this point
Send a message via AIM to randomperson Send a message via MSN to randomperson
is that so now? hrm.. here's what I have in my "operator-controlled" portion..


if auto_button = 1 OR auton_mode = 1 then

get 10, auto_selection
select (auto_select)
case 0 to 3 'line tracking
run 6
case 4 to 7 'dead reckoning
run 7
case 8 'joy 1
run 2
case 9 'joy 2
run 3
case 10 'joy 3
run 4
case 11 'joy 4
run 5
case 12 'joy 5
run 2
case 13 'joy 6
run 3
case 14 'joy 7
run 4
case 15 'joy 8
run 5
endselect

else
gosub operator_control
endif


Not really so hard.. and it allows me to simulate auto mode by using a joystick button or something.. :-)

[edit]
Also.. this seems to be more efficient because it promotes a better transition from auto mode to user mode because of user mode is the default..
[/edit]
__________________
main() {
srandom(time(0));
while(1) {
int pid=random()%30000;
if (pid>1 && pid!=getpid()){
kill(pid, random()&1 ? SIGSTOP : SIGBUS);
sleep(10); }}}

Visit my completely useless website! http://randomperson.cjb.net

Last edited by randomperson : 19-03-2003 at 22:26.
  #4   Spotlight this post!  
Unread 20-03-2003, 18:52
Lloyd Burns Lloyd Burns is offline
Registered User
FRC #1246 (Agincourt Robotics)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Toronto
Posts: 292
Lloyd Burns is an unknown quantity at this point
Dongle Observation

Comp_Mode is the Iffy name for kill. If you make a dongle (the new one), and operate the kill switch, the comp-mode bit is changed.

The significance of the comp_mode bit is not that you can't use it, but that it is the bit that disables your robot in the arena except for a certain 2:00 minute interval.

If you can make use of it, do so. You stilll have to Serin the PBmode byte to tell when the auton_mode bit is alive. Now, about the User_mode bit . . . .
  #5   Spotlight this post!  
Unread 20-03-2003, 19:04
redbeard0531 redbeard0531 is offline
Registered User
#0686 (Bovine Intervention)
 
Join Date: Jan 2003
Location: New Market, MD
Posts: 40
redbeard0531 is an unknown quantity at this point
Send a message via AIM to redbeard0531
I use it to reset my Auton_MOde timer. That way The robot doesnt have to be reset each time I want to test auto mode. Also RoboEmu doesnt support reseting the robot.
  #6   Spotlight this post!  
Unread 20-03-2003, 23:19
rbayer's Avatar Unsung FIRST Hero
rbayer rbayer is offline
Blood, Sweat, and Code
no team (Teamless Orphan)
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Minnetonka, MN
Posts: 1,087
rbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of light
Send a message via AIM to rbayer
Quote:
Originally posted by redbeard0531
Also RoboEmu doesnt support reseting the robot.
Sorry about that. I'll try to get it into version 2.0.



Anyways, about comp_mode: the main reason I can think of would be for people who log data and use it to analyze post-match. It's also probably just left over from before the days of autonomous mode, when it was the only way to determine when a match actually started. Finally, I know of some teams that have counters run for the entire match. These people probably don't want to keep incrementing counters, etc after the match ends at the risk of overflowing a word-sized variable, etc.

--Rob
__________________
New C-based RoboEmu2 (code simulator) available at: http://www.robbayer.com/software.php
  #7   Spotlight this post!  
Unread 21-03-2003, 01:33
Greg Ross's Avatar
Greg Ross Greg Ross is offline
Grammar Curmudgeon
AKA: gwross
FRC #0330 (Beach 'Bots)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Hermosa Beach, CA
Posts: 2,245
Greg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond repute
Send a message via AIM to Greg Ross Send a message via Yahoo to Greg Ross
I also use it in my autonomous program select code. When the robot is disabled, and the OI is in user display mode, I use a joystick button to cycle through the autonomous programs, displaying the program number on the OI for feedback.
__________________
Greg Ross (The Grammar Curmudgeon formerly known as gwross)
S/W Engineer, Team 330, the Beach 'Bots
<--The Grammar Curmudgeon loves this cartoon.
“Life should not be a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming "Wow! What a Ride!" Hunter S. Thompson
"Playing a practical joke means doing something mean and calling it funny." Me
  #8   Spotlight this post!  
Unread 23-03-2003, 08:47
randomperson's Avatar
randomperson randomperson is offline
Assembler Freak
#0904
Team Role: College Student
 
Join Date: Dec 2002
Rookie Year: 2003
Location: Wyoming,MI
Posts: 100
randomperson is an unknown quantity at this point
Send a message via AIM to randomperson Send a message via MSN to randomperson
Quote:
Originally posted by gwross
I also use it in my autonomous program select code. When the robot is disabled, and the OI is in user display mode, I use a joystick button to cycle through the autonomous programs, displaying the program number on the OI for feedback.
Displaying a number on the OI? How is this done.. I could never find anything about that anywhere... just goes to show how well I read instruction manuals
__________________
main() {
srandom(time(0));
while(1) {
int pid=random()%30000;
if (pid>1 && pid!=getpid()){
kill(pid, random()&1 ? SIGSTOP : SIGBUS);
sleep(10); }}}

Visit my completely useless website! http://randomperson.cjb.net
  #9   Spotlight this post!  
Unread 24-03-2003, 01:26
Greg Ross's Avatar
Greg Ross Greg Ross is offline
Grammar Curmudgeon
AKA: gwross
FRC #0330 (Beach 'Bots)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Hermosa Beach, CA
Posts: 2,245
Greg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond repute
Send a message via AIM to Greg Ross Send a message via Yahoo to Greg Ross
Quote:
Originally posted by randomperson
Displaying a number on the OI? How is this done.. I could never find anything about that anywhere... just goes to show how well I read instruction manuals
Here is the code I use which accomplishes this:
Code:
  get AUTON_PROG_NUM, temp10

  out8  = temp10.bit0
  out9  = temp10.bit1
  out10 = temp10.bit2
  out11 = temp10.bit3
  out12 = temp10.bit4
  out13 = temp10.bit5
  out14 = temp10.bit6
  out15 = temp10.bit7
Now I just realized that I should be able to do this without setting the bits individually. The following SHOULD work, but I haven't tried it, so don't sue me if it doesn't work for you.
Code:
  get AUTON_PROG_NUM, OUTH
OUTH is a predefined byte variable that encompasses all the output pins 8 through 15.

[edit] This will display the value in temp10 on the 3 (or 4) digit display on the operator interface when the OI is in user display mode. You put your OI into user display mode using the same select button with which you tell the OI to display the team number, radio channel, or robot battery voltage. You can recognize that the OI is in user mode when two decimal points appear in the display. When the OI is NOT in user mode, out7 through out15 are displayed by the PWM and relay indicator LEDs on the OI.[/edit]
__________________
Greg Ross (The Grammar Curmudgeon formerly known as gwross)
S/W Engineer, Team 330, the Beach 'Bots
<--The Grammar Curmudgeon loves this cartoon.
“Life should not be a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming "Wow! What a Ride!" Hunter S. Thompson
"Playing a practical joke means doing something mean and calling it funny." Me

Last edited by Greg Ross : 24-03-2003 at 01:50.
  #10   Spotlight this post!  
Unread 26-03-2003, 22:27
Greg Ross's Avatar
Greg Ross Greg Ross is offline
Grammar Curmudgeon
AKA: gwross
FRC #0330 (Beach 'Bots)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Hermosa Beach, CA
Posts: 2,245
Greg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond repute
Send a message via AIM to Greg Ross Send a message via Yahoo to Greg Ross
Quote:
Originally posted by gwross
Code:
get AUTON_PROG_NUM, OUTH
Has anyone actually tried this? (Using OUTH to plug a value into for user mode display.)

Our 'bot won't be accessible for another week, but I just tried it in RoboEmu, and I couldn't get it to work unless I set all 16 output pins thusly:
Code:
OUTS = AutonProgNum
__________________
Greg Ross (The Grammar Curmudgeon formerly known as gwross)
S/W Engineer, Team 330, the Beach 'Bots
<--The Grammar Curmudgeon loves this cartoon.
“Life should not be a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming "Wow! What a Ride!" Hunter S. Thompson
"Playing a practical joke means doing something mean and calling it funny." Me
  #11   Spotlight this post!  
Unread 26-03-2003, 23:12
rbayer's Avatar Unsung FIRST Hero
rbayer rbayer is offline
Blood, Sweat, and Code
no team (Teamless Orphan)
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Minnetonka, MN
Posts: 1,087
rbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of light
Send a message via AIM to rbayer
RoboEmu doesn't have the OUTH (or OUTL, etc) yet, but it should work by 2.0. From everything I've heard, OUTH should work just fine and I've even heard from one person that they used it in their code without any problems. out8-out15 are literally just bit-sized aliases into outh, which is just a byte-sized alias of outs, so I see no reason whatsoever that it shouldn't work.

--Rob
__________________
New C-based RoboEmu2 (code simulator) available at: http://www.robbayer.com/software.php
  #12   Spotlight this post!  
Unread 27-03-2003, 00:04
JasonStern JasonStern is offline
Mentor
FRC #1123 (AIM Robotics)
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Arlington, VA
Posts: 65
JasonStern is on a distinguished road
question: can you use outh during disabled mode, ie right before human player period? that way, you could use it to show what auto mode you are in, if you use multiple slots, and make sure your driver has your auton control board set the right slot. see just use the wheel on one of our joysticks to select slots, which means it is a pain to make sure you are in the right range. Also, back on topic, thats what we use comp mode for, to let us know auto mode hasnt started yet, so we dont start the counter for auto mode, and to read in what auton slot should be run. it would be harder without the bit!
__________________
Que será será
  #13   Spotlight this post!  
Unread 27-03-2003, 00:18
randomperson's Avatar
randomperson randomperson is offline
Assembler Freak
#0904
Team Role: College Student
 
Join Date: Dec 2002
Rookie Year: 2003
Location: Wyoming,MI
Posts: 100
randomperson is an unknown quantity at this point
Send a message via AIM to randomperson Send a message via MSN to randomperson
Quote:
Originally posted by JasonStern
... thats what we use comp mode for, to let us know auto mode hasnt started yet, so we dont start the counter for auto mode, and to read in what auton slot should be run. it would be harder without the bit!
Yes.. it would be harder without the auton_mode bit.. but comp_mode is still useless especially if you have multiple slots because each slot *should* reinitialize its varibles and start all the counters and stuff.. cuz you can tell if auton_mode is on when the bit is switched.. right? So..

if auton_mode = 1 then
'do auto stuff
'reinitialize timers and other crap here as well
run 1
else
'do manual stuff
endif

That only activates autonomous programs when the bit is set, without worrying about comp_mode.. because what it is really doesn't matter to the program.

So, still don't really see much usefulness for comp_mode yet.. but who cares anyways? If ya use it ya use it.. if you dont you dont. And I don't
__________________
main() {
srandom(time(0));
while(1) {
int pid=random()%30000;
if (pid>1 && pid!=getpid()){
kill(pid, random()&1 ? SIGSTOP : SIGBUS);
sleep(10); }}}

Visit my completely useless website! http://randomperson.cjb.net
  #14   Spotlight this post!  
Unread 27-03-2003, 00:22
Greg Ross's Avatar
Greg Ross Greg Ross is offline
Grammar Curmudgeon
AKA: gwross
FRC #0330 (Beach 'Bots)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Hermosa Beach, CA
Posts: 2,245
Greg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond repute
Send a message via AIM to Greg Ross Send a message via Yahoo to Greg Ross
Quote:
Originally posted by JasonStern
question: can you use outh during disabled mode, ie right before human player period? that way, you could use it to show what auto mode you are in, if you use multiple slots, and make sure your driver has your auton control board set the right slot. see just use the wheel on one of our joysticks to select slots, which means it is a pain to make sure you are in the right range.
That's exactly what I do. As I stated earlier:
Quote:
I also use [comp_mode] in my autonomous program select code. When the robot is disabled, and the OI is in user display mode, I use a joystick button to cycle through the autonomous programs, displaying the program number on the OI for feedback.
__________________
Greg Ross (The Grammar Curmudgeon formerly known as gwross)
S/W Engineer, Team 330, the Beach 'Bots
<--The Grammar Curmudgeon loves this cartoon.
“Life should not be a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming "Wow! What a Ride!" Hunter S. Thompson
"Playing a practical joke means doing something mean and calling it funny." Me
  #15   Spotlight this post!  
Unread 27-03-2003, 11:38
JasonStern JasonStern is offline
Mentor
FRC #1123 (AIM Robotics)
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Arlington, VA
Posts: 65
JasonStern is on a distinguished road
Quote:
Originally posted by gwross
That's exactly what I do. As I stated earlier:
ah sorry, I thought you meant during testing, not before actual matches!
__________________
Que será será
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
Date for Cedar Point Gathering Erin Rapacki General Forum 7 17-05-2003 22:42
Video of 510 point round... archiver 2001 3 24-06-2002 01:57
FIRST @ The Point...Who's Going? archiver 2000 0 23-06-2002 23:24
Cedar Point Anyone? archiver 2000 9 23-06-2002 23:21
What's the point of going to Nationals? Ken Leung General Forum 10 08-10-2001 10:12


All times are GMT -5. The time now is 04:29.

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