File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -1027,6 +1027,27 @@ def CheckJointLimits(robot, q):
1027
1027
description = 'position' )
1028
1028
1029
1029
1030
+ def GetForwardKinematics (robot , q ):
1031
+ """
1032
+ Get the forward kinematics for a specific joint configuration.
1033
+
1034
+ @param openravepy.robot robot: The robot object.
1035
+ @param list q: List or array of joint positions.
1036
+
1037
+ @returns T_ee: The pose of the end effector (or last link in the
1038
+ serial chain) as a 4x4 matrix.
1039
+ """
1040
+ T_ee = None
1041
+
1042
+ # Save the robot state
1043
+ sp = openravepy .Robot .SaveParameters
1044
+ with robot .CreateRobotStateSaver ():
1045
+ robot .SetActiveDOFValues (q )
1046
+ T_ee = robot .GetActiveManipulator ().GetTransform ()
1047
+ # Robot state is restored
1048
+ return T_ee
1049
+
1050
+
1030
1051
def ConvertIntToBinaryString (x , reverse = False ):
1031
1052
"""
1032
1053
Convert an integer to a binary string.
You can’t perform that action at this time.
0 commit comments