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

Passing arguments with action client

asked 2018-04-30 08:38:49 -0500

Krebsileinchen gravatar image

updated 2018-04-30 08:43:42 -0500

I want to control an Franka Emika robot using action servers. https://frankaemika.github.io/docs/ro... The gripper Operation franka_gripper::HomingAction() is working with:

 actionlib::SimpleActionClient<franka_gripper::HomingAction> ac("franka_gripper/homing", true);
 ROS_INFO("Waiting for action server to start.");
 bool success=ac.isServerConnected(); //will wait for infinite time
 if (success)
   {ROS_INFO("Verbindung hergestellt");}
 ac.waitForServer(); 
 ROS_INFO("Action server started, sending goal.");
 franka_gripper::HomingGoal goal;
 ac.sendGoal(goal);

Now I would like to use the MoveAction as descriped in the documentation where I have to pass the arguments for width and speed. However I don't get how to do this. I checked the MoveGoal.msg which tells that two floats are needed. I tried to set them with:

ac.sendGoal(width, speed);

which is not working. Analogously to the tutorial ( http://wiki.ros.org/actionlib_tutoria... ) I used goal.order= in different variation like

goal.order {width, speed};

but it seems not to know the order function. So my question is how I can set this parameters correctly.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-04-30 11:46:02 -0500

NEngelhard gravatar image

I think you should start with some basic programming tutorials before working with a robot where wrong commands can lead to unsafe movements and injury. (or are you working only in simulation?)

But about your question, it should be simply:

goal.width = 0.05; 
ac.sendgoal(goal);
edit flag offensive delete link more

Comments

Oh sure.. thank you. No worries I am save.

Krebsileinchen gravatar image Krebsileinchen  ( 2018-05-03 03:01:17 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2018-04-30 08:38:49 -0500

Seen: 933 times

Last updated: Apr 30 '18