Rosanswers logo

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():
    client = actionlib.SimpleActionClient('execute_trajectory', GoalID)
    goal = GoalID()
    goal.goal_id.stamp.secs = 0
    goal.goal_id.stamp.nsecs = 0
    goal.goal_id.id = ''
    goal.goal = {}

if name == '__main__':

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!


Originally posted by hpoleselo on ROS Answers with karma: 133 on 2018-11-02

Post score: 1


1 Answer 1


Rosanswers logo

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.

Originally posted by PeteBlackerThe3rd with karma: 9529 on 2018-11-02

This answer was ACCEPTED on the original site

Post score: 2

Original comments

Comment by hpoleselo on 2018-11-05:
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!


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.