ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Action Client Results

asked 2013-05-17 15:45:29 -0600

ncr7 gravatar image

updated 2017-09-26 13:50:01 -0600

jayess gravatar image

So I've been looking at action clients now for a while. I have used these before, but never really used the results from the action servers that I've made in the past... but now I made a server that sends back results, which I get no errors from during compile time, but I haven't figured out how to use them on the client side without causing the build to fail.

ik_solve_msgs::IK_SolveActionResult ik_solve_results;
ik_solve_results = m_ikclient.getResult();

fails... I've tried as many ways as I can to see if I can get this working, but haven't had any success.

error message I'm getting,

error: no match for ‘operator=’ in ‘ik_solve_results = actionlib::SimpleActionClient<ActionSpec>::getResult() [with ActionSpec = ik_solve_msgs::IK_SolveAction_<std::allocator<void> >, actionlib::SimpleActionClient<ActionSpec>::ResultConstPtr = boost::shared_ptr<const ik_solve_msgs::IK_SolveResult_<std::allocator<void> > >, typename ActionSpec::_action_result_type::_result_type = ik_solve_msgs::IK_SolveResult_<std::allocator<void> >]()’

Does anyone actually know how to get the results back and use them?

all I see in the examples only uses the results to tell if the action server has finished, which I use,

bool finished_before_timeout = m_ikclient.waitForResult(ros::Duration(30.0));

any help would be greatly appreciated!

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2013-05-19 09:55:56 -0600

dornhege gravatar image

The result is a ConstPtr. Dereference it by putting a * in front of the result to use it this way.

edit flag offensive delete link more


Thanks, that's the correct answer. I found that getting results like this resolves my build issue, but haven't been able to test it yet since I have some other bugs to work first. ik_solve_msgs::IK_SolveResult ik_solve_results = *m_ikclient.getResult();

ncr7 gravatar image ncr7  ( 2013-05-19 13:29:24 -0600 )edit

Your Answer

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

Add Answer

Question Tools


Asked: 2013-05-17 15:45:29 -0600

Seen: 1,096 times

Last updated: Sep 26 '17