Forums Niryo One Programming Niryo One Python API get_pose error Reply To: Python API get_pose error

S.Imura
Participant
Post count: 9

I’ve attached a sample code.Have a nice day.
(Be careful! Please add “indent” yourself.)
***python script***
——————————————–
#!/usr/bin/env python

# To use the API, copy these 4 lines on each Python file you create
from niryo_one_python_api.niryo_one_api import *
import rospy
import time
rospy.init_node(‘niryo_one_example_python_api’)

print “— Start”
n = NiryoOne()

try:
print n.get_arm_pose()
except NiryoOneException as e:
print e
# handle exception here
# you can also make a try/except for each command separately

print “— End”
——————————————–

***Result***
— Start
position:
x: 0.0680009960324
y: -0.000969115385027
z: 0.155085439994
rpy:
roll: -5.10451458511e-12
pitch: 1.40168153349
yaw: -0.014250523372
— End

  • This reply was modified 8 months, 1 week ago by S.Imura.
  • This reply was modified 8 months, 1 week ago by S.Imura.