Use dispatch_go_to_place as an one-way task (#467)

Posted by @AlessandroCapobianco:

Hi everyone, I’m new to Open-RMF so sorry for the trivial questions.

In traffic-editor i’ve defined a vertex called ‘tinyRobot1_charger’ (that is the spawn point for tinyRobot1) and another vertex called ‘target1’.
I use the following command:
ros2 run rmf_demos_tasks dispatch_go_to_place -R tinyRobot1 -p target1 --use_sim_time
the command works fine and tinyRobot1 starts its path from ‘tinyRobot1_charger’, goes to ‘target1’ and then comes back to ‘tinyRobot1_charger’.

If I wanted to define a one-way task for my robot to move from ‘tinyRobot1_charger’ to ‘target1’ and then remained at the point ‘target1’ how should I do it?

And if I wanted to understand when my task was completed successfully, what should I do? Is there a topic that contains this information?

Thank you all

Chosen answer

Answer chosen by @AlessandroCapobianco at 2024-05-28T11:56:12Z.
Answered by @xiyuoh:

Hello! The robot behavior upon task completion can be configured inside the fleet config. For the office demo world, here’s the fleet config, and here is where we specify its finishing request. To ensure that the robot doesn’t go back to its charger, you may change park to nothing.

To check whether a robot is carrying out a task via ros2 topic in RMF demos, you can echo the topic /robot_state. If a task is underway, the task_id field will be populated for that particular robot, else it will be an empty string.

Posted by @xiyuoh:

Hello! The robot behavior upon task completion can be configured inside the fleet config. For the office demo world, here’s the fleet config, and here is where we specify its finishing request. To ensure that the robot doesn’t go back to its charger, you may change park to nothing.

To check whether a robot is carrying out a task via ros2 topic in RMF demos, you can echo the topic /robot_state. If a task is underway, the task_id field will be populated for that particular robot, else it will be an empty string.


Edited by @xiyuoh at 2024-05-27T10:51:58Z


This is the chosen answer.

Posted by @AlessandroCapobianco:

Thank you very much, the first solution you provided works fine :slight_smile:

For the second question I probably didn’t explain myself well, what I meant to say is if there is a topic that returns me the outcome of the task (something like SUCCESS/FAILURE)

For example if the robot fails to reach its goal due to the presence of an obstacle along its path the task_id field in /robot_state remains populated but I would like the simulation to return a FAILURE

Posted by @xiyuoh:

Thanks for clarifying! Sorry for misunderstanding the intent of your question.

Currently the simulation does not inform the fleet adapter if there are obstacles, and will simply keep trying to follow the navigation command provided. The task will remain incomplete until the robot manages to reach the target waypoint. If you have a preferred set of conditions to determine whether a task is failing (e.g. takes too much time), one possible solution is to implement your own check inside the demos fleet adapter.