ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

Trouble trying to find ActionType for "execute_trajectory" Action Server

asked 2018-11-02 02:38:07 -0500

hpoleselo gravatar image

updated 2018-11-02 02:38:31 -0500

Hello, i'm running ROS Kinetic on Ubuntu 16.04 and working with the Panda robot from Franka Emika.

I'm currently trying to send a command to the robot via Python scripting, i.e Action Client.

I can already send commands to the robot (like stopping it) through the command line, like:

$ rostopic pub -1 /execute_trajectory/cancel actionlib_msgs/GoalID "stamp:
  secs: 0
  nsecs: 0
id: ''"

And i would like to do the same but with Python, so i tried the following:

import actionlib
import rospy
from actionlib_msgs.msg import GoalID
from franka_control.msg import ErrorRecoveryAction, ErrorRecoveryActionGoal


def stop_robot():
    rospy.init_node('panda_STOPP')
    client = actionlib.SimpleActionClient('execute_trajectory', GoalID)
    client.wait_for_server()
    goal = GoalID()
    goal.goal_id.stamp.secs = 0
    goal.goal_id.stamp.nsecs = 0
    goal.goal_id.id = ''
    goal.goal = {}
    client.send_goal(goal)

if name == '__main__':
    stop_robot()

It doesn't work because GoalID is not an action type message. And in order to create the Client we need one Action message. And i find it strange that there is no action message for GoalID because "execute_trajectory" is actually an action server, meaning there should be an action message for it, right? I don't know if understood the concept of Actions wrongly but any help would be welcome!

Thanks!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2018-11-02 07:00:29 -0500

Are you using MoveIt to control your robot? If so all the messages, services and action types are described here. You'll need the ExecuteTrajectory action to command the arm.

To clarify a goal and a trajectory are different things. A goal is the desired pose of the end effector (and possibly gripper state too) but a trajectory is a matrix of joint angles defining how they change over time that the robot can follow. You can generate a trajectory from an initial robot state and a goal using a motion planning algorithm.

Hope this helps.

edit flag offensive delete link more

Comments

Hey Pete, yes, i'm using MoveIt to control it, i just didn't realized that actually MoveIt was generating this execute_trajectory. I'm going to try this out and then give you a feedback. Thank you very much for your explanation and answer!

hpoleselo gravatar image hpoleselo  ( 2018-11-05 01:33:56 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2018-11-02 02:38:07 -0500

Seen: 702 times

Last updated: Nov 02 '18