Jump to content

orgPos and orgRot are easy to find, but I am not sure how to get servoTransformPosition or servoTransformRotation


Recommended Posts

So I can get orgPos and orgRot information from a part code wise like:

orgPosX =  this.part.orgPos.x;

I am finding it a lot harder to find how to get  servoTransformPosition or servoTransformRotation for robotic parts

Any ideas?

Link to comment
Share on other sites

orgPos and orgRot are members of Part, while servoTransformPosition and servoTransformRotation are members of BaseServo. You can find the right module of a part like this:

BaseServo m = part.FindModuleImplementing<BaseServo>();
if  (m) {
    servoTransformPositionX = m.servoTransformPosition.x;
}

Hope this helps!

Link to comment
Share on other sites

            Expansions.Serenity.BaseServo m = part.FindModuleImplementing<Expansions.Serenity.BaseServo>();
            if (m)
            {
                servoTransformPositionX = m.servoTransformPosition.x;
                servoTransformPositionY = m.servoTransformPosition.y;
                servoTransformPositionZ = m.servoTransformPosition.z;
                servoTransformRotationX = m.servoTransformRotation.x;
                servoTransformRotationY = m.servoTransformRotation.y;
                servoTransformRotationZ = m.servoTransformRotation.z;
                servoTransformRotationW = m.servoTransformRotation.w;

            }
 

That works. Thanks a lot for you help

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...