Forums Niryo One Programming Niryo One Python API get_pose error

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • Arif Saeed
    Participant
    Post count: 7

    I tried to use the method get_pose from the python API however i get the error msg:
    AttributeError: __NiryoOne instance has no attribute ‘get_pose’

    had this method been deprecated.

    I dont think this an error on my side, as when i try get_joints() it works

    S.Imura
    Participant
    Post count: 9

    Hi Arif Saeed

    I just tried “get_pose()” with reference to the below page.
    https://github.com/NiryoRobotics/niryo_one_ros/tree/master/niryo_one_python_api

    I could not execute this command.

    I found the correct command from the below page.
    >Niryo One Python API.
    https://github.com/NiryoRobotics/niryo_one_ros/blob/master/niryo_one_python_api/src/niryo_one_python_api/niryo_one_api.py#L376

    I tried “get_arm_pose()”. I can do it.
    Please try “get_arm_pose()”. “get_pose()”command is wrong.

    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 1 month ago by S.Imura.
    • This reply was modified 1 month ago by S.Imura.
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.