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

Add localization interface and cancelable navigation methods #40

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

Conversation

sktometometo
Copy link
Contributor

@sktometometo sktometometo commented Jun 29, 2023

Based on pull requests below.

This PR introduces features below.

  • Update argument of _set_localization_waypoint() from *arg to waypoint_id
    • Update referencing line to thie method
  • Add localization methods for users. ( set_localization_fiducial() and set_localization_waypoint() )
  • Add cancelable and more atomic navigate_to interface
    • For internal, _start_navigate_to() and _cancel_navigate_to()
    • For user, start_navigation() and cancel_navigation()
  • Add _last_navigate_to_command value to indicate navigate_to is running or not
    • Use this for _is_moving update

Checked with a robot by

from spot_wrapper.wrapper import SpotWrapper
import threading
import logging
import time

logging.basicConfig(level=logging.INFO)
logger = logging.getLogger()

wrapper = SpotWrapper(username='hoge', password='fuga', hostname='192.168.50.3', robot_name='myspot', logger=logger)
wrapper.claim()

# Manually upload, localize and start navigation
wrapper.upload_graph("path to graph")
wrapper.list_graph(None)
wrapper.set_localization_fiducial()
wrapper.start_navigate_to("waypoint A id")

# Start navigation and cancel it
wrapper.clear_graph()
wrapper.upload_graph("path to graph")
wrapper.set_localization_waypoint("waypoint A id")
thread = threading.Thread(
           target=lambda: wrapper.start_navigate_to("waypoint B id")
)
time.sleep(5.)
wrapper.cancel_navigate_to()

@heuristicus heuristicus mentioned this pull request Jun 29, 2023
2 tasks
@sktometometo sktometometo force-pushed the PR/add-cancelable-navigation-methods branch from 4bd3616 to fae31b5 Compare June 30, 2023 00:03
@sktometometo sktometometo changed the title [WIP] add localization interface and cancelable navigation methods Add localization interface and cancelable navigation methods Jun 30, 2023
@sktometometo sktometometo marked this pull request as ready for review June 30, 2023 01:42
@sktometometo
Copy link
Contributor Author

Checked with our robot.

@sktometometo sktometometo force-pushed the PR/add-cancelable-navigation-methods branch from 674b514 to cbbf0a3 Compare June 30, 2023 01:44
@sktometometo
Copy link
Contributor Author

Thanks for review! I will update the branch.

@sktometometo sktometometo marked this pull request as draft July 1, 2023 06:12
@sktometometo sktometometo force-pushed the PR/add-cancelable-navigation-methods branch from 64b9c6e to b7ac5a2 Compare July 1, 2023 06:40
@sktometometo
Copy link
Contributor Author

Rebase this branch to #48 to support RobotCommandData class.

@sktometometo sktometometo marked this pull request as ready for review July 4, 2023 00:56
@sktometometo sktometometo force-pushed the PR/add-cancelable-navigation-methods branch from b7ac5a2 to 5bc6463 Compare July 4, 2023 05:27
@sktometometo
Copy link
Contributor Author

Pause this PR until #44 is merged.

@sktometometo sktometometo marked this pull request as draft July 9, 2023 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants