diff --git a/scripts/control_marker.py b/scripts/control_marker.py index 77a03a3..6257b5d 100644 --- a/scripts/control_marker.py +++ b/scripts/control_marker.py @@ -173,6 +173,9 @@ def listener(): menu_handler.insert('First Entry', callback=processFeedback) menu_handler.insert('Second Entry', callback=processFeedback) + if not coords: + coords = [0,0,0,0,0,0] + rospy.loginfo('error [101]: can not get coord values') # initial position position = Point(coords[1] / -1000, coords[0] / 1000, coords[2] / 1000) # orientation = Quaternion(coords[4] / 100, coords[3] / 100, coords[5] / 100, 1) diff --git a/scripts/pythonAPI/mycobot.py b/scripts/pythonAPI/mycobot.py index 367ed71..9ee7a7a 100644 --- a/scripts/pythonAPI/mycobot.py +++ b/scripts/pythonAPI/mycobot.py @@ -50,6 +50,9 @@ class MyCobot(): def power_off(self): self._write('fe fe 02 11 fa') + def set_free_mode(self): + self._write('fefe0213fa') + def get_angles(self): '''Get all angle return a list diff --git a/scripts/test.py b/scripts/test.py index 2860838..d4e38bf 100644 --- a/scripts/test.py +++ b/scripts/test.py @@ -4,4 +4,5 @@ from pythonAPI.mycobot import MyCobot if __name__ == '__main__': mycobot = MyCobot() mycobot.set_color("ff0000") + print(mycobot.get_angles_of_radian())