Forums Niryo One Troubleshooting 'RobotState' object has no attribute 'orientation'

Viewing 1 post (of 1 total)
  • Author
    Posts
  • angel.pineiro@usc.es
    Participant
    Post count: 1

    I am trying to introduce a simple trajectory through Python using “compute_cartesian_path” but I am getting this error: “AttributeError: ‘RobotState’ object has no attribute ‘orientation'”. This is the first I do with Niryo so probably I am doing some very basic error… My code is as follows:

    import moveit_commander
    import geometry_msgs.msg
    import rospy
    import time
    import numpy as np
    import copy
    from niryo_one_python_api.niryo_one_api import *

    def mkcircle(x0,y0,r,step):
    x=[]; y=[]
    for tetha in range (0,360+step,step):
    x.append(x0+r*np.cos(np.deg2rad(tetha)))
    y.append(y0+r*np.sin(np.deg2rad(tetha)))
    return (x,y)

    rospy.init_node(‘niryo_one_run_python_api_code’)
    n= NiryoOne()
    move_group_commander_name = rospy.get_param(‘/niryo_one_commander/move_group_commander_name’)
    arm = moveit_commander.MoveGroupCommander(move_group_commander_name)
    waypoints=[]

    n.activate_learning_mode(0)
    c=mkcircle(0.20,0.2,0.1,20)

    n.move_pose(c[0][0],c[1][0],0.1,0,0,0)
    wpose=n.get_arm_pose()

    for i in range(0,len(c[0]),1):
    wpose.position.x=c[0][i]; wpose.position.y=c[1][i]
    waypoints.append(copy.deepcopy(wpose))

    path,fraction=arm.compute_cartesian_path(waypoints,0.001,0)
    arm.execute(path)

    n.activate_learning_mode(1)

    Anyone can tell me where is my error?

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.