[ODE] Getting Torques in Simulation

Jaroslav Sinecky sinecky at telefonica.net
Fri Mar 31 00:00:48 MST 2006


dBodyGetTorque gives you only external (user-added) accumulated torque, it
doesn't return torque applied by joint. However dJointFeedback() should
work. Something like:

// at initalization
static dJointFeedback fb;
dJointSetFeedback(actuator[n-1], &fb);

// after simulation step
// get feedback from fb

Cheers,
Jaroslav


  -----Original Message-----
  From: ode-bounces at q12.org [mailto:ode-bounces at q12.org]On Behalf Of Nguyen
Binh
  Sent: Thursday, March 30, 2006 7:38 PM
  To: frederic Le Menn
  Cc: ode at q12.org
  Subject: Re: [ODE] Getting Torques in Simulation


  I think I had mentioned this issue before.
  We might need something like:
  dBodyGetTorqueFromPreviousStep()....

  You got 0 because you call the function outside the scope of the time
stepper.So the accumulated torque and forces got cleared to 0.
  Right now,dBodyGetTorque()/Force doesn;t make sense to user program.
  If you want to do that yourself, you can add a old_torque variable to body
and when you clear the accumulated torque, update it.
  I have that code somewhere, but can't find it now. But that change is easy
though.


  On 3/30/06, frederic Le Menn <flemenn at yahoo.fr> wrote:
    Hello,

    I work on locomotion with modular mobile robots. I saw that many people
have problems with getting torques of bodies in ODE. I tried using
dBodyGetTorque() but I had nothing but 0.
    I tried dJointFeedback() but the answer is 0 (no torque on body)
although my system moves (I impose angular velocities with a function :
    {
      double err, theta;
      theta = dJointGetHingeAngle(actuator[n-1]);
      err = angle - theta;
      dJointSetHingeParam(actuator[n-1], dParamVel, 2*err);
      dJointSetHingeParam(actuator[n-1], dParamFMax, 500);
    })
    I want to compute energy consumption therefore I need applied torques in
my system.
    So anybody can help me telling me or posting program samples that give
torques.

    Thank you for your attention


----------------------------------------------------------------------------
    Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les
tarifs exceptionnels pour appeler la France et l'international. Téléchargez
la version beta.


    _______________________________________________
    ODE mailing list
    ODE at q12.org
    http://q12.org/mailman/listinfo/ode






  --
  --------------------------------------------------
  Binh Nguyen
  Computer Science Department
  Rensselaer Polytechnic Institute
  Troy, NY, 12180
  --------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://q12.org/pipermail/ode/attachments/20060331/60a96e31/attachment.htm


More information about the ODE mailing list