View unanswered posts | View active topics It is currently Thu Apr 17, 2014 5:25 pm






Reply to topic  [ 5 posts ] 
Error compiling in 3.08 
Author Message
Rookie

Joined: Sun Sep 18, 2011 7:58 pm
Posts: 12
Location: Porto, Portugal
Post Error compiling in 3.08
I have a program that compiles perfectly in robotc 3.05 but in robotc 3.08 I get the following error whenever the atan2 function is called:
**Error**:Multiple exact overloads for 'atan2' match [including some 'const' parms]
*Warning*:Selected: Converted0:0/20 atan2(float x, float y)
*Warning*:Worse: Converted1:0/20 atan2(float x, float y)
One example of the code is this:
Code:
rBT_DirTgt_grd = (atan2(y_Offset, x_Offset))*200/PI;

The atan2 function is borrowed and is defined at the beginning:
Code:
//////////////////////////////////////////////////////////////////////////////////////////////////////
// 1 ArcusTangens mit Sonderfaellen; Angabe in radians!
//////////////////////////////////////////////////////////////////////////////////////////////////////
// x=Ankathete y=Gegenkathete Tangens=y/x - ArcTangent2 function to calculate distance run
float atan2(float x, float y)
{
  float phi;                                          //phi=radians;
  if (x>0) {phi=atan(y/x);}
  else
    if ((x<0)&&(y>=0))  {phi=PI+atan(y/x);}
  else
    if ((x<0)&&(y<0))   {phi=-PI+atan(y/x);}
  else
    if ((x==0)&&(y>0))  {phi=PI/2;}
  else
    if ((x==0)&&(y<0))  {phi=-PI/2;}
  else
    if ((x==0)&&(y==0)) {phi=0;}
  return phi;
}

Any help?
Thanks,


Sun Jun 17, 2012 1:52 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3105
Location: Rotterdam, The Netherlands
Post Re: Error compiling in 3.08
Hey there,

Would you mind attaching your program so we can check it out?

- Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Sun Jun 17, 2012 2:22 pm
Profile WWW
Rookie

Joined: Sun Sep 18, 2011 7:58 pm
Posts: 12
Location: Porto, Portugal
Post Re: Error compiling in 3.08
Yes, sure!
The file is attached.
Works, fine in 3.05 but not in 3.08.
It's work in progress and messy but I hope it's enough clear to show the problem.
Thank you.


Last edited by rbtx on Tue Jun 19, 2012 6:58 am, edited 1 time in total.



Mon Jun 18, 2012 3:56 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3105
Location: Rotterdam, The Netherlands
Post Re: Error compiling in 3.08
It's what I suspected :) The tan2 function in your file conflicts with the one in common.h of my driver suite.

- Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Tue Jun 19, 2012 6:54 am
Profile WWW
Rookie

Joined: Sun Sep 18, 2011 7:58 pm
Posts: 12
Location: Porto, Portugal
Post Re: Error compiling in 3.08
Ok, changed the function name and it run flawless.
Thank you.


Tue Jun 19, 2012 7:05 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.