[ODE] simulation loop problem

Jon Watte (ODE) hplus-ode at mindcontrol.org
Wed Sep 7 09:46:54 MST 2005


The force is cleared after each step. To apply a force for a specific 
time, keep applying it for each time step during that time.

Cheers,

			/ h+


Esra Suel wrote:
> 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
> 
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode
> 
> 


More information about the ODE mailing list