Go to Post I think the GDC just saw Inception. - rtfgnow [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 17-09-2008, 22:11
whitetiger0990's Avatar
whitetiger0990 whitetiger0990 is offline
Registered User
no team
Team Role: Programmer
 
Join Date: Mar 2006
Rookie Year: 2006
Location: Earth
Posts: 157
whitetiger0990 is a glorious beacon of lightwhitetiger0990 is a glorious beacon of lightwhitetiger0990 is a glorious beacon of lightwhitetiger0990 is a glorious beacon of lightwhitetiger0990 is a glorious beacon of light
Re: Robot not doing what we need it to, and printfs aren't working

The only uncommented printf is: printf("IFI User Processor Initialized ...\r\n");

The other ones are commented out. Does that error have a line number with it?
__________________
print$q=chr(ord($q)+$1)while("7443-0201-8465130105-12-03135-82482113-06-7672-070208-0613-70"=~/(-?\d\d)/g);
  #2   Spotlight this post!  
Unread 17-09-2008, 22:15
Bryan Herbst's Avatar
Bryan Herbst Bryan Herbst is offline
Registered User
AKA: Bryan
FRC #2052 (KnightKrawler)
Team Role: Mentor
 
Join Date: Sep 2007
Rookie Year: 2007
Location: Minneapolis, Minnesota
Posts: 545
Bryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond repute
Re: Robot not doing what we need it to, and printfs aren't working

All of them give the error (when they are uncommented)

I commented most of them out when I started running into the error, as commenting them out gave me less errors, and made me happier. I kept t one so I knew when I had fixed it (which hasn't happened, of course).
__________________
Team 2052- Knightkrawler
Mentor and volunteer
  #3   Spotlight this post!  
Unread 17-09-2008, 22:21
whitetiger0990's Avatar
whitetiger0990 whitetiger0990 is offline
Registered User
no team
Team Role: Programmer
 
Join Date: Mar 2006
Rookie Year: 2006
Location: Earth
Posts: 157
whitetiger0990 is a glorious beacon of lightwhitetiger0990 is a glorious beacon of lightwhitetiger0990 is a glorious beacon of lightwhitetiger0990 is a glorious beacon of lightwhitetiger0990 is a glorious beacon of light
Re: Robot not doing what we need it to, and printfs aren't working

Which line does it say that error is on?
__________________
print$q=chr(ord($q)+$1)while("7443-0201-8465130105-12-03135-82482113-06-7672-070208-0613-70"=~/(-?\d\d)/g);
  #4   Spotlight this post!  
Unread 17-09-2008, 23:47
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,572
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Robot not doing what we need it to, and printfs aren't working

In your tank function, you don't set any PWM values, therefore the PWMs will still be what they were before the function was called. When you first turn the robot on, it won't move. Once the PWMs get set in the mecanum function, they will continue with the same value once you start calling the tank function again.

In the mecanum function, the calculations can very easily overflow a char. You'll need to protect against that. I don't know if that is the only problem, but it will definitely cause you problems.
  #5   Spotlight this post!  
Unread 18-09-2008, 02:29
AustinSchuh AustinSchuh is offline
Registered User
FRC #0971 (Spartan Robotics) #254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Feb 2005
Rookie Year: 1999
Location: Los Altos, CA
Posts: 803
AustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond repute
Re: Robot not doing what we need it to, and printfs aren't working

Quote:
Originally Posted by whitetiger0990 View Post
Which line does it say that error is on?
And while you are at it, can you post the entire error message(s)?
  #6   Spotlight this post!  
Unread 18-09-2008, 08:24
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,817
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Robot not doing what we need it to, and printfs aren't working

Your print statements have mixed types where you attempt to print unsigned char (e.g., pwm01) and double (wFL) types as ints (%d). Typecast the arguments (int).

Statements such as:
pwm01 = (int)wFL + 127;
start with a double, typecast it to int, then assign it to unsigned char
as opposed to keeping your calculation as double then typecasting the result to unsigned char.
Are you doing that to speed things up? Just curious, not a problem.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 18-09-2008 at 08:37.
  #7   Spotlight this post!  
Unread 19-09-2008, 15:24
Bryan Herbst's Avatar
Bryan Herbst Bryan Herbst is offline
Registered User
AKA: Bryan
FRC #2052 (KnightKrawler)
Team Role: Mentor
 
Join Date: Sep 2007
Rookie Year: 2007
Location: Minneapolis, Minnesota
Posts: 545
Bryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond repute
Re: Robot not doing what we need it to, and printfs aren't working

Quote:
Originally Posted by whitetiger0990 View Post
Which line does it say that error is on?
The printf line (unsure specific number, but that line).



I don't have the entire error anymore, but it said the error was "type qualifier mismatch in assignment" on the printf line in teleop.c.

Quote:
In your tank function, you don't set any PWM values, therefore the PWMs will still be what they were before the function was called. When you first turn the robot on, it won't move. Once the PWMs get set in the mecanum function, they will continue with the same value once you start calling the tank function again.

In the mecanum function, the calculations can very easily overflow a char. You'll need to protect against that. I don't know if that is the only problem, but it will definitely cause you problems.
I'm really not terribly worried about the tank function, but thanks for pointing that out. We will try this if we can't get mechanum to work.

That being said, this is almost the exact same mechanum code we used at the competition. It should work, but it isn't.

How would we stop it from overflowing the chars?

Quote:
Your print statements have mixed types where you attempt to print unsigned char (e.g., pwm01) and double (wFL) types as ints (%d). Typecast the arguments (int).

Statements such as:
pwm01 = (int)wFL + 127;
start with a double, typecast it to int, then assign it to unsigned char
as opposed to keeping your calculation as double then typecasting the result to unsigned char.
Are you doing that to speed things up? Just curious, not a problem.
On our last bot, we had some issues with the robot spitting out relatively random PWM values (usually like -16573 or something). We fixed those (from what I remember) by adding the int typecasts. This may be the same issue, but I can't find out because the printfs aren't working.
__________________
Team 2052- Knightkrawler
Mentor and volunteer
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
Need some help with arm not working... neilcooper Programming 3 15-03-2008 06:16
If the computer and internet was not invented, what would you be doing right now? Bharat Nain Chit-Chat 55 03-06-2006 11:55
my comp is not working right and i need help Timmyd Chit-Chat 17 07-11-2005 23:39
Camera not working when connected to robot MarkVH Programming 5 14-02-2005 15:40
Robot Controller Not Working !?!?! Team1425 Electrical 3 24-01-2004 20:52


All times are GMT -5. The time now is 15:14.

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