@@ -95,35 +95,33 @@ def __init__(self, context):
9595 # Motor hierarchy
9696 self ._motor_hierarchy = { # TODO this should be a parameter / loaded from the urdf
9797 "Body" : {
98- "Head" : ["HeadPan " , "HeadTilt " ],
98+ "Head" : ["head_yaw_joint " , "head_pitch_joint " ],
9999 "Arms" : {
100100 "Left" : [
101- "LShoulderPitch " ,
102- "LShoulderRoll " ,
103- "LElbow " ,
101+ "l_shoulder_pitch_joint " ,
102+ "l_shoulder_roll_joint " ,
103+ "l_elbow_joint " ,
104104 ],
105105 "Right" : [
106- "RShoulderPitch " ,
107- "RShoulderRoll " ,
108- "RElbow " ,
106+ "r_shoulder_pitch_joint " ,
107+ "r_shoulder_roll_joint " ,
108+ "r_elbow_joint " ,
109109 ],
110110 },
111111 "Legs" : {
112112 "Left" : [
113- "LHipYaw" ,
114- "LHipRoll" ,
115- "LHipPitch" ,
116- "LKnee" ,
117- "LAnklePitch" ,
118- "LAnkleRoll" ,
113+ "l_hip_roll_joint" ,
114+ "l_hip_pitch_joint" ,
115+ "l_calf_joint" ,
116+ "l_ankle_pitch_joint" ,
117+ "l_ankle_roll_joint" ,
119118 ],
120119 "Right" : [
121- "RHipYaw" ,
122- "RHipRoll" ,
123- "RHipPitch" ,
124- "RKnee" ,
125- "RAnklePitch" ,
126- "RAnkleRoll" ,
120+ "r_hip_roll_joint" ,
121+ "r_hip_pitch_joint" ,
122+ "r_calf_joint" ,
123+ "r_ankle_pitch_joint" ,
124+ "r_ankle_roll_joint" ,
127125 ],
128126 },
129127 }
@@ -301,8 +299,8 @@ def connect_gui_callbacks(self) -> None:
301299 self ._widget .actionAnimation_until_Frame .triggered .connect (self .play_until )
302300 self ._widget .actionDuplicate_Frame .triggered .connect (self .duplicate )
303301 self ._widget .actionDelete_Frame .triggered .connect (self .delete )
304- self ._widget .actionLeft .triggered .connect (lambda : self .mirror_frame ("R " ))
305- self ._widget .actionRight .triggered .connect (lambda : self .mirror_frame ("L " ))
302+ self ._widget .actionLeft .triggered .connect (lambda : self .mirror_frame ("r " ))
303+ self ._widget .actionRight .triggered .connect (lambda : self .mirror_frame ("l " ))
306304 self ._widget .actionInvert .triggered .connect (self .invert_frame )
307305 self ._widget .actionUndo .triggered .connect (self .undo )
308306 self ._widget .actionRedo .triggered .connect (self .redo )
@@ -588,12 +586,12 @@ def redo(self):
588586 self ._widget .statusBar .showMessage (status )
589587 self .update_frames ()
590588
591- def mirror_frame (self , source : Literal ["L " , "R " ]) -> None :
589+ def mirror_frame (self , source : Literal ["l " , "r " ]) -> None :
592590 """
593591 Copies all motor values from one side of the robot to the other. Inverts values, if necessary
594592 """
595593 # Get direction to mirror to
596- mirrored_source = {"R " : "L " , "L " : "R " }[source ]
594+ mirrored_source = {"r " : "l " , "l " : "r " }[source ]
597595
598596 # Go through all active motors
599597 for motor_name , angle in self ._working_angles .items ():
@@ -626,10 +624,10 @@ def invert_frame(self):
626624 # Go through all active motors
627625 for motor_name , angle in self ._working_angles .items ():
628626 # Check if the motor is on the right or left side and get the mirrored motor name
629- if motor_name .startswith ("R " ):
630- mirrored_motor_name = "L " + motor_name [1 :]
631- elif motor_name .startswith ("L " ):
632- mirrored_motor_name = "R " + motor_name [1 :]
627+ if motor_name .startswith ("r " ):
628+ mirrored_motor_name = "l " + motor_name [1 :]
629+ elif motor_name .startswith ("l " ):
630+ mirrored_motor_name = "r " + motor_name [1 :]
633631 else :
634632 # Just copy over if the motor is not on the left or right side
635633 mirrored_motors [motor_name ] = angle
0 commit comments