Quantcast

rotations in OpenRAVE

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

rotations in OpenRAVE

Seth Koterba
How do I set the the orientation of a transform and ultimately a kinBody?
Digging through the rave/math.h file, it looks like the RaveTransform
variable "rot" is a four element variable representing a quaternion.  So I
tried this...

Transform t;
t.trans.x = 0;
t.trans.y = 0;
t.trans.z = 0;
t.rot.x = 0.9961946980917455;
t.rot.y = 0.08715574274765817;
t.rot.z = 0.0;
t.rot.w = 0.0;
body->SetTransform(t);

This appears to actually translate the model relative to a reference body
rather than rotate it by 10 degrees.  What I am doing wrong?

Thanks,
  Seth



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: rotations in OpenRAVE

Rosen Diankov-2
Hi Seth,

You are doing nothing wrong. Perhaps the origin of the body you are
trying to rotate is not where you are expecting it to, what if you set
the angle to pi/2?

Some hints that could make your life simpler

use Transform::rotfromaxisangle to set an angle without worrying about
quaternion representation

You can also set 3x3 rotation matrices via TransformMatrix and pass
that directly to KinBody::SetTransform (conversions between Transform
and TransformMatrix are done implicitly)

rosen,

2008/7/29 Seth Koterba <[hidden email]>:

> How do I set the the orientation of a transform and ultimately a kinBody?
> Digging through the rave/math.h file, it looks like the RaveTransform
> variable "rot" is a four element variable representing a quaternion.  So I
> tried this...
>
> Transform t;
> t.trans.x = 0;
> t.trans.y = 0;
> t.trans.z = 0;
> t.rot.x = 0.9961946980917455;
> t.rot.y = 0.08715574274765817;
> t.rot.z = 0.0;
> t.rot.w = 0.0;
> body->SetTransform(t);
>
> This appears to actually translate the model relative to a reference body
> rather than rotate it by 10 degrees.  What I am doing wrong?
>
> Thanks,
>  Seth
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Openrave-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/openrave-users
>


Loading...