From d42f618b757002e3f7a4e2b824cb13560aeee780 Mon Sep 17 00:00:00 2001 From: Josja Geijsberts Date: Thu, 9 Aug 2018 11:27:38 +0200 Subject: [PATCH 1/3] Added Hero as robot object --- action_server/src/action_server/main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/action_server/src/action_server/main.py b/action_server/src/action_server/main.py index 92eed7af..2674f393 100755 --- a/action_server/src/action_server/main.py +++ b/action_server/src/action_server/main.py @@ -23,8 +23,10 @@ from robot_skills.amigo import Amigo as Robot elif robot_name == 'sergio': from robot_skills.sergio import Sergio as Robot + elif robot_name == 'hero': + from robot_skills.hero import Hero as Robot else: - rospy.logerr("'robot_name' must be either 'amigo' or 'sergio'") + rospy.logerr("'robot_name' must be 'amigo', 'sergio' or 'Hero'") sys.exit() robot = Robot() From 7e17c556d73d9f336f056e69a55149ea7a882bb4 Mon Sep 17 00:00:00 2001 From: Matthijs van der Burgh Date: Tue, 15 Jan 2019 20:10:58 +0100 Subject: [PATCH 2/3] add .lower() to robot name in init --- action_server/src/action_server/main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/action_server/src/action_server/main.py b/action_server/src/action_server/main.py index 2674f393..76436902 100755 --- a/action_server/src/action_server/main.py +++ b/action_server/src/action_server/main.py @@ -19,14 +19,14 @@ rospy.loginfo("Parameters:") rospy.loginfo("robot_name = {}".format(robot_name)) - if robot_name == 'amigo': + if robot_name.lower() == 'amigo': from robot_skills.amigo import Amigo as Robot - elif robot_name == 'sergio': + elif robot_name.lower() == 'sergio': from robot_skills.sergio import Sergio as Robot - elif robot_name == 'hero': + elif robot_name.lower() == 'hero': from robot_skills.hero import Hero as Robot else: - rospy.logerr("'robot_name' must be 'amigo', 'sergio' or 'Hero'") + rospy.logerr("'robot_name' must be 'amigo', 'sergio' or 'hero'") sys.exit() robot = Robot() From 2f89f786f924b09cc83aeb2bacfe36bec1ffd02f Mon Sep 17 00:00:00 2001 From: Matthijs van der Burgh Date: Tue, 15 Jan 2019 20:14:50 +0100 Subject: [PATCH 3/3] do .lower() once --- action_server/src/action_server/main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/action_server/src/action_server/main.py b/action_server/src/action_server/main.py index 76436902..7f2735ea 100755 --- a/action_server/src/action_server/main.py +++ b/action_server/src/action_server/main.py @@ -11,7 +11,7 @@ rospy.init_node('action_server') try: - robot_name = rospy.get_param('~robot_name') + robot_name = rospy.get_param('~robot_name').lower() except KeyError: rospy.logerr("Please provide a 'robot_name'") exit(0) @@ -19,11 +19,11 @@ rospy.loginfo("Parameters:") rospy.loginfo("robot_name = {}".format(robot_name)) - if robot_name.lower() == 'amigo': + if robot_name == 'amigo': from robot_skills.amigo import Amigo as Robot - elif robot_name.lower() == 'sergio': + elif robot_name == 'sergio': from robot_skills.sergio import Sergio as Robot - elif robot_name.lower() == 'hero': + elif robot_name == 'hero': from robot_skills.hero import Hero as Robot else: rospy.logerr("'robot_name' must be 'amigo', 'sergio' or 'hero'")