Description

The data plane communication APIs are real-time communication programming interfaces agreed upon by the service and basic platforms. They can restrict your real-time programming models by specifying the usage standards for these APIs. These restrictions help implement a basic real-time communication framework, aiming to guide service code to meet the real-time requirements of a robot system seamlessly.

This chapter provides an overview of the APIs in the data plane subsystem of the basic platform, covering communication APIs, timers, and configuration management of the system software. These resources are designed to help you develop robot service applications more quickly and efficiently.

The APIs provided in this version are for trial use and will be changed in later versions. They cannot be used in commercial products.

Table 1 Overview of key APIs

API Category

Key API

Description

Header File

Library Dependency

Initialization/Exit/Scheduling APIs

OpenHiva::Init

Initializes framework resources, such as nodes and thread groups.

Robot Middleware installation directory/robotmiddleware/sdk/include/hiva/cm/open/init.h

Robot Middleware installation directory/robotmiddleware/sdk/lib/hiva/cm/libHivaOpen.so

OpenHiva::Ready

Checks the OpenHiva framework status.

OpenHiva::Shutdown

Terminates the framework and releases resources.

OpenHiva::WaitForShutdown

This interface is invoked in blocking mode to prevent the main thread from exiting in advance. Resources are released before the framework exits.

OpenHiva::SpinOnce

Schedules the group specified by groupName. The subscribed topic is scheduled to process messages in the specified group.

OpenHiva::Node

OpenHiva::Node

This interface is a constructor and is used to initialize a node.

Robot Middleware installation directory/robotmiddleware/sdk/include/hiva/cm/open/node.h

OpenHiva::Node::CreatePublisher

Creates a publisher.

OpenHiva::Node::CreateSubscriber

Creates a subscriber.

OpenHiva::Node::CreateServer

Creates a server for Service.

OpenHiva::Node::CreateClient

Creates a client for Service.

OpenHiva::Node::Ready

Checks whether Node is shut down.

OpenHiva::Node::GetName

Obtains the Node name.

OpenHiva::Node::GetNameSpace

Obtains the Node name space.

OpenHiva::TopicOptions

OpenHiva::TopicOptions::BuildShmOptions

Sets the size and number of memory blocks allocated for SHM or DSF communication.

Robot Middleware installation directory/robotmiddleware/sdk/include/hiva/cm/open/topic_options.h

OpenHiva::TopicOptions::BuildQueueOptions

Sets queue parameters for DSF communication.

OpenHiva::TopicOptions::BuildGroupName

Sets groupName to which Topic belongs.

OpenHiva::TopicOptions::BuildTransportOptions

Sets the communication mode of Topic.

OpenHiva::TopicOptions::BuildDDSQos

Sets the QoS policy for DDS communication corresponding to Topic.

OpenHiva::Publisher

OpenHiva::Publisher::Publisher

Default constructor of the publishing end.

Robot Middleware installation directory/robotmiddleware/sdk/include/hiva/cm/open/publisher.h

OpenHiva::Publisher::Publish

Publishes messages.

OpenHiva::Publisher::Ready

Checks whether Publisher is working.

OpenHiva::Subscriber

OpenHiva::Subscriber::Subscriber

Default constructor of the subscription end.

Robot Middleware installation directory/robotmiddleware/sdk/include/hiva/cm/open/subscriber.h

OpenHiva::Subscriber::Ready

Checks whether Subscriber is working.

OpenHiva::Subscriber::StartReadMessage

Starts to receive messages.

OpenHiva::Subscriber::StopReadMessage

Stops receiving messages.

OpenHiva::ServiceServer

OpenHiva::ServiceServer::Enable

Enables a server.

Robot Middleware installation directory/robotmiddleware/sdk/include/hiva/cm/open/service_server.h

OpenHiva::ServiceServer::Disable

Disables a server.

OpenHiva::ServiceServer::Destroy

Releases the resources allocated by OpenHiva::Node::CreateServer.

OpenHiva::ServiceClient

OpenHiva::ServiceClient::InvokeService

The client sends requests to the server.

Robot Middleware installation directory/robotmiddleware/sdk/include/hiva/cm/open/service_client.h

OpenHiva::ServiceClient::Destroy

Releases the resources allocated by OpenHiva::Node::CreateClient.

NnEngine

Hiva::CreateNnEngine

Creates an NN engine.

Robot Middleware installation directory/robotmiddleware/sdk/include/hiva/cm/inner_topic/hiva_nn_topic.h

Robot Middleware installation directory/robotmiddleware/sdk/lib/hiva/cm/libHivaNnengine.so

Hiva::DestroyNnEngine

Destroys an NN engine.

Timer

Hiva::CreateTimer

Creates a timer.

Robot Middleware installation directory/robotmiddleware/sdk/include/hiva/cm/hiva_timer/timer.h

Robot Middleware installation directory/robotmiddleware/sdk/lib/hiva/cm/libHivaTimer.so

Hiva::Timer::Start

Starts a timer.

Hiva::Timer::IsValid

Checks whether a timer is valid.

Hiva::Timer::SetPeriod

Sets the timer period.

Hiva::Timer::Stop

Stops a timer.

Hiva::CreateWallTimer

Creates a WallTimer.

Robot Middleware installation directory/robotmiddleware/sdk/include/hiva/cm/hiva_timer/wall_timer.h

Hiva::WallTimer::Start

Starts a WallTimer.

Hiva::WallTimer::IsValid

Checks whether a WallTimer is valid.

Hiva::WallTimer::SetPeriod

Sets the WallTimer period.

Hiva::WallTimer::Stop

Stops a WallTimer.

Hiva::CreateSteadyTimer

Creates a SteadyTimer.

Robot Middleware installation directory/robotmiddleware/sdk/include/hiva/cm/hiva_timer/steady_timer.h

Hiva::SteadyTimer::Start

Starts a SteadyTimer.

Hiva::SteadyTimer::IsValid

Checks whether a SteadyTimer is valid.

Hiva::SteadyTimer::SetPeriod

Resets the SteadyTimer period.

Hiva::SteadyTimer::Stop

Stops a SteadyTimer.

Configuration management

CfgMgr::BatchReset

Deletes persistent data in batches.

Robot Middleware installation directory/robotmiddleware/sdk/include/hiva/cm/cfgmgr/param.h

Robot Middleware installation directory/robotmiddleware/sdk/lib/hiva/cm/libcfgmgr_client.so

CfgMgr::CancelMonitor

Cancels a check.

CfgMgr::CleanStartConfig

Clears the data of a specified startup description file.

CfgMgr::CreateSnapshot

Configuration parameter snapshot, which records all persistent parameters.

CfgMgr::CreateSnapshotToFile

Specifies a snapshot path for snapshot creation.

CfgMgr::DeleteSnapshot

Deletes snapshot files.

CfgMgr::Get

Reads configuration parameters.

CfgMgr::GetAllStartConfig

Obtains all current startup description files.

CfgMgr::GetAllSnapshot

Obtains the names of all snapshot files and the corresponding startup description files.

CfgMgr::GetStartConfig

Obtains the startup description file that is being used.

CfgMgr::Has

Checks whether a parameter exists.

CfgMgr::Load

Loads parameters based on the YAML file and makes the parameters persistent.

CfgMgr::Monitor

Monitors the specified parameter.

CfgMgr::Param

Obtains parameters.

CfgMgr::Reload

Reloads the YAML file.

CfgMgr::Reset

Deletes persistent data.

CfgMgr::RevertSnapshot

Restores a snapshot file by name.

CfgMgr::RevertSnapshotFromFile

Restores a snapshot file by path.

CfgMgr::Set

Sets parameters.

CfgMgr::SetNextStartConfig

Sets startup reference description files.

CfgMgr::SetUpgrade

Enables the system to reload the YAML file after system restart.