mirror of
https://github.com/elephantrobotics/mycobot_ros.git
synced 2026-07-05 19:47:04 +00:00
update(api): add new method.
This commit is contained in:
parent
d2e3ba64ec
commit
98c41cb51b
3 changed files with 7 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -4,4 +4,5 @@ from pythonAPI.mycobot import MyCobot
|
|||
if __name__ == '__main__':
|
||||
mycobot = MyCobot()
|
||||
mycobot.set_color("ff0000")
|
||||
print(mycobot.get_angles_of_radian())
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue