Cancel
Showing results for 
Search instead for 
Did you mean: 

How to get/set robot joint?

Creator
Creator

Hi everyone,

 

I tried to get and set a robots' joint values (6-axis Kuka) but didn't find a solution.

Probably an easy issue but I don't have any idea (and no experience).

 

So if anyone could help me please feel free to do :-)

 

Kind regards,

Jan

3 REPLIES 3

Re: How to get/set robot joint?

Genius
Genius

Hello,

 

you can get an actual pose of a robot over CurrentPose property of the robot.

Alternatively you can access the joints over Joints property of the robot and then use CurrentValue property to get current rotation/translation position of the joint.

Witalij.

Re: How to get/set robot joint?

Creator
Creator

Hello Witalij,

 

thanks for your answer. Could you please explain it a little more detailed?

Maybe with a short code-snippet?

 

Thanks a lot!

Jan

Re: How to get/set robot joint?

Genius
Genius

Here is it:

 Private Sub RobotTest()
        Dim robot As TxRobot = TxApplication.ActiveSelection.GetItems()(0)

        'Get joint values over CurrentPose
        Dim poseData As TxPoseData = robot.CurrentPose
        For Each value As Double In poseData.JointValues
            'Do whatever you want
        Next

        'Iterate over joints
        Dim joints As TxObjectList(Of TxJoint) = robot.Joints
        For Each joint As TxJoint In joints
            'Read joint value
            Dim value As Double = joint.CurrentValue

            'Set value
            Dim newValue As Double = 255.0R
            joint.CurrentValue = newValue
        Next
    End Sub