SLAM Navigation Service Interface
| Function | C++ | Python | C# | Java | ROS |
|---|---|---|---|---|---|
| Start Mapping | ✔ | ✔ | ✔ | ✔ | ✔ |
| Stop Mapping | ✔ | ✔ | ✔ | ✔ | ✔ |
| Load Map | ✔ | ✔ | ✔ | ✔ | ✔ |
| Get Map List | ✔ | ✔ | ✔ | ✔ | ✔ |
| Upload Map | ✔ | ✔ | ✔ | ✔ | |
| Download Map | ✔ | ✔ | ✔ | ✔ | |
| Get Localization State | ✔ | ✔ | ✔ | ✔ | ✔ |
| Get Current Pose | ✔ | ✔ | ✔ | ✔ | ✔ |
| Relocalization | ✔ | ✔ | ✔ | ✔ | ✔ |
| Add Navigation Location | ✔ | ✔ | ✔ | ✔ | ✔ |
| Add Virtual Location | ✔ | ✔ | ✔ | ✔ | ✔ |
| Delete Location | ✔ | ✔ | ✔ | ✔ | ✔ |
| Get Available Locations | ✔ | ✔ | ✔ | ✔ | ✔ |
| Navigation Control | ✔ | ✔ | ✔ | ✔ | ✔ |
| Multi-parameter Navigation | ✔ | ✔ | ✔ | ✔ | ✔ |
| Cancel Navigation | ✔ | ✔ | ✔ | ✔ | ✔ |
| Get Navigation Events | ✔ | ✔ | ✔ | ✔ | ✔ |
Attention!!!
Map Requirements: Before using navigation interfaces, map files must be created by scanning the environment with LiDAR:
● External LiDAR Mapping: Use a phone or handheld LiDAR device for mapping (Format: PCD point cloud file, Coordinate System: Right-handed system, Z-axis up)
● Internal Robot LiDAR Mapping: Start/Stop mapping by calling SDK interfaces or using the SDK visualization panel tool. During mapping, remotely control the robot dog to move slowly. Upon successfully stopping mapping, the map will be saved in the robot dog, and you can choose whether to load the map for use.
● Ensure the navigation area is completely scanned to generate point cloud information.
Mode Requirements: To start navigation control, the robot mode must be switched to navigation mode. This can be done via the companion controller app or by calling the "Set Control Mode" interface in the "High-Level Motion Service Interfaces" chapter in your program.
Navigation Workflow:
● Robot has no map or map needs changing: Mapping ---> Relocalization Success ---> Create Location ---> Execute Navigation (Location name or Coordinates)
● Robot has current environment map: Relocalization Success ---> Get Locations ---> Create Location (Optional) ---> Execute Navigation (Location name or Coordinates)
Current navigation supports straight-line walking and does not support automatic obstacle avoidance. When creating locations, ensure there are no obstacles on the straight line between two points.
Mapping Interfaces
Python Interface
Optional[Dict] start_mapping(timeout=10.0)
Function Description
Start mapping.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
timeout | int | Default: 5 | Timeout (seconds). |
Return Value
| Type | Description |
|---|---|
Optional[Dict] | Contains operation result. |
Call Example
from daystar_sdk import WebSocketRobotClient
with WebSocketRobotClient(host='localhost', port=5252) as client:
result = await client.start_mapping()Optional[Dict] stop_mapping(map_name, auto_reload=True, timeout=10.0)
Function Description
Stop mapping and save map.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
map_name | str | Required | Name to save the map as. |
auto_reload | bool | Default: True | Whether to automatically load this map after saving. |
timeout | int | Default: 60 | Timeout (seconds). |
Return Value
| Type | Description |
|---|---|
Optional[Dict] | Contains operation result. |
Call Example
from daystar_sdk import WebSocketRobotClient
with WebSocketRobotClient(host='localhost', port=5252) as client:
result = await client.stop_mapping("office_map", auto_reload=True)C# Interface
(bool success, string message) StartMapping(int id = 209, int timeoutMs = 10000)
Function Description
Start mapping task.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
id | int | Default: 210 | Request ID. |
timeoutMs | int | Default: 5000 | Timeout. |
Return Value
| Type | Description |
|---|---|
(bool success, string message) | Operation result. |
Call Example
private RobotSDKManager _robotSDKManager;
private RobotNavigationClient _navigationClient;
_robotSDKManager = RobotSDKManager.Instance;
_navigationClient = _robotSDKManager.CreateRobotNavigationClient();
var result = _navigationClient.StartMapping();
if (result.success)
{
Debug.Log("Start Mapping...");
}(bool success, string message) StopMapping(string mapName, bool autoReload = true, int id = 210, int timeoutMs = 10000)
Function Description
Stop mapping and save.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
mapName | string | Required | Map name. |
autoReload | bool | Default: true | Whether to automatically load this map after saving. |
id | int | Default: 211 | Request ID. |
timeoutMs | int | Default: 60000 | Timeout. |
Return Value
| Type | Description |
|---|---|
(bool success, string message) | Operation result. |
Call Example
private RobotSDKManager _robotSDKManager;
private RobotNavigationClient _navigationClient;
_robotSDKManager = RobotSDKManager.Instance;
_navigationClient = _robotSDKManager.CreateRobotNavigationClient();
var result = _navigationClient.StopMapping("office_v1");
if (result.success)
{
Debug.Log("Map Saved Successful!");
}Java Interface
void StartMapping(String mapName)
Function Description
Start mapping.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
mapName | String | Required | Temporary map name (usually empty or used for identification). |
Call Example
import com.lenovo.daystar_bot_sdk_client.client.SlamNaviClient;
slamNaviClient.StartMapping("");void StopMapping(String mapName, boolean autoReload)
Function Description
Stop mapping.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
mapName | String | Required | Map name to save. |
autoReload | bool | Default: true | Whether to automatically load this map after saving. |
Call Example
import com.lenovo.daystar_bot_sdk_client.client.SlamNaviClient;
slamNaviClient.StopMapping("office_map", true);C++ Interface
CommReply startMapping()
Function Description
Start mapping.
Return Value
| Type | Description |
|---|---|
CommReply | Contains success (bool) and message (string). |
Call Example
Lenovo::Daystar::SDK sdk;
auto &sysb = sdk.getSYSB();
if (sysb.connect()) {
auto reply = sysb.startMapping();
if (reply.success) {
std::cout << "Mapping mode has been started." << std::endl;
}
}CommReply stopMapping(const std::string &map_name, bool auto_reload = true)
Function Description
Stop mapping.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
mapName | String | Required | Map name to save. |
autoReload | bool | Default: true | Whether to automatically load this map after saving. |
Return Value
| Type | Description |
|---|---|
CommReply | Contains success (bool) and message (string). |
Call Example
Lenovo::Daystar::SDK sdk;
auto &sysb = sdk.getSYSB();
if (sysb.connect()) {
auto reply = sysb.stopMapping("office_floor1");
if (reply.success) {
std::cout << "Mapping completed and saved." << std::endl;
}
}ROS2 Interface
Start Mapping
This interface is used to start the robot's mapping mode.
| Service Name | Service Type | Role |
|---|---|---|
/sdk/nav/start_mapping | api_msgs::srv::StartMapping | Server |
Request Structure
| Field Name | Type | Description |
|---|---|---|
| (None) | - | No parameters required. |
Response Structure
| Field Name | Type | Description |
|---|---|---|
success | bool | Whether mapping started successfully. |
message | string | Operation result message. |
Call Example
ros2 service call /sdk/nav/start_mapping api_msgs/srv/StartMapping '{}'Stop Mapping
This interface is used to stop mapping and save the map.
| Service Name | Service Type | Role |
|---|---|---|
/sdk/nav/stop_mapping | api_msgs::srv::StopMapping | Server |
Request Structure
| Field Name | Type | Description |
|---|---|---|
map_name | string | Name to save the map as. |
auto_reload | bool | Whether to automatically load the map after saving. |
need_2d_map | bool | Whether to generate a 2D map. |
block | bool | Whether to block until completion. |
timeout | int32 | Timeout (seconds). |
Response Structure
| Field Name | Type | Description |
|---|---|---|
success | bool | Whether stopping and saving was successful. |
message | string | Operation result message. |
Call Example
ros2 service call /sdk/nav/stop_mapping api_msgs/srv/StopMapping '{map_name: "office_map", auto_reload: true, need_2d_map: false, block: true, timeout: 10}'Map Management Interfaces
Python Interface
Optional[Dict] load_map(map_name, auto_reload=False, timeout=15.0)
Function Description
Load a specific map.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
map_name | str | Required | Map name to load. |
auto_reload | bool | Default: False | Whether to set as the default map (True: auto-load after robot reboot, False: load for current session only) |
timeout | int | Default: 20 | Timeout. |
Return Value
| Type | Description |
|---|---|
Optional[Dict] | Contains success (bool) and message (str). |
Call Example
from daystar_sdk import WebSocketRobotClient
with WebSocketRobotClient(host='localhost', port=5252) as client:
result = await client.load_map("office_map")Optional[Dict] get_map_list(timeout=10.0)
Function Description
Get list of available maps.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
timeout | int | Default: 10 | Timeout. |
Return Value
| Type | Description |
|---|---|
Optional[Dict] | Contains maps list in result (List[str]). |
Call Example
from daystar_sdk import WebSocketRobotClient
with WebSocketRobotClient(host='localhost', port=5252) as client:
res = await client.get_map_list()
print(res.get('map_names', []))bool upload_map(map_name: str, map_data: bytes, progress_callback: Callable = None)
Function Description
Upload map file.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
map_name | str | Required | Map name. |
map_data | bytes | Required | Map file binary data. |
progress_callback | Callable | Default: None | Progress callback (current, total, bytes). |
Return Value
| Type | Description |
|---|---|
bool | Whether upload succeeded. |
Call Example
with open("office.pcd", "rb") as f:
await client.upload_map("office", f.read())Optional[bytes] download_map(map_name: str, progress_callback: Callable = None)
Function Description
Download map file.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
map_name | str | Required | Map name. |
progress_callback | Callable | Default: None | Progress callback. |
Return Value
| Type | Description |
|---|---|
Optional[bytes] | Map data if successful, None otherwise. |
Call Example
data = await client.download_map("office")
if data:
with open("office.pcd", "wb") as f:
f.write(data)C# Interface
(bool success, string message) LoadMap(string mapName, bool autoReload = false, int id = 211, int timeoutMs = 10000)
Function Description
Load a map.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
map_name | str | Required | Map name. |
autoReload | bool | Default: false | Whether to set as the default map (true: auto-load after robot reboot, false: load for current session only) |
id | int | Default: 211 | Request ID (can be ignored). |
timeoutMs | int | Default: 10000 | Timeout. |
Return Value
| Type | Description |
|---|---|
(bool success, string message) | Operation result tuple. |
Call Example
private RobotSDKManager _robotSDKManager;
private RobotNavigationClient _navigationClient;
_robotSDKManager = RobotSDKManager.Instance;
_navigationClient = _robotSDKManager.CreateRobotNavigationClient();
_navigationClient.LoadMap("office_map");(bool success, string[] map_names, string message) GetMapList(int id = 213, int timeoutMs = 10000)
Function Description
Get map list.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
id | int | Default: 213 | Request ID (can be ignored) |
timeoutMs | int | Default: 10000 | Timeout duration |
Return Value
| Type | Description |
|---|---|
(bool success, string[] map_names, string message) | Operation result tuple. |
Call Example
private RobotSDKManager _robotSDKManager;
private RobotNavigationClient _navigationClient;
_robotSDKManager = RobotSDKManager.Instance;
_navigationClient = _robotSDKManager.CreateRobotNavigationClient();
var result = _navigationClient.GetMapList();
if (result.success)
{
foreach(var name in result.map_names) Debug.Log(name);
}(string status, string message) UploadMap(string mapName, byte[] mapData, int requestId = 300, int timeoutMs = 30000)
Function Description
Upload map file.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
mapName | string | Required | Map name. |
mapData | byte[] | Required | Map data. |
requestId | int | Default: 300 | Request ID. |
timeoutMs | int | Default: 30000 | Timeout. |
Return Value
| Type | Description |
|---|---|
(string status, string message) | Operation result ("success" / "error"). |
Call Example
private RobotSDKManager _robotSDKManager;
private RobotNavigationClient _navigationClient;
_robotSDKManager = RobotSDKManager.Instance;
_navigationClient = _robotSDKManager.CreateRobotNavigationClient();
string localMapPath = "Assets/Maps/map.pcd";
byte[] mapData = System.IO.File.ReadAllBytes(localMapPath);
_navigationClient.RegisterUploadProgressCallback(OnUploadProgress);
_navigationClient.UploadMap("office", mapData);
void OnUploadProgress(AssetTransferProgress progress)
{
try
{
string displayText = $"【Upload Progress】\n" +
$"Request ID: {progress.request_id}\n" +
$"Chunk : {progress.completed_chunks}/{progress.total_chunks}\n" +
$"Byte : {FormatBytes(progress.transferred_bytes)}/{FormatBytes(progress.total_bytes)}\n" +
$"Progress: {progress.progress_percentage:F1}%\n" +
$"Status: {progress.status}";
if (progress.is_completed)
{
if (progress.status == "completed")
{
displayText += "\n✓ Upload Success!";
}
else if (progress.status == "failed")
{
displayText += $"\n✗ Upload Failed: {progress.error_message}";
}
}
}
catch (Exception ex)
{
Debug.LogError($"Error in OnUploadProgress: {ex.Message}");
}
}
_navigationClient.UnregisterUploadProgressCallback();void DownloadMap(string mapName, int requestId = 301)
Function Description
Download map file (Result via callback).
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
mapName | string | Required | Map name. |
requestId | int | Default: 301 | Request ID. |
Return Value
| Type | Description |
|---|---|
void | No return value (Must register callback). |
Call Example
private RobotSDKManager _robotSDKManager;
private RobotNavigationClient _navigationClient;
_robotSDKManager = RobotSDKManager.Instance;
_navigationClient = _robotSDKManager.CreateRobotNavigationClient();
_navigationClient.RegisterDownloadProgressCallback(OnDownloadProgress); //Monitor download progress
_navigationClient.DownloadMap("office");
void OnDownloadProgress(AssetTransferProgress progress)
{
try
{
string displayText = $"【Upload Progress】\n" +
$"Request ID: {progress.request_id}\n" +
$"Chunk : {progress.completed_chunks}/{progress.total_chunks}\n" +
$"Byte : {FormatBytes(progress.transferred_bytes)}/{FormatBytes(progress.total_bytes)}\n" +
$"Progress: {progress.progress_percentage:F1}%\n" +
$"Status: {progress.status}";
Debug.Log($"[DownloadProgress] {progressText}");
if (progress.is_completed)
{
if (progress.status == "completed")
{
displayText += "\n✓ Download Success!";
}
else if (progress.status == "failed")
{
displayText += $"\n✗ Download Failed: {progress.error_message}";
}
}
}
catch (Exception ex)
{
Debug.LogError($"Error in OnDownloadProgress: {ex.Message}");
}
}
_navigationClient.UnregisterDownloadProgressCallback();Java Interface
ServiceOperationResponse LoadMap(String mapName, boolean auto_reload)
Function Description
Load a specific map.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
mapName | String | Required | Map name. |
auto_reload | boolean | Required | Whether to auto reload. |
Return Value
| Type | Description |
|---|---|
ServiceOperationResponse | Contains isSuccess() (boolean) and getMessage() (String). |
Call Example
import com.lenovo.daystar_bot_sdk_client.client.SlamNaviClient;
// Load map
slamNaviClient.LoadMap("office_map", true);List<String> GetMapList()
Function Description
Get list of available maps.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
| - | - | - | No parameters. |
Return Value
| Type | Description |
|---|---|
List<String> | List of map names. |
Call Example
import com.lenovo.daystar_bot_sdk_client.client.SlamNaviClient;
import java.util.List;
// Get map list
List<String> maps = slamNaviClient.GetMapList();
for (String map : maps) {
System.out.println("Found map: " + map);
}CompletableFuture<UploadResourceResponse> uploadMap(String mapName, byte[] data, int timeoutSeconds)
Function Description
Upload map file.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
mapName | String | Required | Map name. |
data | byte[] | Required | Map file binary data. |
timeoutSeconds | int | Required | Timeout (seconds). |
Return Value
| Type | Description |
|---|---|
CompletableFuture<UploadResourceResponse> | Async upload result, contains status and message. |
Call Example
import com.lenovo.daystar_bot_sdk_client.client.SlamNaviClient;
import java.nio.file.Files;
import java.nio.file.Paths;
// Upload map
byte[] mapData = Files.readAllBytes(Paths.get("office.pcd"));
slamNaviClient.uploadMap("office", mapData, 30).thenAccept(response -> {
if (response.isSuccess()) {
System.out.println("Upload success");
}
});CompletableFuture<byte[]> downloadMap(String mapName, int timeoutSeconds)
Function Description
Download map file.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
mapName | String | Required | Map name. |
timeoutSeconds | int | Required | Timeout (seconds). |
Return Value
| Type | Description |
|---|---|
CompletableFuture<byte[]> | Async returns map binary data. |
Call Example
import com.lenovo.daystar_bot_sdk_client.client.SlamNaviClient;
import java.nio.file.Files;
import java.nio.file.Paths;
// Download map
slamNaviClient.downloadMap("office", 30).thenAccept(data -> {
if (data != null) {
try {
Files.write(Paths.get("office.pcd"), data);
} catch (Exception e) {
e.printStackTrace();
}
}
});C++ Interface
GetAvailableMapsReply getAvailableMaps()
Function Description
Get the list of all available maps.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
| - | - | - | - |
Return Value
| Type | Description |
|---|---|
GetAvailableMapsReply | Includes a success flag, a message, and a maps list of type std::vectorstd::string. |
Call Example
Lenovo::Daystar::SDK sdk;
auto &sysb = sdk.getSYSB();
if (sysb.connect()) {
auto reply = sysb.getAvailableMaps();
for (const auto &map_name : reply.maps) {
std::cout << "Found map: " << map_name << std::endl;
}
}CommReply loadMap(const std::string &map_name, bool auto_reload = false)
Function Description
Load map.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
map_name | const std::string & | Required | Map name. |
auto_reload | bool | Default: false | Set as default map? (true: auto-load after robot restart; false: load for current session only). |
Return Value
| Type | Description |
|---|---|
CommReply | Includes a success flag, a message. |
Call Example
Lenovo::Daystar::SDK sdk;
if (!sdk.isConnected()) {
std::cerr << "Can not connect SDK server with default settings"
<< std::endl;
return 1;
} else {
std::cout << "Connected with default settings" << std::endl;
}
auto &sysb = sdk.getSYSB();
if (sysb.connect()) {
sysb.loadMap("office_map");
}CommReply uploadMap(const std::string &map_name, const std::vector<uint8_t> &file_data)
Function Description
Upload map file.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
map_name | const std::string & | Required | Map name. |
| file_data | const std::vector<uint_8> & | Required | Map data. |
Return Value
| Type | Description |
|---|---|
CommReply | Includes a success flag, a message. |
Call Example
// C++
Lenovo::Daystar::SDK sdk;
if (!sdk.isConnected()) {
std::cerr << "Can not connect SDK server with default settings"
<< std::endl;
return 1;
} else {
std::cout << "Connected with default settings" << std::endl;
}
auto &sysb = sdk.getSYSB();
std::string name = getStringInput("Please enter the name for the uploaded map file: ");
std::string filepath = getStringInput("Please enter the path of the local map file: ");
// Read file data
std::ifstream file_stream(filepath, std::ios::binary);
if (!file_stream)
{
std::cout << "✗ Failed to open the file: " << filepath << std::endl;
break;
}
std::vector<uint8_t> file_data((std::istreambuf_iterator<char>(file_stream)), std::istreambuf_iterator<char>());
file_stream.close();
auto result = sysb.uploadMap(name, file_data);
if (result.success == true)
{
std::cout << "✓ Map file uploaded successfully: " << name << std::endl;
}
else
{
std::cout << "✗ Map file uploaded failed: " << result.message << std::endl;
}CommReply downloadMap(const std::string &map_name, const std::vector<uint8_t> &file_data)
Function Description
Download map data.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
map_name | const std::string & | Required | Map name. |
| file_data | const std::vector<uint_8> & | Required | Map data. |
Return Value
| Type | Description |
|---|---|
CommReply | Includes a success flag, a message. |
Call Example
// C++
Lenovo::Daystar::SDK sdk;
if (!sdk.isConnected()) {
std::cerr << "Can not connect SDK server with default settings"
<< std::endl;
return 1;
} else {
std::cout << "Connected with default settings" << std::endl;
}
auto &sysb = sdk.getSYSB();
std::string name = getStringInput("Please enter the name of the map file to download: ");
std::vector<uint8_t> file_data;
auto result = sysb.downloadMap(name, file_data);
if (result.success == true)
{
// save map date as .pcd
std::string filename = name;
if (filename.find(".pcd") == std::string::npos) {
filename += ".pcd";
}
std::string download_dir = ensureDownloadDir();
std::string save_path = download_dir + "/" + filename;
std::ofstream out_file(save_path, std::ios::binary);
if (!out_file) {
std::cout << "✗ Failed to create the file: " << save_path << std::endl;
break;
}
out_file.write(reinterpret_cast<const char *>(file_data.data()), file_data.size());
out_file.close();
if (out_file.fail()) {
std::cout << "✗ File write failed: " << save_path << std::endl;
} else {
std::cout << "✓ Map file downloaded successfully" << std::endl;
std::cout << " File size: " << (file_data.size() / 1024.0 / 1024.0) << " MB" << std::endl;
std::cout << " Save to: " << save_path << std::endl;
}
}
else
{
std::cout << "✗ Map file download failed: " << result.message << std::endl;
}ROS2 Interface
Load Map
This interface is used to load a specific map.
| Service Name | Service Type | Role |
|---|---|---|
/sdk/nav/load_map | api_msgs::srv::LoadMap | Server |
Request Structure
| Field Name | Type | Description |
|---|---|---|
map_name | string | Map name. |
auto_reload | bool | Whether to set as default map (true: auto-load on robot restart, false: load for current session only). |
Response Structure
| Field Name | Type | Description |
|---|---|---|
success | bool | Whether loading was successful. |
message | string | Operation result message. |
Call Example
ros2 service call /sdk/nav/load_map api_msgs/srv/LoadMap '{map_name: "office_map", auto_reload: true}'Get Map List
This interface is used to get a list of all available map names on the robot.
| Service Name | Service Type | Role |
|---|---|---|
/sdk/nav/get_available_maps | api_msgs::srv::GetA, location_name="", location_pose=None, timeout=60.0) |
Function Description\ Relocalization.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
auto_relocalization | bool | Required | Whether to auto-relocalize. |
location_name | str | Default: "" | Location name (optional). |
location_pose | Dict | Default: None | Location pose (optional). |
timeout | float | Default: 60.0 | Timeout (seconds) |
| Call Example |
ros2 service call /sdk/nav/get_available_maps api_msgs/srv/GetAvailableMaps '{}'Localization Interfaces
Python Interface
Optional[Dict] get_localization_state()
Function Description
Get localization state.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
| - | - | - | No parameters. |
Return Value
| Type | Description |
|---|---|
Optional[Dict] | Contains the following fields: - success (bool): Whether the acquisition was successful - loc_state (int): Localization state - 0: NORMAL - 1: LACKDATA - 2: LOST |
Call Example
from daystar_sdk.client import RobotClient
# Initialize client
with RobotClient(host='localhost', port=5252) as client:
result = await client.get_localization_state()
if result and result.get('success'):
loc_state = result.get('loc_state')
# ... logic omitted ...
print(f"Localization State: {state_names.get(loc_state, 'Unknown')}")
else:
print(f"Failed to get localization state: {result.get('message') if result else 'Unknown error'}")Optional[Dict] get_current_pose()
Function Description
Get current pose.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
| - | - | - | No parameters. |
Return Value
| Type | Description |
|---|---|
Optional[Dict] | Contains the following fields: - success (bool): Whether the acquisition was successful - message (str): Operation result message - location_pose (Dict): Position and orientation info - position (Dict): Position coordinates {x, y, z} - orientation (Dict): Orientation quaternion |
Call Example
from daystar_sdk.client import RobotClient
# Initialize client
with RobotClient(host='localhost', port=5252) as client:
# Get pose
result = await client.get_current_pose()
if result and result.get('success'):
pose = result.get('location_pose', {})
# ... logic omitted ...
print(f"Current Pose: x={orientation.get('x')}, y={orientation.get('y')}, z={orientation.get('z')}, w={orientation.get('w')}")
else:
print(f"Failed to get pose: {result.get('message') if result else 'Unknown error'}")Optional[Dict] relocalization(auto_relocalization: bool, location_name: str = "", x: float = 0.0, y: float = 0.0, theta: float = 0.0, timeout: int = 20)
Function Description
Manual relocalization interface.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
auto_relocalization | bool | Required | Whether to maintain current estimated pose (True) or use new parameters (False). |
location_name | str | Default: "" | Location name to relocate to (used if auto_relocalization=False). |
x | float | Default: 0.0 | X coordinate (used if location_name is empty). |
y | float | Default: 0.0 | Y coordinate. |
theta | float | Default: 0.0 | Orientation angle. |
timeout | int | Default: 20 | Timeout in seconds. |
Return Value
| Type | Description |
|---|---|
Optional[Dict] | Contains operation result. |
Call Example
# 1. Auto Relocalization (keep current estimate)
await client.relocalization(auto_relocalization=True)
# 2. Relocalize to "Home"
await client.relocalization(auto_relocalization=False, location_name="Home")
# 3. Relocalize to specific coordinates
await client.relocalization(auto_relocalization=False, x=1.5, y=2.0, theta=0.0)C# Interface
(bool success, string message) Relocalization(bool autoRelocation, string locationName = null, PoseData locationPose = null, int id = 212, int timeoutMs = 10000)
Function Description
Relocalization.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
autoRelocation | bool | Required | Whether to auto-relocate. |
locationName | string | Optional | Location name. |
locationPose | PoseData | Optional | Location pose. |
id | int | Default: 212 | Request ID. |
timeoutMs | int | Default: 10000 | Timeout (ms). |
Return Value
| Type | Description |
|---|---|
(bool success, string message) | Operation result tuple. |
Call Example
private RobotSDKManager _robotSDKManager;
private RobotNavigationClient _navigationClient;
_robotSDKManager = RobotSDKManager.Instance;
_navigationClient = _robotSDKManager.CreateRobotNavigationClient();
// Call relocalization
var (success, message) = _navigationClient.Relocalization(true);
if (success)
{
Debug.Log($"✓ Relocalization Successful");
}PoseStamped? GetCurrentPose(int id = 207, int timeoutMs = 5000)
Function Description
Get current robot pose (Sync method).
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
id | int | Default: 207 | Request ID. |
timeoutMs | int | Default: 5000 | Timeout (ms). |
Return Value
| Type | Description |
|---|---|
PoseStamped? | Robot current pose information. Returns null on failure. Contains fields: - header (Header): Message header - stamp (string): Timestamp - frame_id (string): Frame ID - pose (Pose3D): Pose info - position (Point3D): Position {x, y, z} - orientation (Quaternion3D): Orientation |
Call Example
private RobotSDKManager _robotSDKManager;
private RobotNavigationClient _navigationClient;
_robotSDKManager = RobotSDKManager.Instance;
_navigationClient = _robotSDKManager.CreateRobotNavigationClient();
var pose = _navigationClient.GetCurrentPose();
if (pose.HasValue)
{
var position = pose.Value.pose.position;
Debug.Log($"Position: ({position.x}, {position.y}, {position.z})");
}(bool success, int loc_state)? GetLocalizationStateSync(int id = 208, int timeoutMs = 5000)
Function Description
Get localization state (Sync method).
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
id | int | Default: 208 | Request ID. |
timeoutMs | int | Default: 5000 | Timeout (ms). |
Return Value
| Type | Description |
|---|---|
(bool success, int loc_state)? | Localization state tuple, contains success flag and state value. Returns null on failure. loc_state values: - 0: NORMAL - 1: LACKDATA - 2: LOST |
Call Example
private RobotSDKManager _robotSDKManager;
private RobotNavigationClient _navigationClient;
_robotSDKManager = RobotSDKManager.Instance;
_navigationClient = _robotSDKManager.CreateRobotNavigationClient();
var result = _navigationClient.GetLocalizationStateSync(208, 5000);
if (result.HasValue)
{
bool success = result.Value.success;
int locState = result.Value.loc_state;
Debug.Log($"Localization State: {locState}");
}Java Interface
int GetLocalizationState()
Function Description
Get current localization state.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
| - | - | - | No parameters. |
Return Value
| Type | Description |
|---|---|
int | Localization state code. - 0: NORMAL - 1: LACKDATA - 2: LOST |
Call Example
import com.lenovo.daystar_bot_sdk_client.client.SlamNaviClient;
// Get localization state
int state = slamNaviClient.GetLocalizationState();
String stateStr;
switch (state) {
case 0: stateStr = "NORMAL"; break;
case 1: stateStr = "LACKDATA"; break;
case 2: stateStr = "LOST"; break;
default: stateStr = "Unknown(" + state + ")"; break;
}
System.out.println("Localization State: " + stateStr);LocationPose GetCurrentLocationPose()
Function Description
Get robot current pose (structured object form).
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
| - | - | - | No parameters. |
Return Value
| Type | Description |
|---|---|
LocationPose | Current pose object. Contains fields: - position (Point3D): Position coordinates {x, y, z} - orientation (Quaternion3D): Orientation quaternion |
Call Example
import com.lenovo.daystar_bot_sdk_client.client.SlamNaviClient;
import com.lenovo.daystar_bot_sdk_client.DataEntities.LocationPose;
// Get current pose
LocationPose pose = slamNaviClient.GetCurrentLocationPose();
String poseStr = String.format("Position: (%.3f, %.3f, %.3f)\nOrientation: (%.3f, %.3f, %.3f, %.3f)",
pose.position.x, pose.position.y, pose.position.z,
pose.orientation.x, pose.orientation.y, pose.orientation.z, pose.orientation.w);
System.out.println(poseStr);void Relocalization(boolean auto_relocalization, String locationName, LocationPose virtual_pose)
Function Description
Trigger relocalization manually.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
auto_relocalization | boolean | Required | Whether to use auto relocalization (maintain current estimate). |
locationName | String | Required | Target location name (if !auto_relocalization). |
virtual_pose | LocationPose | Required | Target pose structure (if locationName is empty). |
Return Value
| Type | Description |
|---|---|
void | No return value. |
Call Example
// Auto relocalization
slamNaviClient.Relocalization(true, "", null);void AutoRelocalization()
Function Description
Trigger automatic relocalization.
Return Value
| Type | Description |
|---|---|
void | No return value. |
Call Example
import com.lenovo.daystar_bot_sdk_client.client.SlamNaviClient;
slamNaviClient.AutoRelocalization();
System.out.println("Trigger automatic relocalization.");void RelocateWithName(boolean autoRelocalize, String locationName)
Function Description
Relocalize using a named position point.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
autoRelocalize | boolean | Required | Whether to attempt automatic relocalization first. |
locationName | String | Required | Name of the position point. |
Return Value
| Type | Description |
|---|---|
void | No return value. |
Call Example
import com.lenovo.daystar_bot_sdk_client.client.SlamNaviClient;
slamNaviClient.RelocateWithName(true, "home_position");void RelocateWithPosition(boolean autoRelocalize, LocationPose poseData)
Function Description
Relocalize using the specified pose.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
autoRelocalize | boolean | Required | Whether to attempt automatic relocalization first. |
poseData | LocationPose | Required | Target pose (including position and orientation). |
Return Value
| Type | Description |
|---|---|
void | No return value. |
Call Example
import com.lenovo.daystar_bot_sdk_client.client.SlamNaviClient;
import com.lenovo.daystar_bot_sdk_client.DataEntities.LocationPose;
LocationPose pose = new LocationPose(/* args */);
slamNaviClient.RelocateWithPosition(true, pose);C++ Interface
bool getLocalizationState(int &loc_state)
Function Description
Get localization system state.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
loc_state | int & | Required | Returns localization state. |
Return Value
| Type | Description |
|---|---|
bool | true success, false failure. |
Call Example
Lenovo::Daystar::SDK sdk;
auto &sysb = sdk.getSYSB();
if (sysb.connect()) {
int loc_state;
if (sysb.getLocalizationState(loc_state)) {
std::cout << "Localization State: " << loc_state << std::endl;
}
}bool getCurrentPose(Pose ¤t_pose)
Function Description
Get robot current pose.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
current_pose | Pose & | Required | Returns current pose information. |
Return Value
| Type | Description |
|---|---|
bool | true success, false failure. |
Call Example
Lenovo::Daystar::SDK sdk;
auto &sysb = sdk.getSYSB();
if (sysb.connect()) {
Pose current_pose;
if (sysb.getCurrentPose(current_pose)) {
std::cout << "Current Pose: (" << current_pose.position.x << ", " << current_pose.position.y << ", " << current_pose.position.z << ")" << std::endl;
}
}CommReply relocalization(bool auto_relocalization, const std::string &location_name, const Pose &virtual_pose, int timeout = 20)
Function Description
Trigger relocalization.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
auto_relocalization | bool | Required | Auto relocalization flag. |
location_name | const std::string & | Required | Location name target. |
virtual_pose | const Pose & | Required | Coordinate target. |
timeout | int | Default: 20 | Timeout (seconds). |
Return Value
| Type | Description |
|---|---|
CommReply | Contains success (bool) and message (string). |
Call Example
Lenovo::Daystar::SDK sdk;
auto &sysb = sdk.getSYSB();
if (sysb.connect()) {
auto reply = sysb.relocalization(true, "", Pose());
if (reply.success) {
std::cout << "Relocation command has been sent." << std::endl;
}
}ROS2 Interface
GetLocalization State
This interface is used to obtain the current positioning status of the robot.
| Service Name | Service Type | Role |
|---|---|---|
/sdk/nav/get_localization_state | api_msgs::srv::GetLocalizationState | Server |
Response Structure
| Field Name | Type | Description |
|---|---|---|
success | bool | Whether the acquisition is successful |
loc_state | uint8 | Location status code |
message | string | Operation result information |
Location status code
| Value | Description |
|---|---|
0 | NORMAL (Normal positioning) |
1 | LACKDATA (Insufficient data) |
2 | LOST (Positioning lost) |
Call Example
ros2 service call /sdk/nav/get_localization_state api_msgs/srv/GetLocalizationState '{}'Get Current Position
This interface is used to obtain the current coordinate position of the robot on the map (only available when positioning status is normal).
| Service Name | Service Type | Role |
|---|---|---|
/sdk/nav/get_current_pose | api_msgs::srv::GetCurrentPose | Server |
Response Structure
| Field Name | Type | Description |
|---|---|---|
location_pose | geometry_msgs/Pose | Current position and posture of the robot. |
success | bool | Whether the acquisition is successful. |
message | string | Operation result information. |
Call Example
ros2 service call /sdk/nav/get_current_pose api_msgs/srv/GetCurrentPose '{}'Relocalization
This interface is used to trigger robot relocation, allowing automatic relocation or manual position specification.
| Service Name | Service Type | Role |
|---|---|---|
/sdk/nav/set_localization | api_msgs::srv::SetLocalization | Server |
Request Structure
| Field Name | Type | Description |
|---|---|---|
auto_relocation | bool | Whether to relocate automatically (the last two parameters are ignored when true). |
location_name | string | Name of the specified relocation point (optional, pass an empty string). |
location_pose | geometry_msgs/Pose | Coordinates for the specified relocation (optional). |
Response Structure
| Field Name | Type | Description |
|---|---|---|
success | bool | Whether the relocation command was sent successfully. |
message | string | Operation result information. |
Call Example
ros2 service call /sdk/nav/set_localization api_msgs/srv/SetLocalization '{auto_relocation: true, location_name: ""}'Add Navigation Location
Python Interface
Optional[Dict] add_location(location_name: str, use_virtual_pose: bool = False, x: float = 0.0, y: float = 0.0, theta: float = 0.0, timeout: int = 30)
Function Description
Add navigation location.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
location_name | str | Required | Location name. |
use_virtual_pose | bool | Default: False | Whether to use virtual coordinates instead of current robot pose. |
x | float | Default: 0.0 | X coordinate (if use_virtual_pose=True). |
y | float | Default: 0.0 | Y coordinate (if use_virtual_pose=True). |
theta | float | Default: 0.0 | Orientation angle (if use_virtual_pose=True). |
timeout | int | Default: 30 | Timeout in seconds. |
Return Value
| Type | Description |
|---|---|
Optional[Dict] | Contains operation result. |
Call Example
from daystar_sdk import WebSocketRobotClient
# Initialize client
with WebSocketRobotClient(host='localhost', port=5252) as client:
# Add current location
client.add_location("home_position")
# Add virtual location
client.add_location("virtual_point", use_virtual_pose=True, x=1.0, y=2.0)C# Interface
void AddLocation(string locationName, int timeout = 30, int id = 200)
Function Description
Add current pose as a navigation location.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
locationName | string | Required | Location name. |
timeout | int | Default: 30 | Timeout (seconds). |
id | int | Default: 200 | Request ID. |
Return Value
| Type | Description |
|---|---|
void | No return value. |
Call Example
string locationName = $"Location_{System.DateTime.Now:yyyyMMdd_HHmmss}";
var result = _navigationClient.AddLocation(locationName);
if (result.success)
{
Debug.Log($"Successfully added location '{locationName}'");
}(bool success, string message) AddLocation(string locationName, bool useVirtualPose, PoseData virtualPose, int id = 200, int timeoutMs = 30000)
Function Description
Add navigation location (supports virtual pose).
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
locationName | string | Required | Location name. |
useVirtualPose | bool | Required | Use virtual pose flag. |
virtualPose | PoseData | Required | Virtual pose data. |
id | int | Default: 200 | Request ID. |
timeoutMs | int | Default: 30000 | Timeout. |
Return Value
| Type | Description |
|---|---|
(bool success, string message) | Operation result. |
Call Example
var vPose = new PoseData();
_navigationClient.AddLocation("v_point", true, vPose);Java Interface
void AddLocation(String locationName, boolean use_virtual_pose, LocationPose virtual_pose)
Function Description
Add a named location point (waypoint/marker).
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
locationName | String | Required | Location point name. |
use_virtual_pose | boolean | Required | Whether to use virtual pose. Pass false to use current robot pose. |
virtual_pose | LocationPose | Optional | Virtual pose. Must provide when use_virtual_pose is true, otherwise pass null. |
Return Value
| Type | Description |
|---|---|
void | No return value. |
Call Example
import com.lenovo.daystar_bot_sdk_client.client.SlamNaviClient;
// Add current position as navigation location
String locationName = "home_position";
slamNaviClient.AddLocation(locationName, false, null);
System.out.println("✓ Successfully added location: " + locationName);C++ Interface
bool addLocation(const std::string &location_name, int timeout = 30)
Function Description
Add location point.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
location_name | const std::string & | Required | Location name. |
timeout | int | Default: 30 | Timeout (seconds). |
Return Value
| Type | Description |
|---|---|
bool | true success, false failure. |
Call Example
Lenovo::Daystar::SDK sdk;
auto &sysb = sdk.getSYSB();
if (sysb.connect()) {
if (sysb.addLocation("OfficeEntrance", 30)) {
std::cout << "Location 'OfficeEntrance' added successfully" << std::endl;
} else {
std::cerr << "Failed to add location" << std::endl;
}
}bool addLocation(const std::string &location_name, bool use_virtual_pose, const Pose &virtual_pose, int timeout = 30)
Function Description
Add navigation location (virtual pose support).
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
location_name | const std::string & | Required | Location name. |
use_virtual_pose | bool | Required | Use virtual pose flag. |
virtual_pose | const Pose & | Required | Virtual pose data. |
timeout | int | Default: 30 | Timeout. |
Return Value
| Type | Description |
|---|---|
bool | Success flag. |
Call Example
Pose p;
sysb.addLocation("v_pt", true, p);ROS2 Interface
Add Navigation Location
This interface is used to add a navigation location at the robot's current position or at specified virtual coordinates.
| Service Name | Service Type | Role |
|---|---|---|
/sdk/nav/add_location | api_msgs::srv::AddLocation | Server |
Request Structure
| Field Name | Type | Description |
|---|---|---|
location_name | string | Location name. |
timeout | int32 | Timeout (seconds). |
use_virtual_pose | bool | Whether to use virtual coordinates to add the location (uses virtual_pose if true). |
virtual_pose | geometry_msgs/Pose | Virtual location coordinates (effective when use_virtual_pose is true). |
Response Structure
| Field Name | Type | Description |
|---|---|---|
location_pose | geometry_msgs/Pose | The actual saved location coordinates. |
map_name | string | The name of the map it belongs to. |
success | bool | Whether adding was successful. |
message | string | Operation result message. |
Call Example
# Add a location at the current position
ros2 service call /sdk/nav/add_location api_msgs/srv/AddLocation '{location_name: "OfficeEntrance", timeout: 30, use_virtual_pose: false}'
# Add a virtual location
ros2 service call /sdk/nav/add_location api_msgs/srv/AddLocation '{location_name: "VirtualPointA", timeout: 30, use_virtual_pose: true, virtual_pose: {position: {x: 1.0, y: 2.0, z: 0.0}, orientation: {x: 0.0, y: 0.0, z: 0.0, w: 1.0}}}'Delete Location Interfaces
Python Interface
Optional[Dict] delete_location(location_name)
Function Description
Delete navigation location.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
location_name | str | Required | Name of location to delete. |
Return Value
| Type | Description |
|---|---|
Optional[Dict] | Contains the following fields: - success (bool): Whether deleted successfully - message (str): Operation result message |
Call Example
from daystar_sdk import WebSocketRobotClient
# Initialize client
with WebSocketRobotClient(host='localhost', port=5252) as client:
result = client.delete_location("position")C# Interface
(bool success, string message) DeleteLocation(string locationName, int id = 201, int timeoutMs = 5000)
Function Description
Delete specified navigation location.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
locationName | string | Required | Name of location to delete. |
id | int | Default: 201 | Request ID. |
timeoutMs | int | Default: 5000 | Timeout (ms). |
Return Value
| Type | Description |
|---|---|
(bool success, string message) | Operation result tuple. |
Call Example
var result = _navigationClient.DeleteLocation("location_name");
if (result.success)
{
Debug.Log("Delete success");
}Java Interface
void DeleteLocation(String locationName)
Function Description
Delete a named location point.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
locationName | String | Required | Name of location to delete. |
Return Value
| Type | Description |
|---|---|
void | No return value. |
Call Example
import com.lenovo.daystar_bot_sdk_client.client.SlamNaviClient;
// Delete location point
String locationName = "home_position";
slamNaviClient.DeleteLocation(locationName);
System.out.println("✓ Successfully deleted location: " + locationName);C++ Interface
bool deleteLocation(const std::string &location_name)
Function Description
Delete location point.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
location_name | const std::string & | Required | Location name. |
Return Value
| Type | Description |
|---|---|
bool | true success, false failure. |
Call Example
Lenovo::Daystar::SDK sdk;
auto &sysb = sdk.getSYSB();
if (sysb.connect()) {
if (sysb.deleteLocation("OfficeEntrance")) {
std::cout << "Location 'OfficeEntrance' deleted successfully" << std::endl;
} else {
std::cerr << "Failed to delete location" << std::endl;
}
}ROS2 Interface
Delete point
This interface is used to delete the navigation point with the specified name.
| Service Name | Service Type | Role |
|---|---|---|
/sdk/nav/delete_location | api_msgs::srv::DeleteLocation | Server |
Request Structure
| Field Name | Type | Description |
|---|---|---|
location_name | string | Name of the point to be deleted. |
Response Structure
| Field Name | Type | Description |
|---|---|---|
success | bool | Whether deletion is successful |
message | string | Operation result information |
Call Example
ros2 service call /sdk/nav/delete_location api_msgs/srv/DeleteLocation '{location_name: "office_1"}'Get Available Locations Interfaces
Python Interface
Optional[Dict] get_available_locations()
Function Description
Get existing locations.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
| - | - | - | No parameters. |
Return Value
| Type | Description |
|---|---|
Optional[Dict] | Contains the following fields: - location_names (List[str]): List of location names |
Call Example
from daystar_sdk import WebSocketRobotClient
# Initialize client
with WebSocketRobotClient(host='localhost', port=5252) as client:
result = client.get_available_locations()
location_names = result.get('location_names', [])C# Interface
List<string> GetAvailableLocations(int id = 202, int timeoutMs = 5000)
Function Description
Get all available navigation locations (Sync method, returns list directly).
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
id | int | Default: 202 | Request ID. |
timeoutMs | int | Default: 5000 | Timeout (ms). |
Return Value
| Type | Description |
|---|---|
List<string> | List of location names, returns empty list on failure. |
Call Example
var locations = _navigationClient.GetAvailableLocations();
if (locations.Count > 0)
{
foreach (var loc in locations)
{
Debug.Log($"Location: {loc}");
}
}Java Interface
List<String> GetLocationList()
Function Description
Get saved location point name list.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
| - | - | - | No parameters. |
Return Value
| Type | Description |
|---|---|
List<String> | List of location point names. |
Call Example
import com.lenovo.daystar_bot_sdk_client.client.SlamNaviClient;
import java.util.List;
// Get location list
List<String> locations = slamNaviClient.GetLocationList();
System.out.println("✓ Got " + locations.size() + " locations:");
for (String loc : locations) {
System.out.println(" - " + loc);
}LocationListDetails GetLocationListDetails()
Function Description
Get detailed list of saved location points.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
| - | - | - | No parameters. |
Return Value
| Type | Description |
|---|---|
LocationListDetails | Object containing detailed location information. |
Call Example
import com.lenovo.daystar_bot_sdk_client.client.SlamNaviClient;
import com.lenovo.daystar_bot_sdk_client.DataEntities.LocationListDetails;
LocationListDetails details = slamNaviClient.GetLocationListDetails();
// Process details dataC++ Interface
bool getAvailableLocations(std::vector<std::string> &location_names, std::vector<Pose> &location_poses)
Function Description
Get all available location points.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
location_names | std::vector<std::string> & | Required | Returns list of location names. |
location_poses | std::vector<Pose> & | Required | Returns list of location poses. |
Return Value
| Type | Description |
|---|---|
bool | true success, false failure. |
Call Example
Lenovo::Daystar::SDK sdk;
auto &sysb = sdk.getSYSB();
if (sysb.connect()) {
std::vector<std::string> names;
std::vector<Pose> poses;
if (sysb.getAvailableLocations(names, poses)) {
std::cout << "Available Locations:" << std::endl;
# ... logic omitted ...
}
}ROS2 Interface
Get Avaliable Locations
This interface is used to obtain the list of all saved navigation points in the current map.
| Service Name | Service Type | Role |
|---|---|---|
/sdk/nav/get_available_locations | api_msgs::srv::GetAvailableLocations | Server |
Response Structure
| Service Name | Service Type | Role |
|---|---|---|
success | bool | Whether the acquisition is successful |
location_names | string[] | List of point names |
location_poses | geometry_msgs/Pose[] | List of corresponding point coordinates |
message | string | Operation result information |
Call Example
ros2 service call /sdk/nav/get_available_locations api_msgs/srv/GetAvailableLocations '{}'Navigation Control Interfaces
In the navigation control interface, detailed navigation behaviors can be configured via the TravelParams object.
Navigation Parameters Description (MsgTravelParams)
| Parameter Name | Type | Description | Values/Notes |
|---|---|---|---|
speed_mode | int | Speed Mode | 0=UNKNOWN, 1=NORMAL, 2=LOW, 3=HIGH |
distance_tolerance | float | Distance Tolerance | Threshold for goal reached, Unit: meters |
gait | int | Gait Mode | 1=AUTO, 2=TROT, 3=CRAWL, 4=AMBLE, 5=SLOPE, 7=NORMAL_STAIR, etc. |
path_following_mode | int | Path Following Mode | 0=UNKNOWN, 1=DEFAULT, 2=OFF (Free Nav), 3=AUTO, 4=STRICT |
direction_constraint | int | Direction Constraint | 1=NONE, 2=NO_TURN, 3=FORWARD, 4=REVERSE |
ignore_final_yaw | bool | Ignore Final Yaw | true=Ignore, false=Match |
disable_body_obstacle_avoidance | bool | Disable Obstacle Avoidance | true=Disable, false=Enable |
Python Interface
Optional[Dict] navigate_to_location(location_name, timeout=60, travel_params=None)
Function Description
Navigate to preset location. Can specify detailed navigation parameters via travel_params.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
location_name | str | Required | Target location name. |
timeout | int | Default: 60 | Navigation timeout in seconds. |
travel_params | MsgTravelParams | Default: None | Navigation parameters object (from daystar_api import MsgTravelParams). |
Return Value
| Type | Description |
|---|---|
Optional[Dict] | Contains the following fields: - success (bool): Whether started successfully - message (str): Operation result message |
Call Example
from daystar_sdk import WebSocketRobotClient
from daystar_api import MsgTravelParams
# Initialize client
with WebSocketRobotClient(host='localhost', port=5252) as client:
# Default navigation
client.navigate_to_location("home_position")
# Navigation with parameters
params = MsgTravelParams()
params.speed_mode = 2 # LOW
client.navigate_to_location("office", timeout=30, travel_params=params)Optional[Dict] navigate_to_xyz(x, y, z, timeout=60, frame_id="map", travel_params=None)
Function Description
Navigate to specified coordinates.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
x | float | Required | x coordinate. |
y | float | Required | y coordinate. |
z | float | Required | z coordinate. |
timeout | int | Default: 60 | Navigation timeout in seconds. |
frame_id | str | Default: "map" | Frame ID. |
travel_params | MsgTravelParams | Default: None | Navigation parameters object. |
Return Value
| Type | Description |
|---|---|
Optional[Dict] | Contains the following fields: - success (bool): Whether started successfully - message (str): Operation result message |
Call Example
from daystar_sdk import WebSocketRobotClient
from daystar_api import MsgTravelParams
# Initialize client
with WebSocketRobotClient(host='localhost', port=5252) as client:
params = MsgTravelParams()
params.path_following_mode = 2 # OFF (Free Nav)
client.navigate_to_xyz(x=5.0, y=3.0, z=0.0, timeout=30, travel_params=params)C# Interface
void NavigateToLocation(string locationName, TravelParams travelParams, int timeout = 60, int id = 203)
Function Description
Navigate to preset location point (with detailed parameters).
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
locationName | string | Required | Target location name. |
travelParams | TravelParams | Required | Navigation parameters object. |
timeout | int | Default: 60 | Navigation timeout (seconds). |
id | int | Default: 203 | Request ID. |
Return Value
| Type | Description |
|---|---|
void | No return value. |
Call Example
var params = new TravelParams();
params.speed_mode = 2; // Low speed
_navigationClient.NavigateToLocation("location_name", params);void NavigateToPosition(float x, float y, float z, TravelParams travelParams, int timeout = 60, string frameId = "map", int id = 205)
Function Description
Navigate to specified coordinate position (with detailed parameters).
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
x, y, z | float | Required | Target coordinates. |
travelParams | TravelParams | Required | Navigation parameters object. |
timeout | int | Default: 60 | Navigation timeout. |
frameId | string | Default: "map" | Frame ID. |
id | int | Default: 205 | Request ID. |
Return Value
| Type | Description |
|---|---|
void | No return value. |
Call Example
var params = new TravelParams();
params.path_following_mode = 1; // Default
_navigationClient.NavigateToPosition(1.0f, 0.0f, 0.0f, params);void NavigateToLocation(string locationName, int timeout = 60, int id = 203)
Function Description
Navigate to preset location point.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
locationName | string | Required | Target location name. |
timeout | int | Default: 60 | Navigation timeout (seconds). |
id | int | Default: 203 | Request ID. |
Return Value
| Type | Description |
|---|---|
void | No return value. |
Call Example
_navigationClient.NavigateToLocation("location_name");void NavigateToPosition(float x, float y, float z, int timeout = 60, string frameId = "map", int id = 205)
Function Description
Navigate to specified coordinate position (XYZ).
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
x | float | Required | x coordinate. |
y | float | Required | y coordinate. |
z | float | Required | z coordinate. |
timeout | int | Default: 60 | Navigation timeout (seconds). |
frameId | string | Default: "map" | Frame ID. |
id | int | Default: 205 | Request ID. |
Return Value
| Type | Description |
|---|---|
void | No return value. |
Call Example
_navigationClient.NavigateToPosition(1.0f, 0.0f, 0.0f);Java Interface
void NavigateToLocation(String locationName, Optional<MsgTravelParams> params, int timeout)
Function Description
Navigate to specified named location point.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
locationName | String | Required | Target location point name. |
params | Optional<MsgTravelParams> | Required | Navigation parameter configuration. Pass Optional.empty() for default parameters. |
timeout | int | Required | Navigation timeout (unit: seconds). |
Return Value
| Type | Description |
|---|---|
void | No return value. |
Call Example
import com.lenovo.daystar_bot_sdk_client.client.SlamNaviClient;
import java.util.Optional;
// Navigate to location
String locationName = "home_position";
int timeout = 60;
slamNaviClient.NavigateToLocation(locationName, Optional.empty(), timeout);
System.out.println("✓ Started navigation to location: " + locationName);void NavigateToPosition(LocationPose pose, Optional<MsgTravelParams> params, int timeout, String frameId)
Function Description
Navigate to specified coordinate pose.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
pose | LocationPose | Required | Target pose. |
params | Optional <MsgTravelParams> | Required | Navigation parameters. |
timeout | int | Required | Navigation timeout (unit: seconds). |
frameId | String | Required | Frame ID (e.g., "map") |
Return Value
| Type | Description |
|---|---|
void | No return value. |
Call Example
import com.lenovo.daystar_bot_sdk_client.client.SlamNaviClient;
import com.lenovo.daystar_bot_sdk_client.DataEntities.*;
import java.util.Optional;
// Navigate to coordinate position
LocationPose pose = new LocationPose(
new Point3D(1.0f, 0.0f, 0.0f),
new Quaternion3D(0.0f, 0.0f, 0.0f, 1.0f)
);
slamNaviClient.NavigateToPosition(pose, Optional.empty(), 60, "map");
System.out.println("✓ Started navigation to coordinates: (1.0, 0.0, 0.0)");void NavigateViaPoses(List<PoseStamped> exec_waypoints, Optional<MsgTravelParams> params, int execType)
Function Description
Navigate via a sequence of poses (Path Navigation).
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
exec_waypoints | List<PoseStamped> | Required | List of waypoints. |
params | Optional<MsgTravelParams> | Required | Navigation parameters. |
execType | int | Required | Execution type. |
Return Value
| Type | Description |
|---|---|
void | No return value. |
Call Example
import com.lenovo.daystar_bot_sdk_client.client.SlamNaviClient;
import java.util.Collections;
import java.util.Optional;
// Path navigation example
slamNaviClient.NavigateViaPoses(Collections.emptyList(), Optional.empty(), 0);C++ Interface
bool navigateToLocation(const std::string &location_name, int timeout = 60, const MsgTravelParams& travel_params = MsgTravelParams())
Function Description
Navigate to specified location point.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
location_name | const std::string & | Required | Target location name. |
timeout | int | Default: 60 | Timeout (seconds). |
travel_params | const MsgTravelParams & | Default: Default ctor | Navigation parameters object. |
Return Value
| Type | Description |
|---|---|
bool | true success, false failure. |
Call Example
Lenovo::Daystar::SDK sdk;
auto &sysb = sdk.getSYSB();
// Default navigation
if (sysb.connect()) {
if (sysb.navigateToLocation("OfficeEntrance", 60)) {
std::cout << "Started navigation to 'OfficeEntrance'" << std::endl;
}
}
// Navigation with parameters
if (sysb.connect()) {
MsgTravelParams params;
params.speed_mode.value = 2; // LOW
sysb.navigateToLocation("MeetingRoom", 60, params);
}bool navigateToPosition(const PoseStamped &target_pose, int timeout = 60, const MsgTravelParams& travel_params = MsgTravelParams())
Function Description
Navigate to specified pose.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
target_pose | const PoseStamped & | Required | Target pose. |
timeout | int | Default: 60 | Timeout (seconds). |
travel_params | const MsgTravelParams & | Default: Default ctor | Navigation parameters object. |
Return Value
| Type | Description |
|---|---|
bool | true success, false failure. |
Call Example
Lenovo::Daystar::SDK sdk;
auto &sysb = sdk.getSYSB();
if (sysb.connect()) {
// Create target pose
auto target_pose = sysb.createPose(5.0f, 3.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, "map");
// Navigation with parameters
MsgTravelParams params;
params.ignore_final_yaw = true;
sysb.navigateToPosition(target_pose, 60, params);
}ROS2 Interface
Navigate to the specified point.
This interface is used to control the robot to navigate to a saved named point.
| Service Name | Service Type | Role |
|---|---|---|
/sdk/nav/navigate_to_location | api_msgs::srv::NavigateToLocation | Server |
Request Structure
| Field Name | Type | Description |
|---|---|---|
location_name | string | Target point name. |
travel_params | api_msgs/TravelParams | Navigation parameters (optional, default values are used if not filled). |
timeout | int32 | Timeout duration (seconds). |
Response Structure
| Field Name | Type | Description |
|---|---|---|
success | bool | Whether navigation is completed successfully. |
message | string | Operation result information. |
Call Example
ros2 service call /sdk/nav/navigate_to_location api_msgs/srv/NavigateToLocation '{location_name: "office_1", timeout: 60}'Navigate to Specified Coordinates
Navigate to Specified Coordinates This interface is used to control the robot to navigate to the specified coordinate position on the map.
| Service Name | Service Type | Role |
|---|---|---|
/sdk/nav/navigate_to_position | api_msgs::srv::NavigateToPosition | Server |
Request Structure
| Field Name | Type | Description |
|---|---|---|
target_pose | geometry_msgs/PoseStamped | Target position and posture (including frame_id). |
travel_params | api_msgs/TravelParams | Navigation parameters (optional; default values apply if not provided). |
timeout | int32 | Timeout (seconds). |
Response Structure
| Field Name | Type | Description |
|---|---|---|
success | bool | Whether navigation is completed successfully. |
message | string | Operation result information. |
Call Example
ros2 service call /sdk/nav/navigate_to_position api_msgs/srv/NavigateToPosition '{target_pose: {header: {frame_id: "map"}, pose: {position: {x: 5.0, y: 3.0, z: 0.0}, orientation: {x: 0.0, y: 0.0, z: 0.0, w: 1.0}}}, timeout: 60}'Multi-waypoint navigation
This interface is used to control the robot to complete navigation by passing through multiple waypoints in sequence.
| Service Name | Service Type | Role |
|---|---|---|
/sdk/nav/navigation_via_poses | api_msgs::srv::NavigationViaPoses | Server |
Request Structure
| Field Name | Type | Description |
|---|---|---|
exec_waypoints | geometry_msgs/PoseStamped[] | Waypoint list (executed in sequence). |
exec_type | uint8 | Execution mode. |
travel_params | api_msgs/TravelParams | Navigation parameters (optional, default values are used if not provided). |
exec_type value
| Value | Description |
|---|---|
1 | AUTONOMOUS |
2 | STRICTTRACK |
3 | FITTING_STRAIGHT |
4 | FITTING_CIRCULAR |
5 | FITTING_SINE |
Response Structure
| Field Name | Type | Description |
|---|---|---|
success | bool | Whether navigation is completed successfully. |
message | string | Operation result information. |
Call Example
ros2 service call /sdk/nav/navigation_via_poses api_msgs/srv/NavigationViaPoses '{exec_type: 1, exec_waypoints: [{header: {frame_id: "map"}, pose: {position: {x: 1.0, y: 0.0, z: 0.0}, orientation: {w: 1.0}}}]}'Cancel Navigation Control
Python Interface
Optional[Dict] cancel_navigation(task_id="")
Function Description
Cancel navigation control.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
task_id | str | Default: "" | Task ID, empty string indicates cancelling the current task. |
Return Value
| Type | Description |
|---|---|
Optional[Dict] | Contains the following fields: - success (bool): Whether cancelled successfully - message (str): Operation result message |
Call Example
from daystar_sdk import WebSocketRobotClient
# Initialize client
with WebSocketRobotClient(host='localhost', port=5252) as client:
result = await client.cancel_navigation()
if result and result.get('success'):
print(f"Navigation cancelled successfully: {result.get('message')}")
else:
print(f"Failed to cancel navigation: {result.get('message') if result else 'Unknown error'}")C# Interface
void CancelNavigation(string taskId = "", int id = 206)
Function Description
Cancel current navigation task.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
taskId | string | Default: "" | Task ID, empty string indicates cancelling the current task. |
id | int | Default: 206 | Request ID. |
Return Value
| Type | Description |
|---|---|
void | No return value. |
Call Example
_navigationClient.CancelNavigation();Java Interface
void CancelNavigation(String taskId)
Function Description
Cancel navigation task.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
taskId | String | Required | Task ID. Pass empty string "" to cancel current task. |
Return Value
| Type | Description |
|---|---|
void | No return value. |
Call Example
import com.lenovo.daystar_bot_sdk_client.client.SlamNaviClient;
// Cancel current navigation task
slamNaviClient.CancelNavigation("");
System.out.println("✓ Cancel navigation command sent");C++ Interface
bool cancelNavigation(const std::string &task_id = "")
Function Description
Cancel current navigation task.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
task_id | const std::string & | Default: "" | Task ID (empty string indicates cancelling the current task). |
Return Value
| Type | Description |
|---|---|
bool | true success, false failure. |
Call Example
Lenovo::Daystar::SDK sdk;
auto &sysb = sdk.getSYSB();
if (sysb.connect()) {
// Start navigation
sysb.navigateToLocation("OfficeEntrance");
// ... logic omitted ...
}
}ROS2 Interface
Cancel Naviagtion
This interface is used to cancel the currently executing navigation task.
| Service Name | Service Type | Role |
|---|---|---|
/sdk/nav/cancel_navigation | api_msgs::srv::CancelNavigation | Server |
Request Structure
| Field Name | Type | Description |
|---|---|---|
task_id | string | Task ID (An empty string indicates canceling the current task). |
Response Structure
| Field Name | Type | Description |
|---|---|---|
success | bool | Whether the cancellation is successful. |
message | string | Operation result information. |
Call Example
ros2 service call /sdk/nav/cancel_navigation api_msgs/srv/CancelNavigation '{task_id: ""}'Get Navigation Events Interfaces
Python Interface
bool register_navigation_result(callback)
Function Description
Register navigation result event callback.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
callback | function | Required | Callback function, must receive 2 arguments: - result_type (str): Result type ("complete" |
Return Value
| Type | Description |
|---|---|
bool | Returns True on success, False on failure. |
Event Data Example
{
"location_name": "Target Point A",
// ... logic omitted ...
"task_id": "nav_task_001"
}Call Example
from daystar_sdk import WebSocketRobotClient
# Initialize client
with WebSocketRobotClient(host='localhost', port=5252) as client:
# Define navigation result callback
# ... logic omitted ...
success = await client.register_navigation_result(on_navigation_result)bool unregister_navigation_result()
Function Description
Unregister navigation result callback.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
| - | - | - | No parameters. |
Return Value
| Type | Description |
|---|---|
bool | Returns True on success, False on failure. |
bool register_navigation_feedback(callback)
Function Description
Register navigation feedback status callback.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
callback | function | Required | Callback function, receives 1 argument: - data (Dict): Navigation feedback data |
Return Value
| Type | Description |
|---|---|
bool | Returns True on success, False on failure. |
Feedback Data Example
{
"status": "navigating",
// ... logic omitted ...
"timestamp": 1693632001.456
}Status Type Description
navigating: Navigatingpaused: Navigation pausedidle: Idleplanning: Path planningrecovering: Recovering
Call Example
from daystar_sdk import WebSocketRobotClient
# Initialize client
with WebSocketRobotClient(host='localhost', port=5252) as client:
# Define navigation feedback callback
# ... logic omitted ...
success = await client.register_navigation_feedback(on_navigation_feedback)bool unregister_navigation_feedback()
Function Description
Unregister navigation feedback callback.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
| - | - | - | No parameters. |
Return Value
| Type | Description |
|---|---|
bool | Returns True on success, False on failure. |
C# Interface
bool RegisterNavigationResultCallback(Action<string, object> callback)
Function Description
Register navigation result event callback.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
callback | Action<string, object> | Required | Callback function, receives 2 arguments: - result (string): Result type (e.g. "complete", "failed") - data (object): Event data |
Return Value
| Type | Description |
|---|---|
bool | Returns true on success, false on failure. |
Call Example
_navigationClient.RegisterNavigationResultCallback((result, data) =>
{
Debug.Log($"Navigation Result: {result}, Data: {data}");
});bool UnregisterNavigationResultCallback()
Function Description
Unregister navigation result callback.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
| - | - | - | No parameters. |
Return Value
| Type | Description |
|---|---|
bool | Returns true on success, false on failure. |
Call Example
_navigationClient.UnregisterNavigationResultCallback();bool RegisterNavigationFeedbackCallback(Action<object> callback)
Function Description
Register navigation feedback status callback.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
callback | Action<object> | Required | Callback function, receives 1 argument: - feedback (object): Navigation feedback data |
Return Value
| Type | Description |
|---|---|
bool | Returns true on success, false on failure. |
Call Example
_navigationClient.RegisterNavigationFeedbackCallback((feedback) =>
{
if (feedback is string jsonString)
// ... logic omitted ...
}
});bool UnregisterNavigationFeedbackCallback()
Function Description
Unregister navigation feedback callback.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
| - | - | - | No parameters. |
Return Value
| Type | Description |
|---|---|
bool | Returns true on success, false on failure. |
Call Example
_navigationClient.UnregisterNavigationFeedbackCallback();Java Interface
void RegisterNavigationResultCallback(ServiceHandler<NavCompleteRequest, NavCompleteResponse> onComplete, ServiceHandler<NavFailedRequest, NavFailedResponse> onFailed)
Function Description
Register navigation result callback.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
onComplete | ServiceHandler<NavCompleteRequest, NavCompleteResponse> | Required | Navigation completion callback handler. |
onFailed | ServiceHandler<NavFailedRequest, NavFailedResponse> | Required | Navigation failure callback handler. |
Return Value
| Type | Description |
|---|---|
void | No return value. |
Call Example
import com.lenovo.daystar_bot_sdk_client.client.SlamNaviClient;
import com.lenovo.daystar_bot_sdk_client.DataEntities.*;
// Register navigation result callback
slamNaviClient.RegisterNavigationResultCallback(
// Navigation complete callback
(request, response) -> {
System.out.println("✓ Navigation complete: " + request.location_name);
return response;
},
// Navigation failed callback
(request, response) -> {
System.out.println("✗ Navigation failed: " + request.message);
return response;
}
);void RegisterNarrowRoadInfo(Consumer<NarrowRoadInfo> callback)
Function Description
Register narrow road intelligence info callback.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
callback | Consumer<NarrowRoadInfo> | Required | Narrow road info callback. |
Return Value
| Type | Description |
|---|---|
void | No return value. |
void UnregisterNarrowRoadInfo()
Function Description
Unregister narrow road intelligence info callback.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
| - | - | - | No parameters. |
Return Value
| Type | Description |
|---|---|
void | No return value. |
void RegisterNavigationFeedbackCallback(Consumer<NavigationFeedback> callback)
Function Description
Register navigation process feedback callback.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
callback | Consumer<NavigationFeedback> | Required | Feedback callback. Receives real-time status and progress information during navigation execution. |
Return Value
| Type | Description |
|---|---|
void | No return value. |
Call Example
import com.lenovo.daystar_bot_sdk_client.client.SlamNaviClient;
import com.lenovo.daystar_bot_sdk_client.DataEntities.NavigationFeedback;
// Register navigation feedback callback
slamNaviClient.RegisterNavigationFeedbackCallback(feedback -> {
System.out.println("Navigation status: " + feedback.status);
System.out.println("Navigation progress: " + (feedback.progress * 100) + "%");
});C++ Interface
void setNavigationResultCallback(std::function<void(const std::string &, const std::string &)> callback)
Function Description
Set navigation result callback.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
callback | std::function<void(const std::string &, const std::string &)> | Required | Callback function, receives 2 arguments: - task_id (std::string): Task ID - result (std::string): Navigation result data (JSON string) |
Return Value
| Type | Description |
|---|---|
void | No return value. |
bool registerNavigationResult()
Function Description
Register navigation result event.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
| - | - | - | No parameters. |
Return Value
| Type | Description |
|---|---|
bool | Returns true on success, otherwise false. |
Call Example
Lenovo::Daystar::SDK sdk;
auto &sysb = sdk.getSYSB();
// Set navigation result callback
sysb.setNavigationResultCallback([](const std::string &task_id, const std::string &result) {
std::cout << "Navigation task " << task_id << " result: " << result << std::endl;
});
if (sysb.connect()) {
sysb.registerNavigationResult();
sysb.navigateToLocation("OfficeEntrance");
}void setNavigationFeedbackCallback(std::function<void(const std::string &)> callback)
Function Description
Set navigation feedback callback.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
callback | std::function<void(const std::string &)> | Required | Callback function, receives 1 argument: - feedback (std::string): Navigation feedback data (JSON string) |
Return Value
| Type | Description |
|---|---|
void | No return value. |
bool registerNavigationFeedback()
Function Description
Register navigation feedback event.
Parameter Description
| Parameter Name | Type | Required/Default | Description |
|---|---|---|---|
| - | - | - | No parameters. |
Return Value
| Type | Description |
|---|---|
bool | Returns true on success, otherwise false. |
Call Example
Lenovo::Daystar::SDK sdk;
auto &sysb = sdk.getSYSB();
// Set navigation feedback callback
sysb.setNavigationFeedbackCallback([](const std::string &feedback) {
std::cout << "Navigation feedback: " << feedback << std::endl;
});
if (sysb.connect()) {
sysb.registerNavigationFeedback();
sysb.navigateToLocation("OfficeEntrance");
}ROS2 Interface
Navigation Process Feedback
This interface is used to subscribe to real-time progress information during navigation.
| Topic Name | Topic Type | Role |
|---|---|---|
/sdk/nav/feedback | api_msgs::msg::NavigationFeedback | Publisher |
Message Structure
| Field Name | Type | Description |
|---|---|---|
task_id | string | Current navigation task ID. |
target_location | string | Target point name. |
current_pose | geometry_msgs/Pose | Current position of the robot. |
distance_remaining | float32 | Remaining distance (meters). |
navigation_time | int32 | Elapsed navigation time (seconds). |
time_remaining | int32 | Estimated remaining time (seconds). |
timestamp | string | Timestamp. |
current_state | uint8 | Current navigation status code. |
current_state
| Value | Description |
|---|---|
0 | UNKNOWN |
1 | STRAIGHT_LINE_NAV |
2 | WAITING |
3 | AUTO_PLANNING_NAV |
Call Example
ros2 topic echo /sdk/nav/feedbackNavigation Completion Event
When navigation is successfully completed, the SDK service node will invoke this service to notify the upper-layer application. The upper-layer application shall implement the server of this service to receive the navigation completion event.
| Service Name | Service Type | Role |
|---|---|---|
/sdk/nav/nav_complete_event | api_msgs::srv::NavCompleteEvent | Client (invoked by the SDK) |
Request Structure
| Field Name | Type | Description |
|---|---|---|
task_id | string | Navigation task ID. |
target_location | string | Target point name. |
current_pose | geometry_msgs/Pose | Robot position upon completion. |
navigation_time | int8 | Time elapsed for navigation (seconds). |
timestamp | string | Completion timestamp. |
Response Structure
| Field Name | Type | Description |
|---|---|---|
success | bool | Whether received and processed. |
message | string | Processing result information. |
Navigation Failure Event
When navigation fails, the SDK service node will invoke this service to notify the upper-layer application. The upper-layer application shall implement the server of this service to receive the navigation failure event.
| Service Name | Service Type | Role |
|---|---|---|
/sdk/nav/nav_failed_event | api_msgs::srv::NavFailedEvent | Client (invoked by the SDK) |
Request Structure
| Field Name | Type | Description |
|---|---|---|
task_id | string | Navigation task ID. |
error_type | int8 | Error type code. |
error_msg | string | Error description. |
current_pose | geometry_msgs/Pose | Robot position on failure. |
timestamp | string | Failure timestamp. |
target_location | string | Target point name. |
Response Structure
| Field Name | Type | Description |
|---|---|---|
success | bool | Whether received and processed. |
message | string | Processing result information. |