File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -1027,7 +1027,7 @@ def CheckJointLimits(robot, q):
1027
1027
description = 'position' )
1028
1028
1029
1029
1030
- def GetForwardKinematics (robot , q ):
1030
+ def GetForwardKinematics (robot , q , manipulator = None ):
1031
1031
"""
1032
1032
Get the forward kinematics for a specific joint configuration.
1033
1033
@@ -1037,14 +1037,20 @@ def GetForwardKinematics(robot, q):
1037
1037
@returns T_ee: The pose of the end effector (or last link in the
1038
1038
serial chain) as a 4x4 matrix.
1039
1039
"""
1040
+ if manipulator == None :
1041
+ manipulator = GetActiveManipulator ()
1042
+
1040
1043
T_ee = None
1041
1044
1042
1045
# Save the robot state
1043
1046
sp = openravepy .Robot .SaveParameters
1044
- with robot .CreateRobotStateSaver ():
1047
+ robot_saver = robot .CreateRobotStateSaver (sp .LinkTransformation )
1048
+
1049
+ with robot_saver :
1045
1050
robot .SetActiveDOFValues (q )
1046
- T_ee = robot .GetActiveManipulator (). GetTransform ()
1051
+ T_ee = robot .manipulator . GetEndEffectorTransform ()
1047
1052
# Robot state is restored
1053
+
1048
1054
return T_ee
1049
1055
1050
1056
You can’t perform that action at this time.
0 commit comments