View unanswered posts | View active topics It is currently Mon Oct 20, 2014 8:06 pm






Reply to topic  [ 24 posts ]  Go to page 1, 2  Next
Mantis Bug ID 234 
Author Message
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3225
Location: Rotterdam, The Netherlands
Post Mantis Bug ID 234
Ford,

I had a look at your program on http://www.robotc.net/mantis/view.php?id=234 but it won't compile out of the box. You are using a reserved word as a variable name (rand) in one of your functions. There's a bug that is preventing me from compiling it once that is fixed. It has to do allocating space for local variables. I ran into a similar problem last week. It's been fixed in an internal build, according to Dick.

Regards,
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 Jul 05, 2009 2:16 pm
Profile WWW
Guru
User avatar

Joined: Sat Mar 01, 2008 12:52 pm
Posts: 1030
Post Re: ROBOTC Suggustions
at this former version of robotc "rand" hasn't been a reserved word.
Just change this variable name into another (rd or sth like this) and the code should work

_________________
regards,
HaWe aka Ford
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;task main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PutPixel(x,y);}}}while(1)}


Sun Jul 05, 2009 2:21 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3225
Location: Rotterdam, The Netherlands
Post Re: ROBOTC Suggustions
Ford Prefect wrote:
at this former version of ROBOTC "rand" hasn't been a reserved word.
Just change this variable name into another (rd or sth like this) and the code should work

I did :) But then I bumped into the tmp variable problem. I've been hacking away at your code to try and cut down on the temporary variables but I am not having much luck atm. I managed to get it down from 3 to 2 errors, hehe.

Regards,
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 Jul 05, 2009 2:36 pm
Profile WWW
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3225
Location: Rotterdam, The Netherlands
Post Re: ROBOTC Suggustions
Ford,

I have it working now, but holy crap man, what the hell am I supposed to do with all this data on the screen? Could you give me some instructions?

I pressed a bunch of buttons and it seems to be beeping every couple of seconds. There are some impressive numbers and figures on the screen but I have freakin idea what they mean. How is anyone supposed to debug this? :) Not all of us are pharmacist neural network robot scientists.

Regards,
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 Jul 05, 2009 2:42 pm
Profile WWW
Guru
User avatar

Joined: Sat Mar 01, 2008 12:52 pm
Posts: 1030
Post Re: ROBOTC Suggustions
sry, I thought the program was intuitive and self-explaining.

maybe you like to have a look at this: viewtopic.php?f=15&t=557

(pull down to "backpropagation net" viewtopic.php?p=2331#p2331 ,
but maybe you read the intro to understand what it is about)

_________________
regards,
HaWe aka Ford
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;task main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PutPixel(x,y);}}}while(1)}


Sun Jul 05, 2009 2:54 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3225
Location: Rotterdam, The Netherlands
Post Re: ROBOTC Suggustions
Ford,

I think I figured it out. It's self explanatory if you wrote it, sure. All the numbers are a little offputting. Anyway, it's at cycle 900 of 1000 (counting down) and still no errors. I have no idea if what I did was right but it seems to be. It is now happily chirping every couple of seconds.

Regards,
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 Jul 05, 2009 2:59 pm
Profile WWW
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3225
Location: Rotterdam, The Netherlands
Post Re: ROBOTC Suggustions
Ford,

Your bug http://www.robotc.net/mantis/view.php?id=260 has been fixed in 1.56, there are now 20 tasks, that's double the old value.

Regards,
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 Jul 05, 2009 3:06 pm
Profile WWW
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3225
Location: Rotterdam, The Netherlands
Post Re: ROBOTC Suggustions
Ford,

Regarding http://www.robotc.net/mantis/view.php?id=264, use HTCS-test2.c from the 3rd Party Driver Suite to calibrate your sensor.

Regards,
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 Jul 05, 2009 3:08 pm
Profile WWW
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3225
Location: Rotterdam, The Netherlands
Post Re: ROBOTC Suggustions
Ford,

I now have it compiling without any errors. I have managed to remove a lot of the tmp variables you were using by replacing quite a few constants with defines and other little tricks. It's running again. The last one ran for more than 250 cycles before I stopped it. No errors had occurred. What's it supposed to do?

I programmed it with the pattern you suggested in your bug post.

Regards,
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 Jul 05, 2009 3:29 pm
Profile WWW
Guru
User avatar

Joined: Sat Mar 01, 2008 12:52 pm
Posts: 1030
Post Re: ROBOTC Suggustions
the program has to self-terminate in the moment the trained pattern has been learnt.

in many cases the program aborts (after a few hundred up to 1 thousand cycles)
- in the former RC version by a "nan error"
- in newer versions by calculation exceptions.

Just let it run, wait and see until the automatic training mode has finished... :D

_________________
regards,
HaWe aka Ford
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;task main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PutPixel(x,y);}}}while(1)}


Sun Jul 05, 2009 3:38 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3225
Location: Rotterdam, The Netherlands
Post Re: ROBOTC Suggustions
It counts down from 999, what if it hasn't learned by the time it reaches 0?

Regards,
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 Jul 05, 2009 3:40 pm
Profile WWW
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3225
Location: Rotterdam, The Netherlands
Post Re: Mantis Bug ID 234
I've split these posts off from the original thread. Please continue to use this one instead, please.

_________________
| 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 Jul 05, 2009 3:44 pm
Profile WWW
Guru
User avatar

Joined: Sat Mar 01, 2008 12:52 pm
Posts: 1030
Post Re: ROBOTC Suggustions
mightor wrote:
It counts down from 999, what if it hasn't learned by the time it reaches 0?Regards,
Xander


you better have to start training anew.

the maximum counts have been set to 999 to cut off dead end loops (though you may increase that number).

neural backprogation nets often are caught in local minimums and are not able to reach the global minimum.
so it's better to random initialize anew instead of riscing dead end loops.

_________________
regards,
HaWe aka Ford
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;task main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PutPixel(x,y);}}}while(1)}


Last edited by Ford Prefect on Sun Jul 05, 2009 4:45 pm, edited 1 time in total.



Sun Jul 05, 2009 4:42 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3225
Location: Rotterdam, The Netherlands
Post Re: Mantis Bug ID 234
It got to about 440 but then the NXT shutdown. I've added a call to alive() each time it does a run, so this won't happen again. I had it set to an hour but that wasn't enough, apparently. Anyway, it hadn't crashed within that hour.

Regards,
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 Jul 05, 2009 4:45 pm
Profile WWW
Guru
User avatar

Joined: Sat Mar 01, 2008 12:52 pm
Posts: 1030
Post Re: Mantis Bug ID 234
the same error happend to me oftenly.

Either unexpected shutdown or exception violation.

(the unexpected shutdown has been reported by me in a different bug tracker report)

EDIT: because of false multiplication by structure float arrays the calculations are faulty, so that's the reason why the error minimazition function doesn't convergent correctly, and often leads to nan's.

_________________
regards,
HaWe aka Ford
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;task main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PutPixel(x,y);}}}while(1)}


Last edited by Ford Prefect on Sun Jul 05, 2009 4:49 pm, edited 1 time in total.



Sun Jul 05, 2009 4:46 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 24 posts ]  Go to page 1, 2  Next

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.