[ODE] 'not yet implemented' Error

david@csworkbench.com david at csworkbench.com
Sat Mar 29 16:07:02 2003


I haven't learned Delphi yet, but you can do the same thing directly
through the API.  Here's what it would look like in C:

dReal getAMotorAngleRate (dJointID joint, int anum) {
  dReal rate = 0;
  dBodyID b0 = dJointGetBody(joint, 0);
  dBodyID b1 = dJointGetBody(joint, 1);
  dVector3 axis;
  dJointGetAMotorAxis (joint, anum, axis);
  if (b0 != 0) {
    const dReal *avel0 = dBodyGetAngularVel(b0);
    rate += axis[0]*avel0[0] + axis[1]*avel0[1] + axis[2]*avel0[2];
  }
  if (b1 != 0) {
    const dReal *avel1 = dBodyGetAngularVel(b1);
    rate -= axis[0]*avel1[0] + axis[1]*avel1[1] + axis[2]*avel1[2];
  }
  if (b0 == 0 && b1 != 0)
    rate = -rate;
  return rate;
}

If you wanted to translate that to Delphi, it uses no ODE internals and is
functionally equivalent to the last one I posted.

David

> Brilliant - and I'm pretty sure it would give decent results... - but I
> don't have a C compiler and use the DelphiODE headers. Somebody would
> have to make me the required DLLs etc etc...
>
> Not to worry... - I do my own "guess-at-the-solution" with a faithful
> old trick: I'm subtracting the prior joint angle from the current one to
> get a hint of the rate. Not "accurate" in a meter-per-second kinda
> thing... but for a Neural Net only the relative differences are
> important. :)
> (Hopefully...)
>
>
> ----- Original Message -----
> From: <david@csworkbench.com>
> To: <ode@q12.org>
> Sent: Saturday, March 29, 2003 11:58 PM
> Subject: Re: [ODE] 'not yet implemented' Error
>
>
>> Just a logical guess based on the Hinge joint, but I don't see why
>> this wouldn't work (this is completely untested):
>>
>> extern "C" dReal dJointGetAMotorAngleRate (dxJointAMotor *joint, int
>> anum) {
>>   dAASSERT(joint && anum >= 0 && anum < 3);
>>   dUASSERT(joint->vtable == &__damotor_vtable,"joint is not an
>> amotor"); if (joint->node[0].body) {
>>     dVector3 axis;
>>     dJointGetAMotorAxis (joint, anum, axis);
>>     dReal rate = dDOT(axis,joint->node[0].body->avel);
>>     if (joint->node[1].body) rate -=
>> dDOT(axis,joint->node[1].body->avel); return rate;
>>   }
>>   else return 0;
>> }
>>
>> Replace that in ode/src/joint.cpp and see if it returns logical
>> results.
>>
>> David
>>
>> > ARGH!!
>> >
>> > This looks like something that somebody just forgot to actually
>> finish. Or is there some reason (difficulty?) that it hasn't been
>> done for the motor joint?
>> >
>> > ----- Original Message -----
>> > From: "Ted Milker" <tmilker@thewretched.org>
>> > To: <ode@q12.org>
>> > Sent: Saturday, March 29, 2003 8:29 PM
>> > Subject: Re: [ODE] "not yet implemented" Error
>> >
>> >
>> >> On Sat, Mar 29, 2003 at 06:00:55PM +0200, Henri Hakl wrote:
>> >> > I've just mailed with Mattias - he assures me that the
>> >> Delphi-headers
>> > are a faithful conversion, so the problem is probably that the
>> functionality simply hasn't been implemented (even if the
>> documentation says it is available).
>> >> >
>> >> > Any final word form somebody that knows?
>> >>
>> >> Use the source, Luke. :P  From the ode-0.035 source base:
>> >>
>> >> extern "C" dReal dJointGetAMotorAngleRate (dxJointAMotor *joint,
>> int anum)
>> >> {
>> >>   // @@@
>> >>   dDebug (0,"not yet implemented");
>> >>   return 0;
>> >> }
>> >>
>> >> So yes, it hasn't been implemented yet.
>> >>
>> >> Ted
>> >> _______________________________________________
>> >> ODE mailing list
>> >> ODE@q12.org
>> >> http://q12.org/mailman/listinfo/ode
>> >
>> > _______________________________________________
>> > ODE mailing list
>> > ODE@q12.org
>> > http://q12.org/mailman/listinfo/ode
>>
>>
>>
>> _______________________________________________
>> ODE mailing list
>> ODE@q12.org
>> http://q12.org/mailman/listinfo/ode