How to use the action interface of franka_ros packages
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>
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.
Thank you. I changed it.
I still see "action server" at least three times.
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?
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).
Ok. I'll try to change my question accordingly.
I would also recommend to do the
actionlib
tutorials and read the wiki page. That should provide you with some more info and background.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).