[ODE] simulation loop problem

Esra Suel esrasuel at su.sabanciuniv.edu
Wed Sep 7 10:09:14 MST 2005


I am trying to make a simple body walk. What I want to do is to apply a force 
for a certaion amount of time at a certain point. then, after that time, apply 
another force and it should go like that. But I cannot find how to apply 
certain forces and torques for certain amount of time. 

as a simple example, 
I tried this code in my simulation loop I was hoping my body to start rotating 
and then stop. but i did not see any rotation. 

Code: 

  dBodyAddRelTorque(body[0],0,10,0); 
  SpaceCollide (space,0,&nearCallback); 
  dWorldStep (world,0.0002); 
  dBodyAddRelTorque(body[0],0,-10,0); 
  dSpaceCollide (space,0,&nearCallback); 
  dWorldStep (world,0.0002); 
            



I though that maybe the time step is to small for me to observe the rotation, 
so I tried the code below. But there was no difference. 

Code: 
 dBodyAddRelTorque(body[0],0,10,0); 
 SpaceCollide (space,0,&nearCallback); 
 if (a < 20000000) 
 { 
   dWorldStep (world,0.0002); 
   a++; 
 } 
 
 dBodyAddRelTorque(body[0],0,-10,0); 
 if (b < 20000) 
 { 
   dWorldStep (world,0.0002); 
   b++; 
 } 
       
So know I do not know what to do, I would be glad if you could help me out. 

Thanks



More information about the ODE mailing list