Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   RoboEmu2(code simulator)--now with C! (http://www.chiefdelphi.com/forums/showthread.php?t=31369)

rbayer 21-11-2004 14:25

RoboEmu2(code simulator)--now with C!
 
Well, its only been a year since I said I was going to do this, but hey, better late than never, right?

Anyways, it's finally here (in at least pre-beta form): RoboEmu2 -- now with C! I've tested it with the default code and everything seems to work fine, but given that I haven't been involved with a team for 2 years now, that's about the only code I've tested it with.

Thus, as always, I'm asking for everybody's help: please download RoboEmu2 and try it with your code. If it doesn't work, please email me your code and any warnings/errors you get.

In any event: enjoy, comment, criticize, etc:
www.robbayer.com/re2.shtml

Edit: for those of you who don't know, RoboEmu is an emulator for the control system. Back in the days of PBASIC it was used as a way to quickly test new code and algorithms without needing an actual robot to play with. This new version marks the transition from PBASIC to C, thus supporting the new controllers.

Tom Bottiglieri 21-11-2004 15:18

Re: RoboEmu2(code simulator)--now with C!
 
Ert, i get the error "Failed to start because QTMTNC321.DLL was not found"

I googled the dll and couldnt find it anywhere.

Joshua May 21-11-2004 15:20

Re: RoboEmu2(code simulator)--now with C!
 
Quote:

Originally Posted by Tom Bottiglieri
Ert, i get the error "Failed to start because QTMTNC321.DLL was not found"

I googled the dll and couldnt find it anywhere.

I got that same error as well.

Max Lobovsky 21-11-2004 15:25

Re: RoboEmu2(code simulator)--now with C!
 
Quote:

Originally Posted by Tom Bottiglieri
Ert, i get the error "Failed to start because QTMTNC321.DLL was not found"

I googled the dll and couldnt find it anywhere.

ditto, but I did find something on google: http://www.google.com/search?q=qtmtnc321.dll&sourceid=mozilla-search&start=0&start=0&ie=utf-8&oe=utf-8&client=firefox-a&rls=org.mozilla:en-US:official

Appears to be some library that is part of "Qt" which sounds like a tool that you might have used to compile this program.

nathanielreindl 21-11-2004 15:42

Re: RoboEmu2(code simulator)--now with C!
 
I compiled it from source on Fedora Core 3 against whatever version of kdelibs-devel (read: qt-devel) I happen to have, and it works just fine with the default code provided in the tarball.

When I get a moment or two, I'll make the necessary changes to our existing code and see what happens then.

rbayer 21-11-2004 16:36

Re: RoboEmu2(code simulator)--now with C!
 
My bad... new version now uploaded. Grab it from the website.

-Rob

Max Lobovsky 21-11-2004 17:25

Re: RoboEmu2(code simulator)--now with C!
 
MiniGW doesn't understand the "short long" type that C18 accepts (24 bit signed integer). I will use long's temporarily, but I wonder if you could add something to the batch file that will convert types because incorrect variable sizes can definitley screw up code.

Joel J 21-11-2004 17:29

Re: RoboEmu2(code simulator)--now with C!
 
Quote:

Originally Posted by rbayer
Well, its only been a year since I said I was going to do this, but hey, better late than never, right?

Anyways, it's finally here (in at least pre-beta form): RoboEmu2 -- now with C! I've tested it with the default code and everything seems to work fine, but given that I haven't been involved with a team for 2 years now, that's about the only code I've tested it with.

Thus, as always, I'm asking for everybody's help: please download RoboEmu2 and try it with your code. If it doesn't work, please email me your code and any warnings/errors you get.

In any event: enjoy, comment, criticize, etc:
www.robbayer.com/re2.shtml

Edit: for those of you who don't know, RoboEmu is an emulator for the control system. Back in the days of PBASIC it was used as a way to quickly test new code and algorithms without needing an actual robot to play with. This new version marks the transition from PBASIC to C, thus supporting the new controllers.

Wonderful!

Stephen Kowski 21-11-2004 18:51

Re: RoboEmu2(code simulator)--now with C!
 
cool stuff....

Venkatesh 01-12-2004 20:15

Re: RoboEmu2(code simulator)--now with C!
 
What kind of magic is behind this, namely how does it work?

Rickertsen2 01-12-2004 20:34

Re: RoboEmu2(code simulator)--now with C!
 
Quote:

Originally Posted by Venkatesh
What kind of magic is behind this, namely how does it work?

Yes exactly how in depth is the emulation? What are known things that will not work? Is it strictly a C VM or are you doing any emulation at the processor level? I suppose you would have to to run the .lib files.

Mike 05-12-2004 18:42

Re: RoboEmu2(code simulator)--now with C!
 
I get the errors
Code:


C:\mcc18\EduCode>C:\mingw\bin\mingw32-make.exe re2_win
gcc -o recore.dll -D_ROBOEMU -shared user_routines.c user_routines_fast.c re_hac
k.c re_core.c
In file included from user_routines.c:18:
printf_lib.h:15: warning: conflicting types for built-in function `printf'
user_routines.c: In function `User_Initialization':
user_routines.c:84: `TRISAbits' undeclared (first use in this function)
user_routines.c:84: (Each undeclared identifier is reported only once
user_routines.c:84: for each function it appears in.)
user_routines.c:96: `ADC_2ANA' undeclared (first use in this function)
user_routines.c:102: `TRISFbits' undeclared (first use in this function)
user_routines.c:111: `LATAbits' undeclared (first use in this function)
user_routines.c:112: `LATFbits' undeclared (first use in this function)
user_routines.c:113: `LATHbits' undeclared (first use in this function)
re_core.c: In function `update_outputs':
re_core.c:35: `pwm09' undeclared (first use in this function)
re_core.c:35: (Each undeclared identifier is reported only once
re_core.c:35: for each function it appears in.)
re_core.c:36: `pwm10' undeclared (first use in this function)
re_core.c:37: `pwm11' undeclared (first use in this function)
re_core.c:38: `pwm12' undeclared (first use in this function)
re_core.c:39: `pwm13' undeclared (first use in this function)
re_core.c:40: `pwm14' undeclared (first use in this function)
re_core.c:41: `pwm15' undeclared (first use in this function)
re_core.c:42: `pwm16' undeclared (first use in this function)
re_core.c:44: `relay1_fwd' undeclared (first use in this function)
re_core.c:45: `relay1_rev' undeclared (first use in this function)
re_core.c:46: `relay2_fwd' undeclared (first use in this function)
re_core.c:47: `relay2_rev' undeclared (first use in this function)
re_core.c:48: `relay3_fwd' undeclared (first use in this function)
re_core.c:49: `relay3_rev' undeclared (first use in this function)
re_core.c:50: `relay4_fwd' undeclared (first use in this function)
re_core.c:51: `relay4_rev' undeclared (first use in this function)
re_core.c:52: `relay5_fwd' undeclared (first use in this function)
re_core.c:53: `relay5_rev' undeclared (first use in this function)
re_core.c:54: `relay6_fwd' undeclared (first use in this function)
re_core.c:55: `relay6_rev' undeclared (first use in this function)
re_core.c:56: `relay7_fwd' undeclared (first use in this function)
re_core.c:57: `relay7_rev' undeclared (first use in this function)
re_core.c:58: `relay8_fwd' undeclared (first use in this function)
re_core.c:59: `relay8_rev' undeclared (first use in this function)
re_core.c: In function `update_inputs':
re_core.c:77: `p1_x' undeclared (first use in this function)
re_core.c:78: `p1_y' undeclared (first use in this function)
re_core.c:79: `p1_wheel' undeclared (first use in this function)
re_core.c:80: `p1_aux' undeclared (first use in this function)
re_core.c:81: `p1_sw_trig' undeclared (first use in this function)
re_core.c:82: `p1_sw_top' undeclared (first use in this function)
re_core.c:83: `p1_sw_aux1' undeclared (first use in this function)
re_core.c:84: `p1_sw_aux2' undeclared (first use in this function)
re_core.c:85: `p2_x' undeclared (first use in this function)
re_core.c:86: `p2_y' undeclared (first use in this function)
re_core.c:87: `p2_wheel' undeclared (first use in this function)
re_core.c:88: `p2_aux' undeclared (first use in this function)
re_core.c:89: `p2_sw_trig' undeclared (first use in this function)
re_core.c:90: `p2_sw_top' undeclared (first use in this function)
re_core.c:91: `p2_sw_aux1' undeclared (first use in this function)
re_core.c:92: `p2_sw_aux2' undeclared (first use in this function)
re_core.c:93: `p3_x' undeclared (first use in this function)
re_core.c:94: `p3_y' undeclared (first use in this function)
re_core.c:95: `p3_wheel' undeclared (first use in this function)
re_core.c:96: `p3_aux' undeclared (first use in this function)
re_core.c:97: `p3_sw_trig' undeclared (first use in this function)
re_core.c:98: `p3_sw_top' undeclared (first use in this function)
re_core.c:99: `p3_sw_aux1' undeclared (first use in this function)
re_core.c:100: `p3_sw_aux2' undeclared (first use in this function)
re_core.c:101: `p4_x' undeclared (first use in this function)
re_core.c:102: `p4_y' undeclared (first use in this function)
re_core.c:103: `p4_wheel' undeclared (first use in this function)
re_core.c:104: `p4_aux' undeclared (first use in this function)
re_core.c:105: `p4_sw_trig' undeclared (first use in this function)
re_core.c:106: `p4_sw_top' undeclared (first use in this function)
re_core.c:107: `p4_sw_aux1' undeclared (first use in this function)
re_core.c:108: `p4_sw_aux2' undeclared (first use in this function)
re_core.c:110: `PORTAbits' undeclared (first use in this function)
re_core.c:115: `PORTFbits' undeclared (first use in this function)
re_core.c:126: `rc_dig_in17' undeclared (first use in this function)
re_core.c:127: `rc_dig_in18' undeclared (first use in this function)
re_core.c:133: `competition_mode' undeclared (first use in this function)
C:\mingw\bin\mingw32-make.exe: *** [re2_win] Error 1

C:\mcc18\EduCode>pause
Press any key to continue . . .

Anybody else get this? =/

rbayer 05-12-2004 22:31

Re: RoboEmu2(code simulator)--now with C!
 
Quote:

Originally Posted by MikeWasHere05
I get the errors...

Are you getting this with the default code, or with code you're compiling yourself. If it's stuff you've made, make sure you #include "re_hack.h".

If that doesn't work, send me an email with your user_routines.c and I'll try to see what's wrong.

-Rob

rbayer 05-12-2004 22:36

Re: RoboEmu2(code simulator)--now with C!
 
Quote:

Originally Posted by Rickertsen2
Yes exactly how in depth is the emulation? What are known things that will not work? Is it strictly a C VM or are you doing any emulation at the processor level? I suppose you would have to to run the .lib files.

As of right now, timers and interrupts don't work and variables of type "short long" won't work. The timers and interrupts thing will be fixed at some point, but I'm really not sure about how to do 3-byte variables on x86.

As for how this thing works, it's actually quite simple. You compile your code into native Windows/Linux/etc as a dynamically loadable module (DLL's in Windows speak). This library file contains a few RE2-specific functions (from recore.c) that the main program uses to interface with your code. The driver program simply calls these functions once ever 26ms (for the slow-loop function) or whenever your computer has free cycles (for the fast-loop function). The majority of the work here is being done by gcc, so anything that's ANSI-C should compile. Whether or not it works as expected depends on whether you're using a PIC-specific feature (timers, interrupts, etc).

-Rob

doyler 15-12-2004 20:35

Re: RoboEmu2(code simulator)--now with C!
 
wow, that was awesome, thanks a lot

krhs_programmer 30-12-2004 18:46

Re: RoboEmu2(code simulator)--now with C!
 
I need a new copy of the MinGW compiler because the one i downloaded didn't work. So if you could, give me a link to get the compiler. Other than that the RoboEmu2 worked fine with the default and it should come in handy so i can work from home because the other person programming on the team won't let me in on anything, but when he makes a mistake he looks at me like "ok find my mistake because you know all the syntax because you learned C and i only know bits and pieces." Yeah, my teams a real bunch of great guys aren't they. you should ask me about last year how they screwed me over and you'll see what kind of people my teammates are.

Chris.Steimel 07-02-2005 19:59

Re: RoboEmu2(code simulator)--now with C!
 
I'm having trouble with the top buttons. The functions I have for them work fine when they are set to the triggers instead of the top buttons. Anybody else have this problem or just me? Maybe I just missed the latest update, I do that a lot. Thanks.

Greg Ross 07-02-2005 20:29

Re: RoboEmu2(code simulator)--now with C!
 
Quote:

Originally Posted by Chris.Steimel
I'm having trouble with the top buttons. The functions I have for them work fine when they are set to the triggers instead of the top buttons. Anybody else have this problem or just me? Maybe I just missed the latest update, I do that a lot. Thanks.

Does this question have to do with RoboEmu2, or the real robot? It sounds like you're talking about the real robot with real joysticks. And if you are talking about your real robot with the new joysticks we have received the last two years, you need to realize that the joystick button called pX_sw_top is the little round button located under your thumb when you wrap your right hand around the joystick handle, and NOT the 1/2 inch round button sticking up from the top of the handle.

I hope this helps. But if I misinterpreted, and you really are talking about RoboEmu2, I apologize for taking up bandwidth.

Chris.Steimel 09-02-2005 18:00

Re: RoboEmu2(code simulator)--now with C!
 
should've clarified, talking about the roboemu2 program. Just wanted to know if anybody else is having trouble with the top buttons. I'd appreciate knowing wether its me or the program. Distinct possibility its me.

Calvin 09-02-2005 19:31

Re: RoboEmu2(code simulator)--now with C!
 
Read: http://www.chiefdelphi.com/forums/sh...ad.php?t=34247

Myabe the same problem... :yikes:

MechaBouncer 12-02-2005 10:25

Re: RoboEmu2(code simulator)--now with C!
 
Hello all, I just wanted to add a little bit more clarification to what Chris was saying, since we still haven't figured this out. While using the RoboEmu 2 program, checking the box for the top buttons doesn't seem to work for us. Specifically, we are checking to see if both buttons are being pressed at the same time. Now if we bind the input to the triggers instead, the code works fine. However, it does nothing when we bind it to the top button on the joysticks. I've checked for typos in the reference to the top button several times and can't find anything. I've even tried binding directly to the inputs associated with the top buttons (from the ifi_aliases.h file) and it still did nothing. So I suspect it's a problem with RoboEmu 2 and not our code, but I'd like to make sure.

I would also like to mention that we will be using older 2-button joysticks on our control platform instead of the newer ones. Am I correct to assume that the second button on the top of the stick is the top button, or should we bind the input to another button?

Thanks in advance.

EDIT: And I had not noticed this before, but PWMs 3 and 4 don't show up for us, either, which is the same problem as that other topic.

Chris.Steimel 12-02-2005 10:38

Re: RoboEmu2(code simulator)--now with C!
 
We will be running the program on our actual bot real soon, I'll update when we do. Then we'll know if its us or the roboemu program.

FreakyAntelope 12-02-2005 18:08

Re: RoboEmu2(code simulator)--now with C!
 
You mentioned on your website that you were looking for someone with a mac to port in to OSX. I would be willing, but don't have the slightest idea how I would go about that :rolleyes:. So, if you want to explain it to me, I'd be happy to fool around with it and see what I can do, but if I'm going in over my head here then I'll leave this to someone who *actually* knows what they're doing.

- Toby

P.S. - I know very little C, but have a mac with v10.3.8

Chris.Steimel 17-02-2005 09:17

Re: RoboEmu2(code simulator)--now with C!
 
We ran the code on the actual bot. PWM's 3&4 work as do the top buttons. Everythings going fine for us except for a few faulty PWM communication lines.


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

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi