Ask Your Question

actionlib shutdown beacuse of getState()

asked 2020-11-30 20:53:26 -0600

zhazha gravatar image

updated 2020-12-06 21:10:53 -0600

the code is be like:

return this->moveBaseClient->getState();

while moveBaseClient is:

typedef actionlib::SimpleActionClient<move_base_msgs::MoveBaseAction> MoveBaseClient;
std::shared_ptr<MoveBaseClient> moveBaseClient;

calling at 20hz and this happened:

robot_decision_node: /opt/ros/kinetic/include/actionlib/managed_list.h:168: const T& actionlib::ManagedList<T>::Handle::getElem() const [with T = boost::shared_ptr<actionlib::CommStateMachine<move_base_msgs::MoveBaseAction_<std::allocator<void> > > >]: Assertion `valid_' failed.

Am i using getState wrong?

i chage the frequency to 10hz, now it works fine.

but it's still a bug?

edit retag flag offensive close merge delete



You should also post the code that sets moveBaseClient.

miura gravatar image miura  ( 2020-12-01 07:56:32 -0600 )edit

hi,i have updated the question with defination of moveBaseClient

zhazha gravatar image zhazha  ( 2020-12-01 19:56:16 -0600 )edit

1 Answer

Sort by » oldest newest most voted

answered 2020-12-06 05:57:25 -0600

miura gravatar image

You may not be able to create an instance.

MoveBaseClient moveBaseClient("move_base", true); and initialize it with this->moveBaseClient.getState(), which should work.

If it has to be a pointer, it would work with std::shared_ptr<MoveBaseClient> moveBaseClient = new MoveBaseClient("move_base", true);.

edit flag offensive delete link more



i have initialized the pointer like this:

if (!moveBaseClient.get()) { moveBaseClient = std::make_shared<movebaseclient>("/move_base"); }

and i run the node in 10hz,it works fine

zhazha gravatar image zhazha  ( 2020-12-06 19:11:19 -0600 )edit

Congratulations. If you would like, please make a collect. Or, please state your answer.

miura gravatar image miura  ( 2020-12-06 20:10:26 -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

1 follower


Asked: 2020-11-30 20:53:26 -0600

Seen: 92 times

Last updated: Dec 06 '20