@@ -287,7 +287,7 @@ def _get_current_base_frame(self, full_configuration, group):
287287 base_frame_WCF = Frame .worldXY ()
288288 else :
289289 base_frame_WCF = self .model .forward_kinematics (joint_state , link_name = base_link .name )
290- base_frame_RCF = self .represent_frame_in_RCF (base_frame_WCF , group )
290+ base_frame_RCF = self .to_local_coords (base_frame_WCF , group )
291291
292292 base_frame_RCF .point *= self .scale_factor
293293 T = Transformation .from_frame (base_frame )
@@ -561,7 +561,7 @@ def transformation_RCF_WCF(self, group=None):
561561
562562 """
563563 base_frame = self .get_base_frame (group )
564- return Transformation .from_frame_to_frame ( Frame .worldXY (), base_frame )
564+ return Transformation .change_basis ( base_frame , Frame .worldXY ())
565565
566566 def _get_current_transformation_WCF_RCF (self , full_configuration , group ):
567567 """Returns the group's current WCF to RCF transformation, if the robot is in full_configuration.
@@ -602,7 +602,7 @@ def transformation_WCF_RCF(self, group=None):
602602
603603 """
604604 base_frame = self .get_base_frame (group )
605- return Transformation .from_frame_to_frame ( base_frame , Frame .worldXY ())
605+ return Transformation .change_basis ( Frame .worldXY (), base_frame )
606606
607607 def set_RCF (self , robot_coordinate_frame , group = None ):
608608 """Moves the origin frame of the robot to the robot_coordinate_frame.
@@ -615,7 +615,7 @@ def get_RCF(self, group=None):
615615 """
616616 return self .get_base_frame (group )
617617
618- def represent_frame_in_RCF (self , frame_WCF , group = None ):
618+ def to_local_coords (self , frame_WCF , group = None ):
619619 """Represents a frame from the world coordinate system (WCF) in the robot's coordinate system (RCF).
620620
621621 Parameters
@@ -631,12 +631,14 @@ def represent_frame_in_RCF(self, frame_WCF, group=None):
631631 Examples
632632 --------
633633 >>> frame_WCF = Frame([-0.363, 0.003, -0.147], [0.388, -0.351, -0.852], [0.276, 0.926, -0.256])
634- >>> frame_RCF = robot.represent_frame_in_RCF(frame_WCF)
634+ >>> frame_RCF = robot.to_local_coords(frame_WCF)
635+ >>> frame_RCF
636+ Frame(Point(-0.363, 0.003, -0.147), Vector(0.388, -0.351, -0.852), Vector(0.276, 0.926, -0.256))
635637 """
636638 frame_RCF = frame_WCF .transformed (self .transformation_WCF_RCF (group ))
637639 return frame_RCF
638640
639- def represent_frame_in_WCF (self , frame_RCF , group = None ):
641+ def to_world_coords (self , frame_RCF , group = None ):
640642 """Represents a frame from the robot's coordinate system (RCF) in the world coordinate system (WCF).
641643
642644 Parameters
@@ -652,7 +654,9 @@ def represent_frame_in_WCF(self, frame_RCF, group=None):
652654 Examples
653655 --------
654656 >>> frame_RCF = Frame([-0.363, 0.003, -0.147], [0.388, -0.351, -0.852], [0.276, 0.926, -0.256])
655- >>> frame_WCF = robot.represent_frame_in_WCF(frame_RCF)
657+ >>> frame_WCF = robot.to_world_coords(frame_RCF)
658+ >>> frame_WCF
659+ Frame(Point(-0.363, 0.003, -0.147), Vector(0.388, -0.351, -0.852), Vector(0.276, 0.926, -0.256))
656660 """
657661 frame_WCF = frame_RCF .transformed (self .transformation_RCF_WCF (group ))
658662 return frame_WCF
@@ -899,7 +903,7 @@ def inverse_kinematics(self, frame_WCF, start_configuration=None,
899903 start_configuration )
900904
901905 # represent in RCF
902- frame_RCF = self .represent_frame_in_RCF (frame_WCF , group )
906+ frame_RCF = self .to_local_coords (frame_WCF , group )
903907 frame_RCF .point /= self .scale_factor # must be in meters
904908
905909 joint_positions = self .client .inverse_kinematics (frame_RCF , base_link ,
@@ -943,7 +947,7 @@ def forward_kinematics(self, configuration, group=None, backend=None, link_name=
943947 >>> frame_RCF_m = robot.forward_kinematics(configuration, group, backend='model')
944948 >>> frame_RCF_c == frame_RCF_m
945949 True
946- >>> frame_WCF = robot.represent_frame_in_WCF (frame_RCF_m, group)
950+ >>> frame_WCF = robot.to_world_coords (frame_RCF_m, group)
947951 >>> frame_WCF
948952 Frame(Point(0.300, 0.100, 0.500), Vector(1.000, -0.000, -0.000), Vector(0.000, 1.000, -0.000))
949953
@@ -973,10 +977,10 @@ def forward_kinematics(self, configuration, group=None, backend=None, link_name=
973977 frame_RCF .point *= self .scale_factor
974978 else :
975979 frame_WCF = self .model .forward_kinematics (group_joint_state , link_name )
976- frame_RCF = self .represent_frame_in_RCF (frame_WCF , group )
980+ frame_RCF = self .to_local_coords (frame_WCF , group )
977981 elif backend == 'model' :
978982 frame_WCF = self .model .forward_kinematics (group_joint_state , link_name )
979- frame_RCF = self .represent_frame_in_RCF (frame_WCF , group )
983+ frame_RCF = self .to_local_coords (frame_WCF , group )
980984 else :
981985 # pass to backend, kdl, ikfast,...
982986 raise NotImplementedError
@@ -1068,7 +1072,7 @@ def plan_cartesian_motion(self, frames_WCF, start_configuration=None,
10681072 frames_RCF = []
10691073 for frame_WCF in frames_WCF :
10701074 # represent in RCF
1071- frame_RCF = self .represent_frame_in_RCF (frame_WCF , group )
1075+ frame_RCF = self .to_local_coords (frame_WCF , group )
10721076 frame_RCF .point /= self .scale_factor
10731077 frames_RCF .append (frame_RCF )
10741078 base_link = self .get_base_link_name (group )
0 commit comments