Ask Your Question
0

How to use the action interface of franka_ros packages

asked 2018-04-27 09:21:49 -0600

Krebsileinchen gravatar image

updated 2018-04-30 06:15:27 -0600

Hello,

first of all: I am an absolute ROS beginner so excuse my silly question. I am trying to operate the Franka Emika Robot Panda using ROS.

Here the documentation: https://frankaemika.github.io/docs/ro...

I operated it previously using MoveIt but now i would like to use franka_ros directly for instance to move the gripper. I started the respective node using:

roslaunch franka_gripper franka_gripper.launch robot_ip:=<fci-ip>

In the docu it states that now different action servers can be used e.g. franka_gripper::HomingAction(). But what exactly do I have to do now for example to home the gripper. Do I have to use the code part franka_gripper::HomingAction() and if so where do I have to put it in? Do I have to start an action Server first?

I did some reading but somehow I can't figure out how this basic structure works.. Thanks in advance for any help and explanations!!


Edit: Thanks for your answer. Apparently I was on the right track. However, I was not sure wether I needed to write the action server myself. Now I wrote an action client.

I included the following into my action client:

#include <ros/ros.h>
#include <actionlib/client/simple_action_client.h>
#include <franka_gripper/franka_gripper.h>
#include <franka_gripper/HomingAction.h>

Within the main method I wrote:

ros::init(argc, argv, "ros_test_client";
actionlib::SimpleActionClient<franka_gripper::HomingAction> ac("franka_gripper/homing", true);
ROS_INFO("Waiting for action server to start");
ac.waitForServer();
ROS_INFO("Actin server started, sending goal");

However, when I am running the action client it only gets to the point where it returns "Waiting for action server to start". So apparently the action server is not yet started.

Reading ( https://frankaemika.github.io/docs/ro... ) I thought

roslaunch franka_gripper franka_gripper.launch robot_ip:=<fci-ip>

would do the job. Apparently it is not. I tryed to start the node independly by: rosrun franka_gripper franka_gripper_node Robot_ip:=<fci_ip> In that case I get the error:

terminate called after throwing an instace of 'ros::InvalidNameException' what(): Character [1] is not valid as the first character in Graph Resour Name <fci-ip>

edit retag flag offensive close merge delete

Comments

I've merged your answer into your question, as it is not an answer, but an update of your question. Please edit your question next time. Use the edit link/button for that.

Also: you keep referring to an Action server, while all your code shows a client.

gvdhoorn gravatar imagegvdhoorn ( 2018-04-30 03:36:29 -0600 )edit

Thank you. I changed it.

Krebsileinchen gravatar imageKrebsileinchen ( 2018-04-30 03:46:44 -0600 )edit

I still see "action server" at least three times.

gvdhoorn gravatar imagegvdhoorn ( 2018-04-30 04:07:44 -0600 )edit

Ok. Maybe i misunderstood it. At first I thought I would have to write and action server plus an action client. Now, I am assuming that I only have to write an action client. However one task of that action client is to start the action server (which seems not to work in my case), isn't it?

Krebsileinchen gravatar imageKrebsileinchen ( 2018-04-30 04:18:03 -0600 )edit

However one task of that action client is to start the action server

No. Servers need to be running already for clients to be able to use them. The Franka stack should start the servers. You only write (a) client(s).

gvdhoorn gravatar imagegvdhoorn ( 2018-04-30 04:19:29 -0600 )edit

Ok. I'll try to change my question accordingly.

Krebsileinchen gravatar imageKrebsileinchen ( 2018-04-30 04:25:04 -0600 )edit

I would also recommend to do the actionlib tutorials and read the wiki page. That should provide you with some more info and background.

gvdhoorn gravatar imagegvdhoorn ( 2018-04-30 05:28:22 -0600 )edit

re: your deleted comment: waitServer() is there to make sure your client can actually connect to the server. Without the server, your client cannot do anything. waitServer() just provides you with a way to make sure the server has been started and is ready to accept goals (ie: requests).

gvdhoorn gravatar imagegvdhoorn ( 2018-04-30 05:29:40 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-04-27 13:09:33 -0600

robotchicken gravatar image

updated 2018-04-27 13:10:03 -0600

franka_gripper is a ROS node that offers action servers. Think of them as designed to be non-blocking long-running services that can be preempted if required. ROS offers topic, services, and actions to communicate between nodes/processes. A good summary can be found here.

So you would need to write a ROS Action Client(in Python/C++) to send a goal to the action servers exposed in franka_gripper. If you are new to ROS I would highly recommend going over the ROS tutorials from 1-16.

If in a hurry go over the tutorials(11, 14 for C++ or 12 -15 for Python) to get a quick look at ROS subscriber/publisher and some basics. Then head over to the actionlib tutorials(beginner) which is exactly what you need to communicate with franka_gripper. You would make changes based on the specification of the action server in franka_gripper.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2018-04-27 09:21:49 -0600

Seen: 522 times

Last updated: Apr 30 '18