Skip to main content

Documentation Index

Fetch the complete documentation index at: https://inorbitinc.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

The Edge SDK can be used to build integrations between third-party or custom applications running on the edge and the InOrbit platform. For example, it can be used to feed data from a fleet manager system into InOrbit, without requiring the installation of software on your individual robots. Here a custom component acts as a proxy between the fleet manager system and InOrbit cloud using the Edge SDK. Any data fed into InOrbit can then be used and queried from other components, like InOrbit Control or REST APIs. This SDK allows the publishing of data related to multiple robots, including their connection state, odometry, poses and any custom attributes you’d like to track. The Edge SDK is distributed two ways. As an NPM package, which can be run in Javascript and Typescript projects, and as a Python package which is used in Python programs, such as connectors.

Installation

For the most up-to-date installation instructions, please visit our Github repos for the Javascript Edge SDK or Python Edge SDK. The following example is for Javascript.
npm install inorbit@edge-sdk
The Edge SDK can be installed using NPM. This adds the edge-sdk package as a dependency of your project.

Using the SDK

This section explains how to initialize the Edge SDK and publish data to InOrbit. As a prerequisite you should have already installed the npm package and obtained your InOrbit API key.

Initialization

import { InOrbit } from '@inorbit/edge-sdk';

const sdk = new InOrbit({ appKey: "YOUR_INORBIT_APP_KEY" });
The first step is to import the edge-sdk package. Then initialize the SDK by creating an InOrbit object. The SDK can then be used to publish robot related data to InOrbit.

Reporting robot connection status

The sdk object can be used to report the connection status of each robot to InOrbit. In order to do this, you need to know the IDs of your robots and use the connectRobot and disconnectRobot methods.
const robotId = '12345';
await sdk.connectRobot({ robotId, name: 'MyRobot' });

// Perform tasks

await sdk.disconnectRobot(robotId);
The code reports the robot with id 12345 as connected and then as disconnected. Note that when a robot is reported as online, you can also optionally report its name.
The robot must be reported as “online” before publishing any data.

Publishing poses

await sdk.publishPose(robotId, {
  ts: new Date().getTime(),
  x: 5,
  y: 3,
  yaw: 0,
  frameId: 'map'
});
To report a time stamped pose to InOrbit, the publishPose method can be used. The code here reports that the robot is currently at the position (5, 3) in the map reference frame.

Publishing odometry

await sdk.publishOdometry(robotId, {
  tsStart: new Date().getTime(),
  ts: new Date().getTime(),
  speed: {
    linear: 10,
    angular: 1
  }
});
The publishOdometry method can be used to report odometry data to InOrbit. This code reports that the robot is moving with a linear speed of 10 m/s and an angular speed of 1 rad/s.

Publishing other attributes

const robotId = '12345';
await sdk.publishCustomDataKV(robotId, {
  battery: 60,
  status: 'Idle'
});
Other custom attributes can also be reported using the publishCustomDataKV method. The code here reports two custom attributes, battery and status.

Building a Connector

A typical application of the Edge SDK is a program in the structure of a connector. A connector is a custom component that connects a third-party system to InOrbit. The open source Python package inorbit-connector provides a framework for building connectors using the Edge SDK. A simple example can be found in the package’s GitHub repository. An example of a connector based on inorbit-connector is the SICK Tag-LOC InOrbit Connector, which enables real-time location tracking of objects and vehicles.

Complete Examples

Complete examples about using the Edge SDK to publish data from multiple robots to InOrbit can be found at:
Contact us if you need help to use this SDK, integrate it with your software or generate your robot IDs.