Learning Wizard

Instructions

This document describes the concept of the OpenHiva framework, deterministic scheduling principles, communication mechanism, and invoking of data-plane software interfaces. It provides guidance for developers to quickly develop applications based on the framework, which provides high-performance and secure communication and data transmission capabilities for robot services.

Tutorial

If you use this document for the first time, you are advised to read Table 1 first to quickly understand the document content.

Table 1 Learning wizard

Use Case

Operation Guide

Description

1. Understand what is OpenHiva

Introduction to OpenHiva

This chapter describes the basic concepts, logical architecture, deterministic scheduling principles, and communication mechanisms of the OpenHiva framework. In addition, it describes the process of robot application development based on the framework and the dependent parameter configuration management modules, helping you quickly understand how to develop applications.

2. What should I prepare before developing robot applications based on OpenHiva

Environment Setup

Before using the OpenHiva framework to develop robot AI applications, prepare hardware and software resources.

3. Use OpenHiva to implement communication between robot modules

Message Subscribing-Publishing

OpenHiva supports topic-based communication (Pub/Sub communication mechanism), which includes the following message types:
  • Common message: Messages are subscribed to and published based on standard topics. The message memory is applied for and released by OpenHiva. You only need to pay attention to the service logic. The code logic is relatively simple.
  • BufferMessage: Messages are subscribed to and published based on HivaBuffer. It is usually used for image message passing, especially for data obtained from sensors such as lidar and camera. The data volume is large and unstructured. During the message passing, the copy-free solution is used to improve performance. The message memory is not applied for by OpenHiva. Instead, the sensor driver is directly used to apply for the shared memory for message passing.

Message Request-Response

OpenHiva supports the service-based communication mode (RPC remote invoking mechanism).

4. Use the timer service provided by OpenHiva.

Timers

OpenHiva provides a set of timer interfaces (Hive Timer), which are applicable to scenarios where a function needs to be periodically executed or a timer is required.

5. (Optional) Use the parameter configuration service provided by OpenHiva

Configuration Management

The CfgMgr is used to manage configuration parameters in the system and save the parameters in YAML format. The CfgMgr works with the interfaces for setting, obtaining, listening, snapshotting, and reloading parameters to improve parameter management efficiency.

6. Use the process management service provided by OpenHiva.

Process Management

The process management module (ProcMgr) is used to manage various application processes in the system, including creating, starting, and ending processes, and monitoring the status of each application process.

7. Develop robot applications based on OpenHiva

Obtain the sample code.

Click Gitee to go to the HiCAID open source repository and go to the HiCAID/OpenHiva/examples directory to obtain the sample code. For details about the sample, see README.en.md.

Build and Run

To develop applications based on OpenHiva, compile and run the application code to obtain the application result.

8. Know more about OpenHiva and configuration management APIs

API References

This chapter describes the software interfaces of the data plane subsystem of the basic platform, helping you quickly understand the meanings and functions of the interfaces.

9. Problems may encounter when using OpenHiva to develop applications

FAQs

When the OpenHiva framework is used to develop robot AI applications, emergencies or exceptions may occur. This document lists some frequent problems and provides causes and solutions.

Restrictions

  • Interface usage:

    The OpenHiva interfaces support the normalization of the management plane and data plane interfaces. The deterministic scheduling is supported only on the data plane.

  • Scheduling mode:

    The OpenHiva interfaces and deterministic scheduling interfaces support both deterministic scheduling and non-deterministic scheduling (OS scheduling). When deterministic scheduling is used, services need to be adapted and reconstructed to meet deterministic scheduling requirements and achieve end-to-end deterministic latency.

  • Supported processor: Currently, the functions provided by the OpenHiva framework apply only to the Ascend 310B AI Processor.
  • Application scenario: The Ascend AI developer kit (Atlas 200I DK A2) is used to develop robot AI applications.