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

Check if action goal is achieved in different node

asked 2022-04-04 05:10:39 -0500

sdudiak01 gravatar image

Hello everybody I am using nav2 FollowWaypoints action server to send some waypoints for my robot. Now I want to perform some task once action is finished (every waypoint has been achieved or not). How can I get information whether action is finished or not, but in a different node then the one sending goal (initial action client)?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-04-05 03:09:56 -0500

ljaniec gravatar image

updated 2022-04-05 03:45:17 -0500

I think you can send a trigger message on a separate topic to a different node for each action feedback update from the initial action client. A pair of an updated class variable and a timer publisher should be enough.

Have you tried anything similar before like there (Python) or there (C++)?

What problems did you encounter?

edit flag offensive delete link more

Comments

I haven't tried anything you mentioned, but I was thinking to do it using a server request rather than a topic. Is this a good approach?

sdudiak01 gravatar image sdudiak01  ( 2022-04-06 13:16:46 -0500 )edit
1

Invoking a service inside the callback is not recommended in ROS as it stops everything else while processing. Normal topic publisher should be fine, I think e.g. some timer to see if there is an update of the last saved point reached by the robot and forward this information

ljaniec gravatar image ljaniec  ( 2022-04-06 14:30:26 -0500 )edit

I will try it out and let you know how it went

sdudiak01 gravatar image sdudiak01  ( 2022-04-07 04:34:51 -0500 )edit
1

It works!!!. I added goal callbacks like here and in goal callback I send a trigger message to another node. It's very simple, but works just fine.

sdudiak01 gravatar image sdudiak01  ( 2022-04-11 06:56:39 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2022-04-04 05:10:39 -0500

Seen: 451 times

Last updated: Apr 05 '22