update(api): add new method.

This commit is contained in:
张立军 2020-12-29 10:10:53 +08:00
parent d2e3ba64ec
commit 98c41cb51b
3 changed files with 7 additions and 0 deletions

View file

@ -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)

View file

@ -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

View file

@ -4,4 +4,5 @@ from pythonAPI.mycobot import MyCobot
if __name__ == '__main__':
mycobot = MyCobot()
mycobot.set_color("ff0000")
print(mycobot.get_angles_of_radian())