Skip to content

Commit

Permalink
Fix: When calling with an invalid named pose a warning should be pres…
Browse files Browse the repository at this point in the history
…ented and the callback should return immediately
  • Loading branch information
Timothy-Morris authored and Your Name committed Sep 8, 2023
1 parent 988a7e6 commit 84834ff
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion armer/robots/ROSRobot.py
Original file line number Diff line number Diff line change
Expand Up @@ -944,6 +944,8 @@ def named_pose_cb(self, goal: MoveToNamedPoseGoal) -> None:
MoveToNamedPoseResult(success=False),
'Unknown named pose'
)
rospy.logwarn(f"-- Named pose goal ({goal.pose_name}) is unknown; refusing to move...")
return

qd = np.array(self.named_poses[goal.pose_name])

Expand Down Expand Up @@ -1288,7 +1290,7 @@ def get_named_pose_configs_cb(
:return: [description]
:rtype: GetNamedPoseConfigsResponse
"""
return self.custom_configs
return str(self.custom_configs)

def set_pid(self, msg):
"""
Expand Down Expand Up @@ -1501,6 +1503,7 @@ def __vel_move(self, twist_stamped: TwistStamped) -> None:
self.last_update = rospy.get_time()

def pose_within_workspace(self, pose=Pose):
# TODO: The workspace should be stored in param server!!!
path = rospy.get_param('/robot_workspace', '')
if path == '':
# No workspace defined - assume infinite workspace
Expand Down

0 comments on commit 84834ff

Please sign in to comment.