Go to Post TL;DR: The robot battery (and your car battery) aren't going to electrocute you unless you stab a positive and negative wire from them into your heart. In which case you have plenty of other problems besides. - Kevin Sevcik [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 08-02-2007, 08:09
Demothesis's Avatar
Demothesis Demothesis is offline
Team Leader/Programmer
FRC #2169 (KING TeC)
Team Role: Leadership
 
Join Date: Dec 2006
Rookie Year: 2007
Location: Prior Lake
Posts: 32
Demothesis is on a distinguished road
CMUCam and autonomous code

How do you interface the streamlined version of Kevin's CMUCam code with the default code? I understand that you change the position o fthe robot as a whole based upon the pulses you send to the camera's servos, but how or where do you put the camera code into the default code?
  #2   Spotlight this post!  
Unread 08-02-2007, 09:39
Bomberofdoom's Avatar
Bomberofdoom Bomberofdoom is offline
Biggest FIRST addict in Israel
AKA: Nir Levanon
FRC #2230 (Zcharia's Angels)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Israel
Posts: 471
Bomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond repute
Send a message via MSN to Bomberofdoom
Re: CMUCam and autonomous code

The default code, from what I understood, focuses on giving you the simplest code to control your robot. It doesn't include other components except those related to the "cart".

Kevin's CMU code takes the default code and adds the camera functions and varibles so you can use them to work on targeting the lights on the rack and using the functions and varibles to do things around the arena(such as going to the spiders).

I'm affraid that using the default code with the camera won't be possible(you'll be controling the tilt of the camera with the Y axis of your joysticks ).

You shouldn't have any problem at all using codes you've written in the default code(and those that actuall worked) and transfer them to the CMU code. The CMU code is there to give your more options.

Hope I helped and good luck!
  #3   Spotlight this post!  
Unread 08-02-2007, 11:05
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: CMUCam and autonomous code

Quote:
Originally Posted by Demothesis View Post
How do you interface the streamlined version of Kevin's CMUCam code with the default code?
You don't. Instead, you do it the other way around, and make the necessary modifications to Default_Routine in the camera code project. Just map the OI inputs you need to the motors and relays you're using, and make sure you let the camera tracking code control the servos.

Then, when you have the robot running manually and the camera still tracking the light at the same time, you can start getting fancy with software to run the robot automatically based on what the camera is telling you.
  #4   Spotlight this post!  
Unread 08-02-2007, 21:15
Ianuser Ianuser is offline
Registered User
FRC #0570
 
Join Date: Feb 2007
Location: new york
Posts: 64
Ianuser is an unknown quantity at this point
Re: CMUCam and autonomous code

I have a question. Do I need to measure the degree angle of the camera (pan/tilt) and do I need to use it in order to allow the robot to move itself during manual routines?

if (get_tracking_state() == CAMERA_ON_TARGET)
{
set pwm values;
}

Would that work? Might I put this in Process_Data_From_Master_uP?
  #5   Spotlight this post!  
Unread 08-02-2007, 21:25
Ianuser Ianuser is offline
Registered User
FRC #0570
 
Join Date: Feb 2007
Location: new york
Posts: 64
Ianuser is an unknown quantity at this point
Re: CMUCam and autonomous code

Also, I'd need to calculate the distance to the light in order to stop the pwm's? (if so...I know the formula, but how the heck to I get it to work? I don't even know where to begin for that)
  #6   Spotlight this post!  
Unread 11-02-2007, 15:58
Bomberofdoom's Avatar
Bomberofdoom Bomberofdoom is offline
Biggest FIRST addict in Israel
AKA: Nir Levanon
FRC #2230 (Zcharia's Angels)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Israel
Posts: 471
Bomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond repute
Send a message via MSN to Bomberofdoom
Re: CMUCam and autonomous code

Well, you asked me to answer like this, so my answer is yes.
  #7   Spotlight this post!  
Unread 12-02-2007, 23:45
Demothesis's Avatar
Demothesis Demothesis is offline
Team Leader/Programmer
FRC #2169 (KING TeC)
Team Role: Leadership
 
Join Date: Dec 2006
Rookie Year: 2007
Location: Prior Lake
Posts: 32
Demothesis is on a distinguished road
Re: CMUCam and autonomous code

Cool. Now I see that the camera code is just kind of inserted into the default code. How convenient, no?
  #8   Spotlight this post!  
Unread 13-02-2007, 04:12
Bomberofdoom's Avatar
Bomberofdoom Bomberofdoom is offline
Biggest FIRST addict in Israel
AKA: Nir Levanon
FRC #2230 (Zcharia's Angels)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Israel
Posts: 471
Bomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond repute
Send a message via MSN to Bomberofdoom
Re: CMUCam and autonomous code

Yep, just one thing, you'll need to commnet/uncomment some code lines in the camera code in order to use some of the default code stuff, such as the engines. It's more of where exactly you call the functions. Don't worry, if something doesn't work in your code(and it was compiled succesfuly) it probablly means that you need to change the place where you call the code lines or functions.

Really, it's no big deal.
  #9   Spotlight this post!  
Unread 13-02-2007, 10:11
Demothesis's Avatar
Demothesis Demothesis is offline
Team Leader/Programmer
FRC #2169 (KING TeC)
Team Role: Leadership
 
Join Date: Dec 2006
Rookie Year: 2007
Location: Prior Lake
Posts: 32
Demothesis is on a distinguished road
Re: CMUCam and autonomous code

yeah, i heard about uncommenting some functin like "default_routine()" or something like that and change something with PWM01 and PWM02. What exactly is that that because it confused me, and it didn't work.
  #10   Spotlight this post!  
Unread 13-02-2007, 10:13
Bomberofdoom's Avatar
Bomberofdoom Bomberofdoom is offline
Biggest FIRST addict in Israel
AKA: Nir Levanon
FRC #2230 (Zcharia's Angels)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Israel
Posts: 471
Bomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond repute
Send a message via MSN to Bomberofdoom
Re: CMUCam and autonomous code

Uncomment Default_Routine() and comment pwm01 = p1_y and pwm02 = p2_y.
  #11   Spotlight this post!  
Unread 13-02-2007, 10:51
Bharat Nain's Avatar
Bharat Nain Bharat Nain is offline
Registered User
no team
Team Role: Alumni
 
Join Date: Jan 2004
Rookie Year: 2003
Location: New York
Posts: 2,000
Bharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond repute
Send a message via AIM to Bharat Nain Send a message via MSN to Bharat Nain
Re: CMUCam and autonomous code

Quote:
Originally Posted by Demothesis View Post
yeah, i heard about uncommenting some functin like "default_routine()" or something like that and change something with PWM01 and PWM02. What exactly is that that because it confused me, and it didn't work.
If you have two different sets of code trying to control one pwm output, the processor is well going to be confused just like you. When you write your code, you need to make sure only one set of values is output to a pwm at any given time. Therefore, when using Kevin Watson's code, you need to comment out pwm01 and pwm02(or whichever you choose to use really). Look at the above post also.
__________________
-= Bharat Nain =-

Whatever you do, you need courage. Whatever course you decide upon, there is always someone to tell you that you are wrong. There are always difficulties arising that tempt you to believe your critics are right. To map out a course of action and follow it to an end requires some of the same courage that a soldier needs. Peace has its victories, but it takes brave men and women to win them. - Ralph Waldo Emerson
  #12   Spotlight this post!  
Unread 15-02-2007, 10:35
Demothesis's Avatar
Demothesis Demothesis is offline
Team Leader/Programmer
FRC #2169 (KING TeC)
Team Role: Leadership
 
Join Date: Dec 2006
Rookie Year: 2007
Location: Prior Lake
Posts: 32
Demothesis is on a distinguished road
Re: CMUCam and autonomous code

I kind of figured that, but it didn't work. the good thing is, it doesn't matter anyway. I need to know how to work the camera from autonomous code.

Demothesis
  #13   Spotlight this post!  
Unread 15-02-2007, 11:08
Bharat Nain's Avatar
Bharat Nain Bharat Nain is offline
Registered User
no team
Team Role: Alumni
 
Join Date: Jan 2004
Rookie Year: 2003
Location: New York
Posts: 2,000
Bharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond repute
Send a message via AIM to Bharat Nain Send a message via MSN to Bharat Nain
Re: CMUCam and autonomous code

Quote:
Originally Posted by Demothesis View Post
I kind of figured that, but it didn't work. the good thing is, it doesn't matter anyway. I need to know how to work the camera from autonomous code.

Demothesis
You call the same processes used in user_routines.c. Off the top of my head, I think they are Camera_Hander(); and Servo_Track();.
__________________
-= Bharat Nain =-

Whatever you do, you need courage. Whatever course you decide upon, there is always someone to tell you that you are wrong. There are always difficulties arising that tempt you to believe your critics are right. To map out a course of action and follow it to an end requires some of the same courage that a soldier needs. Peace has its victories, but it takes brave men and women to win them. - Ralph Waldo Emerson
  #14   Spotlight this post!  
Unread 15-02-2007, 13:22
Bomberofdoom's Avatar
Bomberofdoom Bomberofdoom is offline
Biggest FIRST addict in Israel
AKA: Nir Levanon
FRC #2230 (Zcharia's Angels)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Israel
Posts: 471
Bomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond repute
Send a message via MSN to Bomberofdoom
Re: CMUCam and autonomous code

Camera_Handler() *
  #15   Spotlight this post!  
Unread 16-02-2007, 08:06
Demothesis's Avatar
Demothesis Demothesis is offline
Team Leader/Programmer
FRC #2169 (KING TeC)
Team Role: Leadership
 
Join Date: Dec 2006
Rookie Year: 2007
Location: Prior Lake
Posts: 32
Demothesis is on a distinguished road
Re: CMUCam and autonomous code

Okay, camera_handler() and not servo_track()? Is there any other special code that I have to write or work around in order to use the PWMs in autonomous mode? If so, will it conflict with the values mapped to the camera PWMs?

Demothesis
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
Problems integrating CMUCAM code and IFI Default Code Windward Programming 2 06-02-2007 16:48
CMUcam default code not responding Kyveck Programming 29 26-01-2006 16:25
Autonomous: CMUCam or dead reckoning? Andrew Blair Rules/Strategy 18 26-02-2005 19:36
CMUcam autonomous programming kshot Programming 1 17-01-2005 19:18
Anybody have a code for an autonomous mode to go to the 50 point bar???? and... chaoticprout Programming 9 06-11-2004 12:22


All times are GMT -5. The time now is 00:24.

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