Skip to content

High-Level Skills Interfaces

Introduction

High-Level Skills Interfaces:
Encapsulates complex prerequisite state checks and low-level call sequences to provide ready-to-use high-level interfaces for common robot tasks. Callers do not need to manually handle localization state, posture switching, mode switching, and other complex workflows.

PurposePython
Smart Navigation to Location (with pre-checks and graph planning)

Smart Navigation

Python Interface

go_to_location(location=None, pose=None, travel_params=None, timeout=600, complete_callback=None, failed_callback=None, progress_callback=None, graph_file=None, start_location=None)

Function Description
High-level skill for navigating to a specified location or pose. Automatically performs the following prerequisite checks and adjustments — callers do not need to handle these manually:

  1. Validate target location (location mode only): checks whether the target location is registered, supports fuzzy matching of spoken suffixes
  2. Check localization state: if localization is abnormal, automatically triggers relocalization (set_localization(auto_relocation=True))
  3. Check robot posture: if not standing, automatically executes stand up (stand_up())
  4. Check control mode: if not in navigation mode, automatically switches to NAV_MODE

Road Network Planning (only effective in location mode): If a road network graph file exists in the config directory and the target location is in the network, automatically splits navigation into multiple segments; otherwise falls back to direct navigation.

Parameter Description

Parameter NameTypeRequired/DefaultDescription
locationstrOne of location or poseTarget location name (must be registered in the system). Mutually exclusive with pose.
posePoseOne of location or poseTarget pose object, suitable for "return to origin" scenarios. Typically used with get_current_pose(). Mutually exclusive with location.
travel_paramsMsgTravelParamsNoneNavigation travel parameters; uses default parameters when None.
timeoutint600Total navigation timeout in seconds. When road network planning is enabled, per-segment timeout is max(60, timeout // num_segments).
complete_callbackcallableNoneCallback when navigation successfully arrives; receives NavCompleteEvent.
failed_callbackcallableNoneCallback when navigation fails; receives NavFailedEvent.
progress_callbackcallableNoneProgress callback during navigation; receives NavProgressEvent.
graph_filestrNoneRoad network graph filename or path. When None, automatically discovers the default graph in the config directory (default.yaml or the first .yaml file).
start_locationstrNoneStarting road network node name. When None, automatically matches the nearest node based on current position.

Return Value

TypeDescription
IntelligentNavigationResponsestate.code == 0 indicates successfully reached the target.

Exceptions

ExceptionDescription
GoToLocationErrorRaised when a prerequisite check fails, with an English description (e.g., location not found, relocalization failed, stand up failed).

Example

python
from daystar_api.highlevel_skills import go_to_location

# Navigate to a named location (auto pre-checks + auto road network planning)
result = go_to_location("break_room")
if result.state.code == 0:
    print("Arrived at break room")

# Specify road network graph file
result = go_to_location("meeting_room", graph_file="office")

# Specify starting node (more accurate when current location is known)
result = go_to_location("meeting_room", start_location="lobby")

# Return to starting position (record position first, then return after task)
from daystar_api.lowlevel_skills import get_current_pose
pose_resp = get_current_pose()
origin_pose = pose_resp.response.location_pose
# ... perform other tasks ...
result = go_to_location(pose=origin_pose)

# With error handling
from daystar_api.highlevel_skills import GoToLocationError
try:
    go_to_location("unregistered_location")
except GoToLocationError as e:
    print(f"Navigation prerequisite check failed: {e}")