Skip to content

Navigation Service Interfaces ​

Introduction ​

Navigation Service Interfaces:
Provides robot navigation within a localized map, including location navigation, pose navigation, multi-waypoint route planning, and location point add/delete/query management.

Prerequisites:

  1. Before using navigation: load a map → relocalization success → switch to navigation mode (NAV_MODE)
  2. Use the high-level skill go_to_location to automatically complete the above prerequisites
PurposePython
Navigate to Location✔
Navigate to Pose✔
Multi-waypoint Navigation✔
Cancel Navigation✔
Pause Navigation✔
Resume Navigation✔
Wait for Navigation to Complete✔
Register Navigation Event Callbacks✔
Get Current Pose✔
Add Location✔
Delete Location✔
Get Available Locations✔

Navigation Control ​

Python Interface ​

Function Description
Navigate to a saved named location. Supports blocking/non-blocking mode and complete/failed/progress event callbacks.

Parameter Description

Parameter NameTypeRequired/DefaultDescription
locationstrRequiredTarget location name. Can also use target or location_name as keyword argument names.
travel_paramsMsgTravelParamsDefault paramsNavigation travel parameters (speed mode, gait, etc.).
blockboolTrueIf True, blocks until navigation completes; if False, returns immediately and runs in background.
timeoutint600Navigation timeout in seconds.
complete_callbackcallableNoneCallback when navigation successfully arrives; receives NavCompleteEvent.
failed_callbackcallableNoneCallback when navigation fails; receives NavFailedEvent.
progress_callbackcallableNoneProgress callback during navigation; receives NavProgressEvent.

Return Value

TypeDescription
IntelligentNavigationResponsestate.code == 0 indicates navigation successfully arrived.

Example

python
from daystar_api.lowlevel_skills import navigation_to_location

# Simple navigation (blocking)
result = navigation_to_location("kitchen")
if result.state.code == 0:
    print("Arrived at target location")

# Non-blocking navigation with callbacks
def on_complete(event):
    print("Navigation complete!")

def on_failed(event):
    print(f"Navigation failed: {event.error_msg}")

navigation_to_location(
    location="kitchen",
    block=False,
    complete_callback=on_complete,
    failed_callback=on_failed
)

Function Description
Navigate to a specified coordinate pose (position + orientation). Supports passing coordinate components directly or a Pose object.

Parameter Description

Parameter NameTypeRequired/DefaultDescription
x, y, zfloatRequired (or use pose)Target position coordinates (meters).
qw, qx, qy, qzfloatqw=1.0, others 0.0Target orientation as quaternion.
posePoseAlternative to coordinatesTarget pose object (Pose or dict format).
blockboolTrueIf True, blocks and waits; if False, runs in background.
timeoutint600Navigation timeout in seconds.
complete_callbackcallableNoneNavigation success callback.
failed_callbackcallableNoneNavigation failure callback.
progress_callbackcallableNoneProgress callback.

Return Value

TypeDescription
IntelligentNavigationResponsestate.code == 0 indicates navigation successfully arrived.

Example

python
from daystar_api.lowlevel_skills import navigation_to_pose, Pose

# Using coordinate parameters
result = navigation_to_pose(x=1.0, y=2.0, z=0.0, qw=1.0)

# Using Pose object
pose = Pose()
pose.position.x = 1.0
pose.position.y = 2.0
pose.orientation.w = 1.0
result = navigation_to_pose(pose=pose)

Function Description
Navigate sequentially through multiple pose waypoints (path tracking).

Parameter Description

Parameter NameTypeRequired/DefaultDescription
exec_waypointslist[PoseStamped]RequiredList of waypoints (PoseStamped objects).
exec_typeint1Execution type: 1 autonomous navigation; 2 strict trajectory tracking; 3 line fitting; 4 arc fitting; 5 sine fitting.
travel_paramsMsgTravelParamsDefault paramsNavigation travel parameters.
blockboolTrueIf True, blocks until completion.
timeoutint600Timeout in seconds.

Return Value

TypeDescription
NavigationViaPosesResponsestate.code == 0 indicates navigation completed.

Example

python
from daystar_api.lowlevel_skills import navigation_via_poses, PoseStamped

waypoints = []
# Build waypoint list...
result = navigation_via_poses(exec_waypoints=waypoints)

cancel_navigation(timeout=5) ​

Function Description
Cancel the currently executing navigation task.

Parameter Description

Parameter NameTypeRequired/DefaultDescription
timeoutint5Cancel operation timeout in seconds.

Return Value

TypeDescription
IntelligentNavigationResponsestate.code == 0 indicates cancellation succeeded.

Example

python
from daystar_api.lowlevel_skills import cancel_navigation

result = cancel_navigation()
if result.state.code == 0:
    print("Navigation cancelled")

pause_navigation() ​

Function Description
Pause the currently executing navigation task. The robot stops at its current position and waits for a resume command.

Parameter Description

No parameters.

Return Value

TypeDescription
IntelligentNavigationResponsestate.code == 0 indicates pause succeeded.

Example

python
from daystar_api.lowlevel_skills import pause_navigation, resume_navigation
import time

pause_navigation()
print("Navigation paused")
time.sleep(5)
resume_navigation()

resume_navigation() ​

Function Description
Resume a paused navigation task. The robot continues toward the target location.

Parameter Description

No parameters.

Return Value

TypeDescription
IntelligentNavigationResponsestate.code == 0 indicates resume succeeded.

Example

python
from daystar_api.lowlevel_skills import resume_navigation

result = resume_navigation()
if result.state.code == 0:
    print("Navigation resumed")

wait_for_navigation(timeout=600) ​

Function Description
Wait for the most recent non-blocking navigation call to complete. Navigation internally caches the last response, so no argument is needed.

Parameter Description

Parameter NameTypeRequired/DefaultDescription
timeoutint600Seconds to wait. 0 means wait indefinitely.

Return Value

TypeDescription
IntelligentNavigation_Resultresult=True on success; result=False and message="Timeout or canceled" on failure.

Example

python
from daystar_api.lowlevel_skills import navigation_to_location, wait_for_navigation

navigation_to_location("kitchen", block=False)
# Do other work...
result = wait_for_navigation(timeout=60)
if result.result:
    print("Arrived at kitchen")
else:
    print("Navigation failed:", result.message)

register_event_callbacks(complete_cb=None, failed_cb=None, progress_cb=None) ​

Function Description
Register global navigation event callback functions. Callbacks will apply to all subsequent navigation tasks, including non-blocking calls via navigation_to_location.

Parameter Description

Parameter NameTypeRequired/DefaultDescription
complete_cbcallableNoneCalled when navigation completes successfully; receives NavCompleteEvent (contains final position info).
failed_cbcallableNoneCalled when navigation fails; receives NavFailedEvent (contains failure reason and error code).
progress_cbcallableNoneCalled periodically during navigation; receives NavProgressEvent (contains progress percentage).

Return Value

TypeDescription
NoneNo return value.

Example

python
from daystar_api.lowlevel_skills import register_event_callbacks, navigation_to_location

def on_complete(event):
    print("Navigation complete!")

def on_failed(event):
    print(f"Navigation failed: {event.reason}")

register_event_callbacks(complete_cb=on_complete, failed_cb=on_failed)
navigation_to_location("kitchen", block=False)

Location Management ​

Python Interface ​

get_current_pose(timeout=5) ​

Function Description
Get the robot's current pose (position and orientation) in the map.

Parameter Description

Parameter NameTypeRequired/DefaultDescription
timeoutint5Service call timeout in seconds.

Return Value

TypeDescription
GetCurrentPoseServiceResponsestate.code == 0 indicates success; access position and orientation via response.location_pose.position.x/y/z and response.location_pose.orientation.x/y/z/w (note: type is Pose, not PoseStamped).

Example

python
from daystar_api.lowlevel_skills import get_current_pose

result = get_current_pose()
if result.state.code == 0 and result.response.success:
    pose = result.response.location_pose
    print(f"Current position: x={pose.position.x:.2f}, y={pose.position.y:.2f}")

add_location(location, use_virtual_pose=False, virtual_pose=None, timeout=5) ​

Function Description
Save the robot's current pose as a named location. Also supports specifying a virtual pose (without the robot physically being at that location).

Parameter Description

Parameter NameTypeRequired/DefaultDescription
locationstrRequiredLocation name.
use_virtual_poseboolFalseIf True, use virtual_pose instead of the robot's current pose.
virtual_posePoseZero poseTarget pose for virtual location (used when use_virtual_pose=True).
timeoutint5Service call timeout in seconds.

Return Value

TypeDescription
AddLocationServiceResponsestate.code == 0 indicates save succeeded.

Example

python
from daystar_api.lowlevel_skills import add_location, Pose

# Save robot's current position
add_location("kitchen")

# Save virtual location (robot doesn't need to be there)
virtual_pose = Pose()
virtual_pose.position.x = 1.0
virtual_pose.position.y = 2.0
virtual_pose.orientation.w = 1.0
add_location("virtual_point", use_virtual_pose=True, virtual_pose=virtual_pose)

delete_location(location) ​

Function Description
Delete a saved named location.

Parameter Description

Parameter NameTypeRequired/DefaultDescription
locationstrRequiredName of the location to delete.

Return Value

TypeDescription
DeleteLocationResponsestate.code == 0 indicates deletion succeeded; result is a boolean.

Example

python
from daystar_api.lowlevel_skills import delete_location

result = delete_location("old_point")
if result.result:
    print("Location deleted")

get_available_location(timeout=3) ​

Function Description
Get a list of all registered location names in the system.

Parameter Description

Parameter NameTypeRequired/DefaultDescription
timeoutint3Query timeout in seconds.

Return Value

TypeDescription
GetAvailableLocationResponselocations field is a list of location info; each entry contains name (location name) and pose (pose) fields.

Example

python
from daystar_api.lowlevel_skills import get_available_location

result = get_available_location()
for loc in result.locations:
    name = loc["name"] if isinstance(loc, dict) else str(loc)
    print(f"Location: {name}")

# Check if a location exists
names = [loc["name"] for loc in result.locations]
if "kitchen" in names:
    print("kitchen location is registered")