Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   SIMULATOR....not _SIMULATOR (http://www.chiefdelphi.com/forums/showthread.php?t=49957)

teh_pwnerer795 13-11-2006 16:46

SIMULATOR....not _SIMULATOR
 
Hey guys.. ok.. YES ... i have an old robot... and old parts BUT.. im not going to build it alll over again .. to simulate the one at the school.... takes too long.. and its pointless... i was wondering if any one has a standalone program! that runns the .hex file and simulates the robot.. or joysticks... either or.. if u could let me noe:) that be great:D

chris31 13-11-2006 20:14

Re: SIMULATOR....not _SIMULATOR
 
RoboEmu2 works. Its been awhile tried it so i dont recall how much it can do.

http://www.robbayer.com/software.htm

JamesBrown 14-11-2006 02:42

Re: SIMULATOR....not _SIMULATOR
 
Quote:

Originally Posted by chris31
RoboEmu2 works. Its been awhile tried it so i dont recall how much it can do.

http://www.robbayer.com/software.htm

I have never had much luck with that program, I recommend writing separate functions for every thing you need to do (keep it modular) then testing the functions with different variables. All a simulator will do is show you your variables, nothing you cant do with the controller you have and some printf's Simulators sound more useful than they are, no simulator will let you fine tune your code because the simulator would have to be written just for your robot. I would recommend writing functions, testing them on vex or the edu controller(or an old bot) that will keep you busy until you are far enough into build to get some sort of bot to program

teh_pwnerer795 14-11-2006 20:42

Re: SIMULATOR....not _SIMULATOR
 
Quote:

Originally Posted by chris31
RoboEmu2 works. Its been awhile tried it so i dont recall how much it can do.

http://www.robbayer.com/software.htm


YOU ARE GOD!! .. THX U SOO MUCH... i have been looking for this for ages.... finally my code is gonna work!!:):):D:D THNXS MAN

charrisTTI 16-11-2006 09:12

Re: SIMULATOR....not _SIMULATOR
 
Take a look at the simulator in the MPLAB IDE. Compile with _SIMULATOR. You can step through code, view the assembly language generated by the compile, change the state of inputs and variables and then step through the execution line by line. It has limitations, but is great for checking whether you logic is correct.

marccenter 16-11-2006 10:48

Re: SIMULATOR....not _SIMULATOR
 
Perhaps your question has already been answered, but there is another
way to build "a simulator " using simple switches and servo motors
that I used in 2004 to test my logic.

A standard servo motor can be plugged in to the output port
of the robot controller. This motor becomes synonomous with
any robot motor you have in operating on your robot.

Next, make yourself or get hold off one of those autonomous
cables to help debug autonomous mode.

I then plugged in some Joysticks to the system, downloaded
by code and watched the motors, ie servo motors, respond to
joystick commands.

Add yourself some switches by plugging directly into the robot
controller and you have yourself a "robot simulator" good
for simple software checkout testing.

This is very similiar to the approach we use at work, Oops,
that's why FIRST is so much fun, havings students learn
what they will see in their future workplace.

brianafischer 20-01-2007 17:04

Re: SIMULATOR....not _SIMULATOR
 
Quote:

Originally Posted by marccenter (Post 535731)
Perhaps your question has already been answered, but there is another
way to build "a simulator " using simple switches and servo motors
that I used in 2004 to test my logic.

A standard servo motor can be plugged in to the output port
of the robot controller. This motor becomes synonomous with
any robot motor you have in operating on your robot.

Next, make yourself or get hold off one of those autonomous
cables to help debug autonomous mode.

I then plugged in some Joysticks to the system, downloaded
by code and watched the motors, ie servo motors, respond to
joystick commands.

Add yourself some switches by plugging directly into the robot
controller and you have yourself a "robot simulator" good
for simple software checkout testing.

This is very similiar to the approach we use at work, Oops,
that's why FIRST is so much fun, havings students learn
what they will see in their future workplace.

I think the idea here is to debug small functions without chasing down a battery, cables, and RC. A "step-by-step" debugger is also extremely useful in educating new programmers...

Are there any documents on the MPLAB simulator capabilites?

Mark McLeod 20-01-2007 22:29

Re: SIMULATOR....not _SIMULATOR
 
Quote:

Originally Posted by brianafischer (Post 561297)
Are there any documents on the MPLAB simulator capabilites?

Chapter 13 in the MPLAB IDE User Guide

The Microchip online seminar (or should we say sim-inar): http://techtrain.microchip.com/webse...aspx?Active=61
and web Getting Started: http://www.microchip.com/stellent/id...ram=en 022520

emersont49 20-10-2007 01:47

Re: SIMULATOR....not _SIMULATOR
 
I read the IFI documentation on the Simulator.

When I add _SIMULATOR in th C18 build options it is not there when I look again.

What am I doing wrong, I am using MPLAB 7.2 and ver 2.4 of the compiler

Any Ideas?

charrisTTI 20-10-2007 22:59

Re: SIMULATOR....not _SIMULATOR
 
What do you mean by look again?

Do you mean? Open and close the build options dialog OR open and close the entire workspace.

If you do not save the workspace after adding the macro definition then it will not be there when you reopen the workspace.

emersont49 22-10-2007 13:43

Re: SIMULATOR....not _SIMULATOR
 
I was opening and closing the build options. I will try saving the workspace to see if that works.

Thanks for that bit of insight.

emersont49 22-10-2007 13:52

Re: SIMULATOR....not _SIMULATOR
 
I tried the following:
Open build options
Select MPLAB C18
Add _SIMULATOR to macro definitions (a small window opens, I define _SIMULATOR and click OK)
_SIMULATOR shows in the macro defs box
I can click apply or OK. I've done both.

I save the workspace. Close it and then open it and the _SIMULATOR definition is no longer there.

Mark McLeod 22-10-2007 16:28

Re: SIMULATOR....not _SIMULATOR
 
Do you have "Use Alternate Settings" checked on that same pop-up?
That would prevent the _SIMULATOR macro from being saved.

If you are using Alternate Settings then you can add the macro directly in the alternate settings text box to the end of your set of options by typing:
-D_SIMULATOR


All times are GMT -5. The time now is 01:26.

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