External kinematic shift target

Typically: "How do I... ", "How can I... " questions
Post Reply
xanobis
Posts: 3
Joined: 10 Apr 2018, 09:59

External kinematic shift target

Post by xanobis »

Hello,

I am testing with the external kinematic and i'm a little confused about the funktion simEmbSetObjectTransformation for shift / rotate the target dummie.

For testing i'm only want to shift the target dummie along one axis.

Simple example

CyclicFunction{
REAL32 pos[3]={0.0,0.0,0.0};
REAL32 quat[4]={0.0,0.0,0.0,0.0};
simEmbGetObjectTransformation(m_targetHandle,m_baseHandle,&pos[0],&quat[0]);

pos[0] = pos[0] + JoystickValue;

simEmbSetObjectTransformation(m_targetHandle,m_baseHandle,pos,quat);

int result = simEmbHandleIkGroup(sim_handle_all);
...
}

When i running this cyclic funktion the target is shiftet along the x-Axis. Thats fine. But it is also rotating and i'm don't change any of the quaternion values.
Can anyone help me understand this behavior?

Thanks

coppelia
Site Admin
Posts: 10339
Joined: 14 Dec 2012, 00:25

Re: External kinematic shift target

Post by coppelia »

Hello,

how do you test if the object was rotated? Do you test that directly after the shift?
Make sure that the object you are shifting is not constrained in any way (i.e. via IK for instance), otherwise the rotation could come from an internal process.
Also, if you can provide a minimal test case, that would be great.
As a workaround, you can always use simEmbGetObjectMatrix / simEmbSetObjectMatrix

Cheers

Post Reply