Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task Revival endpoint #32

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Task Revival endpoint #32

wants to merge 2 commits into from

Conversation

youliangtan
Copy link
Member

Feature

This will add a /revive_task endpoint to the current rmf_demos_panel api-server. This will enable user to revive a previously canceled/failed task.

How to test

  • rmf_ros2: developing branch: feature/task-revival

Compile, then follow the steps below:

  1. Run rmf_demos office world as normal
ros2 launch rmf_demos office.launch.xml
  1. Open localhost:5000, then submit task list task_lists/office_tasks.json
  2. Cancel Task: cancel Loop2 on the Web panel
  3. Revive the Canceled Task:
curl -X POST http://localhost:8080/revive_task -d '{"task_id": "Loop2"}' -H "Content-Type: application/json"

Signed-off-by: youliang tan_you_liang@hotmail.com

Signed-off-by: youliang <tan_you_liang@hotmail.com>
@youliangtan youliangtan added the enhancement New feature or request label Apr 15, 2021
id = request.json['task_id']
is_success = dispatcher_client.revive_task_request(id)
logging.debug(f" ROS Time: {dispatcher_client.ros_time()} | \
Cancel Task: {id}, success: {is_success}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: also I noticed this is still Cancel and not Revive

Copy link
Contributor

@vallq vallq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi youliang, I was unable to replicate the revival based on the instructions. kept getting the [api_server]: /revive_task srv call failed message on the console, and tried to call the API with Postman as well, but the boolean received is still False. not sure what I might have done wrong but I rebuilt the entire ws just to be sure

@youliangtan
Copy link
Member Author

@vallq Are you using the feature/task-revival branch from rmf_ros2? Also, take note that the task can only be revived if the task was canceled or failed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants