From 5cf674e1566babc7ae70f3cb3a295834b85b8a18 Mon Sep 17 00:00:00 2001 From: lmeier Date: Wed, 27 Mar 2019 13:29:33 -0500 Subject: [PATCH 1/3] improved error handling to alert user that sci connection issues can be caused by wrong baud rate or wrong robot base type. --- create_node/nodes/turtlebot_node.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/create_node/nodes/turtlebot_node.py b/create_node/nodes/turtlebot_node.py index 2eda055..33a6f1e 100755 --- a/create_node/nodes/turtlebot_node.py +++ b/create_node/nodes/turtlebot_node.py @@ -237,7 +237,7 @@ def cmd_vel(self, msg): def set_operation_mode(self,req): if not self.robot.sci: - rospy.logwarn("Create : robot not connected yet, sci not available") + rospy.logwarn("Create : robot not connected yet, sci not available. Check if cable is connected. Incorrect TURTLEBOT_BASE environment variable causing the wrong baudrate to be used is another possible cause.") return SetTurtlebotModeResponse(False) self.operate_mode = req.mode @@ -309,7 +309,7 @@ def _set_digital_outputs(self, outputs): def set_digital_outputs(self,req): if not self.robot.sci: - raise Exception("Robot not connected, SCI not available") + raise Exception("Robot not connected, SCI not available. Incorrect TURTLEBOT_BASE environment variable causing the wrong baudrate to be used is another possible cause.") outputs = [req.digital_out_0,req.digital_out_1, req.digital_out_2] self._set_digital_outputs(outputs) From 4df509a17e44ac589046d0a46d82abbbbf957201 Mon Sep 17 00:00:00 2001 From: robotics Date: Wed, 27 Mar 2019 22:32:44 -0500 Subject: [PATCH 2/3] update back_castor_joint to be expected rear_castor_joint to avoid joint not found errors. --- create_node/nodes/turtlebot_node.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/create_node/nodes/turtlebot_node.py b/create_node/nodes/turtlebot_node.py index 33a6f1e..c1c13e9 100755 --- a/create_node/nodes/turtlebot_node.py +++ b/create_node/nodes/turtlebot_node.py @@ -325,7 +325,7 @@ def spin(self): # state s = self.sensor_state odom = Odometry(header=rospy.Header(frame_id=self.odom_frame), child_frame_id=self.base_frame) - js = JointState(name = ["left_wheel_joint", "right_wheel_joint", "front_castor_joint", "back_castor_joint"], + js = JointState(name = ["left_wheel_joint", "right_wheel_joint", "front_castor_joint", "rear_castor_joint"], position=[0,0,0,0], velocity=[0,0,0,0], effort=[0,0,0,0]) r = rospy.Rate(self.update_rate) From 46d02ae9f0169c9b5e7918900befd69a0a52eed3 Mon Sep 17 00:00:00 2001 From: lmeier Date: Sun, 7 Apr 2019 13:49:02 -0500 Subject: [PATCH 3/3] updated sci cable messaging to ensure environment variable is set to TURTLEBOT_BASE=create for Create 1 base, TURTLEBOT_BASE=roomba for Create 2. --- create_node/nodes/turtlebot_node.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/create_node/nodes/turtlebot_node.py b/create_node/nodes/turtlebot_node.py index c1c13e9..dfc71c0 100755 --- a/create_node/nodes/turtlebot_node.py +++ b/create_node/nodes/turtlebot_node.py @@ -117,7 +117,7 @@ def start(self): self.robot.start(self.port, robot_types.ROBOT_TYPES[self.robot_type].baudrate) break except serial.serialutil.SerialException as ex: - msg = "Failed to open port %s. Error: %s Please make sure the Create cable is plugged into the computer. \n"%((self.port), ex.message) + msg = "Failed to open port %s. Error: %s Please make sure the Create cable is plugged into the computer. Ensure environment variable is set to TURTLEBOT_BASE=create for Create 1 base, TURTLEBOT_BASE=roomba for Create 2.\n"%((self.port), ex.message) self._diagnostics.node_status(msg,"error") if log_once: log_once = False @@ -237,7 +237,7 @@ def cmd_vel(self, msg): def set_operation_mode(self,req): if not self.robot.sci: - rospy.logwarn("Create : robot not connected yet, sci not available. Check if cable is connected. Incorrect TURTLEBOT_BASE environment variable causing the wrong baudrate to be used is another possible cause.") + rospy.logwarn("Create : robot not connected yet, sci not available. Check if cable is connected. Incorrect TURTLEBOT_BASE environment variable causing the wrong baudrate to be used is another possible cause. Ensure environment variable is set to TURTLEBOT_BASE=create for Create 1 base, TURTLEBOT_BASE=roomba for Create 2.") return SetTurtlebotModeResponse(False) self.operate_mode = req.mode