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

actionlib feedback move_base

asked 2013-07-18 05:25:40 -0500

acp gravatar image

updated 2013-07-18 05:48:20 -0500

Dear all.

I have navigation stack implemented and I can send some goals to the move base.

I just want to cancel a goal before it reaches its position using feedback.

How can I use feedback?

I have use the following code, but it doesnt work.

ac.sendGoal(goal, &feedbackCb);

void Pose_Goal::feedbackCb(const move_baseFeedbackConstPtr& feedback){

ROS_INFO("[X]:%f [Y]:%f",feedback->base_position.pose.position.x, feedback->base_position.pose.position.y);

}

any help I would appreciate it. Thanks in advance

edit retag flag offensive close merge delete

Comments

1

"It doesn't work" is pretty vague. Is it not compiling or is it compiling but not functioning as you intend it to? If it isn't compiling, you should put the error message from the compiler in the question next time. In this case, it looks like you didn't name a type for feedbackX_ and feedbackY_.

thebyohazard gravatar image thebyohazard  ( 2013-07-18 05:41:52 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-07-18 06:56:47 -0500

thebyohazard gravatar image

updated 2013-07-19 04:25:09 -0500

Have a look at the api. The first function passed into sendGoal is the doneCB and only gets executed when the action server sends a result message. You'll need to use all the arguments instead of relying on the defaults. Something like

ac.sendGoal(goal, &doneCb, &activeCb, &feedbackCb);

EDIT: here's the code you said you used.

ac.sendGoal(goal,boost::bind(&Pose_Goal::doneCb, this, _1, _2), Client::SimpleActiveCallback(),Client::SimpleFeedbackCallback());

void Pose_Goal::feedbackCb(const move_base_msgs::MoveBaseFeedbackConstPtr &feedback){ 
    ROS_INFO("[X]:%f [Y]:%f [W]: %f",feedback->base_position.pose.position.x,feedback->base_position.pose.position.y,feedback->base_position.pose.orientation.w); 
}

You need to pass your feedback function to sendGoal. Client::SimpleFeedbackCallback() is the default, do-nothing feedback callback. Put a reference or boost pointer to your Pose_Goal::feedbackCb instead.

edit flag offensive delete link more

Comments

hi, well I have done the following: ac.sendGoal(goal,boost::bind(&Pose_Goal::doneCb, this, _1, _2), Client::SimpleActiveCallback(),Client::SimpleFeedbackCallback());

acp gravatar image acp  ( 2013-07-19 01:53:26 -0500 )edit

void Pose_Goal::feedbackCb(const move_base_msgs::MoveBaseFeedbackConstPtr &feedback){ ROS_INFO("[X]:%f [Y]:%f [W]: %f",feedback->base_position.pose.position.x,feedback->base_position.pose.position.y,feedback->base_position.pose.orientation.w); }

acp gravatar image acp  ( 2013-07-19 01:53:47 -0500 )edit

But I can not get the position over feedbackCb, just wondering how to get the current position from feedbackCb

acp gravatar image acp  ( 2013-07-19 01:54:31 -0500 )edit

Did you find a way to solve that issue regarding the modification of goal using feedback, eventually ??

Dimi gravatar image Dimi  ( 2020-04-21 06:36:30 -0500 )edit

Question Tools

Stats

Asked: 2013-07-18 05:25:40 -0500

Seen: 3,821 times

Last updated: Apr 21 '20