[ODE] some kind of remote control...
Michael Scharvogel
thubba at gmx.net
Wed Dec 4 06:26:01 2002
This is a multi-part message in MIME format.
------=_NextPart_000_0045_01C29BA0.F88A96E0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi folks...
I need help on a programming issue (using MSVC but shoudn't be a MSVC =
issue):
I wrote a environment including a "robot" in an Class called =
SimulationEnvironment. This initializes the ODE Environment, registers =
the dsFunctions defined methods, etc.
By now I'm controlling my robot by keys and thus the a corresponding =
call of a SimulationEnvironment method.=20
So far so good...
But now I want to use an external control mechanism.
In my main Program I start the Environment by creating a =
SimulationEnvironment Object.
SimulationEnvironment sim(argc, argv)
My first intention now was to call the command method of my =
SimulationEnvironment and thus simulating a keypress.
Unfortunately this failed. I figured out no main method code after =
creating my SimulationEnvironment Object is executed. At least I donot =
have any output.
int main (int argc, char* argv[]) {
SimulationEnvironment sim(argc,argv);
int i =3D 1;
char* c;
// wait until all is set up
wait(5);
while(true) {
cout << " \nHallo\n";
sim.command((int)'1');
wait(2);
sim.command((int)'4');
wait(2);
}
}
wait just is an support function which waits the in seconds.
Running the Application starts the Simulation. But my Console Window of =
the initial application is replaced by a Drawstuff message window (and =
of course the display with all my robot opens, too). As no effect can be =
seen on the robot (and no dubg information on commad method call is =
written) I assume that the whole code after the SimulationEnvironment =
Constructor call is ignored.
Thus here is my question:
Can anyone tell me why my simple control mechanism won't work?
Maybe someone can even give me a hint how a kind of Controller =
Application should be implemented (designed).
Thank you for your time...
cya&bfn, mike=20
------=_NextPart_000_0045_01C29BA0.F88A96E0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2600.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi folks...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I need help on a programming issue =
(using MSVC but=20
shoudn't be a MSVC issue):</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I wrote a environment including a =
"robot" in an=20
Class called SimulationEnvironment. This initializes the ODE =
Environment,=20
registers the dsFunctions defined methods, etc.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>By now I'm controlling my robot by =
keys and=20
thus the a corresponding call of a SimulationEnvironment method. =
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>So far so good...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>But now I want to use an external =
control=20
mechanism.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>In my main Program I start the =
Environment by=20
creating a SimulationEnvironment Object.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>SimulationEnvironment sim(argc, =
argv)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>My first intention now was to call the =
command=20
method of my SimulationEnvironment and thus simulating a =
keypress.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Unfortunately this failed. I figured =
out no main=20
method code after creating my SimulationEnvironment Object is executed. =
At least=20
I donot have any output.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>int main (int argc, char* argv[]) =
{</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =
SimulationEnvironment=20
sim(argc,argv);</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> int i =3D =
1;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> char* =
c;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> // wait until =
all is set=20
up</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =
wait(5);</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial =
size=3D2> while(true)=20
{<BR> cout << "=20
\nHallo\n";<BR> =20
sim.command((int)'1');<BR>  =
;=20
wait(2);<BR> sim.com=
mand((int)'4');<BR> =
wait(2);<BR> =20
}<BR> }<BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>wait just is an support function which =
waits the in=20
seconds.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Running the Application starts the =
Simulation. But=20
my Console Window of the initial application is replaced by a Drawstuff =
message=20
window (and of course the display with all my robot opens, too). As no =
effect=20
can be seen on the robot (and no dubg information on commad method call =
is=20
written) I assume that the whole code after the SimulationEnvironment=20
Constructor call is ignored.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Thus here is my question:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Can anyone tell me why my simple =
control mechanism=20
won't work?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Maybe someone can even give me a hint =
how a kind of=20
Controller Application should be implemented (designed).</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Thank you for your time...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>cya&bfn, =
mike </DIV></FONT></BODY></HTML>
------=_NextPart_000_0045_01C29BA0.F88A96E0--