Issue with creating action client

asked 2019-08-03 08:03:06 -0500

SunnyKatyara gravatar image

updated 2019-08-03 14:36:52 -0500

jayess gravatar image

Hello, since i am writing the action client to send the goal to action server, but my robot in rviz does not move and even i am able see the data transfer to respective topic (goal topic).

My Code#

import actionlib
from actionlib import SimpleActionClient
from actionlib_msgs.msg import *
from actionlib.msg import *
from cartesian_interface.msg import ReachPoseAction, ReachPoseGoal
from geometry_msgs.msg import Pose

def feedback_cb(msg):
    print 'feedback recieved:', msg

def call_server():

    client = actionlib.SimpleActionClient('/cartesian/panda_right_mount_link/reach', ReachPoseAction)

    client.wait_for_server()

    pose1 = Pose()

    pose1.position.x = 0.9 
    pose1.position.y = 0.9
    pose1.position.z = 0.9
    pose1.orientation.x = 0.0
    pose1.orientation.y = 0.0 
    pose1.orientation.z = 0.0
    pose1.orientation.w = 1.0 

    #pose2 = Pose()

    #pose2.position.x = 0.3 
    #pose2.position.y = 0.3
    #pose2.position.z = 0.3
    #pose2.orientation.x = 0.0
    #pose2.orientation.y = 0.0 
    #pose2.orientation.z = 0.0
    #pose2.orientation.w = 1.0

    goal = ReachPoseGoal()
    goal.frames.append(pose1)
    #goal.frames.append(pose2)


    client.send_goal(goal, feedback_cb=feedback_cb)
    client.wait_for_result()

    result = client.get_result()
    return result


if __name__ == '__main__':

    try:
       rospy.init_node('move_panda')
       result = call_server()

       print 'The result is:', result

    except rospy.ROSInterruptException as e:
       print 'something went wrong:', e

The Goal Messages are;

geometry_msgs/Pose[] frames

float32[] time

bool incremental

I do not know where i am making the errors. I am defining the position and orientation in array and then append it (i want to do push_back as in C++) but seeing no result. I will be thankful to you, if someone can help me.

Thank You

edit retag flag offensive close merge delete