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

Pausing/resuming a navigation task using Nav2 Python Simple Commander

asked 2022-04-25 05:51:29 -0500

ljaniec gravatar image

Hello,

I am using the ROS2 Galactic and Nav2 stack with Python Simple Commander in a Gazebo simulation (Ubuntu 20.04).

How can I pause (and later resume) the robot's movement while navigating?

E.g. TB3 is moving along a planned path through an intersection. I want to pause its movement using a kind of trigger, wait a few seconds, and then resume the previous navigating plan.

I checked Simple Commander API but I didn't find a similar command that could be used in a similar way that I would like.

I can try to work around this problem by saving the current position and the goal pose, then canceling the task with 'cancelTask()' + resuming the task with goToPose(), but maybe there is a better solution? Could you help me with some hints?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-04-26 20:33:53 -0500

updated 2022-04-26 20:35:03 -0500

https://github.com/ros-planning/navig...

I think we clearly went through this in the ticket. You could definitely write a wrapper on some functions for an application to save info like pose / goal and have that be used to send to the main navigator APIs. But that's mostly just shifting code around.

edit flag offensive delete link more

Comments

Yes, chronologically that question was there first, only later did I fill out the feature request.

TL;DR; cancelTask() + goToPose() to the same position is the way to go.

ljaniec gravatar image ljaniec  ( 2022-04-26 20:36:25 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2022-04-25 05:51:29 -0500

Seen: 898 times

Last updated: Apr 26 '22