Quick Start

Documentation

JAKA SDK is an efficient toolkit designed to help developers easily interact with JAKA robots. SDK provides a set of interfaces to support device connection, control, data transmission and other functions. Through this guide, you will be able to build your own application based on the SDK provided by JAKA in a short time and realize basic interaction with JAKA robots.

Get JAKA SDK

The JAKA SDK software package can be downloaded from the official JAKA Download Center. Select [Secondary Development] –> [SDK] to view the latest and historical versions.

image0

Writing User Programs

To help users quickly build their first application on different platforms, this article uses three example(click here to download demo) to illustrate how to use different compilation tools to create applications on Windows and Linux platforms:

  • Create C# applications using Microsoft Visual Studio on Windows;

  • Use CMake to create C++ applications on Linux;

  • Use Qt Creator to create Qt applications on Linux.

Creating C# Applications with Visual Studio on Windows

Compilation environment installation

Users need to download and install the Microsoft Visual Studio programming platform software. Please install it according to the online resources. The following description assumes that the reader has installed the software. During the deployment of the C# development environment, you may be required to update the .NET framework. Please deploy it according to the requirements (the .NET framework for this project is .NET6.0 when it runs normally).

Create New Project

Open the software and click File-->New-->Project in the upper left corner, as shown in the figure below.

In this example, we choose to create a form application.

image1

image2

Click Next.

If you need a cross-platform application, it is recommended to select Windows Form App;if it only runs on Windows, you can select Windows Forms App (.Net Framework). Click Next.

After further setting the project name and storage location, click Next until the project is created.

image3

Writing an application

After creating the program, you can develop the interface and corresponding functions according to your needs. After completing code editing, click [Build]->[Build Solution] to compile and generate an executable program. Finally, click the Start button on the toolbar to execute or debug the program.

The example provides a demonstration program for robot teaching, which includes the following functions: connection, power-on and enable, joint space motion control, Cartesian space posture control, etc. Customers can refer to the sample code for specific implementation.

Creating C++ Applications with CMake on Linux

Download and install CMake tools

It is recommended to download the installation package for the corresponding platform from the official website Cmake official website. This example uses Cmake version 3.7.2, and it is recommended to use this version or above. (For specific installation operations, please read the online resources, download and install them yourself) The following instructions assume that the reader has completed this operation.

After the download is complete, enter cmake –version in the terminal. If the following content is displayed, it means the installation is successful.

jakauser@ZuCAB2001:~$ cmake --version
cmake version 3.7.2

CMake suite maintained and supported by Kitware (kitware.com/cmake).

Download and install Visual Studio Code

Users can go to the official Visual Studio Code download page to download and install it. After VS Code is installed, please install the CMake extension in Visual Studio Code.

Write the Project Framework and Configure CMake

Create a new project folder CmakeSDKDemo under Linux and create the following files, where c&c++ are resource files under Linux in the SDK package provided by JAKA, including header files inc and dynamic library files. main.cpp is the main file of the project, and CMakeLists.txt is the Cmake configuration file. Please pay attention to the capitalization.

image10

Next, use Cmake to write and run a simple hello world program. First, enter the following in CMakeLists.txt.

cmake_minimum_required(VERSION 3.5)
project(JAKADemo)

add_executable(hello main.cpp)
  • cmake_minimum_required: Specify the minimum version requirement of CMake;

  • project: Define the project name;

  • add_executable: Add an executable target, the first parameter is the target name, the second parameter is the source file list.

Tips:

Note: This project uses the gcc compiler by default, as shown below. Please configure the C++ compiler by yourself.

image11

Write the main program main.cpp and enter the following code.

#include <string>
#include <iostream>

int main(){
    std::cout << "hello world" << std::endl;
}

After that, we configure CMake. Enter cmake . in the terminal to configure the entire project. Then the configuration files required for building will be generated under the project file.

image12

After the generation is complete, enter the make command in the terminal to build and compile the executable program.

A hello executable program will be generated in the current directory.

image13

Enter the ./hello command in the terminal. Execute the program and the result is as follows.

image14

At this point, running a simple helloworld program with CMake is complete.

Creating Qt Applications with Qt Creator on Linux

Download and install Qt Creator

Users can go to the Qt Group official website [https://www.qt.io/download-dev] to find the software installation package and download and install it. After Qt Creator is installed, start Qt Creator and the interface is as shown below.

image19

After Qt is installed, you need to further complete the Qt build configuration. Open Qt Creator, go to [Tools] –> [Options], and select the Kits tab in the pop-up dialog box.

  • In the Qt Versions section, make sure your installed Qt version is listed. If no version is shown, the user needs to add it manually.

image20

  • Confirm the compiler configuration in the Compliers section. Usually, Qt Creator will automatically recognize the installed compilers, but if not, the user can configure them manually.

image21

  • Once Qt and the compiler are configured, go to the Kits tab and click the Add button in the lower left corner to create a new Kit or select an existing Kit.

image22

Create a Qt Application

Run Qt Creator and click [File] -> [New File or Project …] on the menu bar to create a new Qt application. In the following example, select Application (Qt) -> Qt Console Application, i.e. Qt console application, and then follow the instructions to configure it.

image23

After configuring the project name and storage directory, you need to select the Build System. Qt supports multiple build systems. In this example, qmake is selected.

image24

On the Kits selection interface, select the previously configured Kit, click Next and finally complete the project creation.

image25

After the project is created, the initial interface is as follows.

image26

Instructions for deploying SDK application as Addon

In order to facilitate some users to use SDK programming and deploy it in the controller to replace complex graphical programming operations, this chapter deploys and runs applications written using the Jieka SDK through Addon. Since the current Jieka Addon function is to run the Python main file and use Python 2.7 by default, but the Jieka SDK is currently compiled with Python 3 or above, there will be problems when running the Python SDK library directly under Addon. Therefore, this document mainly explains how to call the SDK application written in the customer’s C++ language through Addon, and the platform is the Linux system.

Therefore, the overall idea can be divided into two steps:

  • Develop user programs based on C/C++ that can run in JAKA controllers;

  • Develop an Addon that runs in the JAKA controller and eventually calls and executes the above SDK-based user job program.

Environment Setup

During the whole process, users need to prepare two development environments to complete the above two steps respectively:

  • SDK-based user program development environment;

  • JAKA Addon development environment.

Setup SDK Application Development Environment

For this part, please refer to the process described in 3.2 Creating C++ Applications with CMake on Linux for preparation.

Setup Addon Development Environment

First, prepare a demo developed by JAKA Addon (see the link below for download). After decompression, there are the following directories and files. The most important ones are the two files marked in red. Addon_Demo.py is the main Python program, which is the entry program for the entire Addon runtime. Addon_Demo_config.ini is the Addon configuration file, which contains some configuration items about this Addon.

For details about AddOn, see the AddOn Development Guide.

image33

Development and Deployment

The following demonstrates how to deploy the development environment of JAKA SDK C++ under Linux. This development deployment requires the use of CMake tools. Readers are requested to download, install and configure them by themselves. The following explanation assumes that the reader has completed the configuration and has a certain development foundation.

Write User Application

The writing of user operation programs can refer to the process described in 3.2 Creating C++ Applications with CMake on Linux to create an executable program that can run in the robot controller environment. In this example, it is assumed that the user-developed operation program executable file is demo.

Run SDK Application from Python

At this point, you need to write Python code in the Addon’s Python main program to call the C++ executable program. The following are two ways for users to implement the call (Note: the default Python running version in the controller system environment is Python 2.7).

  • Run via the subprocess module

import subprocess
import os
if __name__ == '__main__':
    # way 1
    args = ['./build/demo']
    result = subprocess.call(args)   # python2
  • Run via the os module

import subprocess
import os
if __name__ == '__main__':
    # way 2
    args = ['./build/demo']
    os.system('./build/demo')

The above is an example of running the SDK program through the JAKA Addon framework. ./build/demo is the path of the user-developed program executable file under the developed Addon.

Run SDK Application as Addon

After writing the Addon, the user needs to package the project into tar.gz format to form an Addon software package. Then open the JAKA App software, You can go to [Settings]–>[System Settings]–>[Add-on], enter the add-on management interface, upload the Addon package to complete the installation. After the installation is complete, the user can control the start or end of the Addon on this page.

image34

image35

Select the Addon package in the local directory and wait for the file to be uploaded successfully.

image36

Use the toggle button under the Stat column to turn this Addon on or off.

image37

Precautions

  • When developing user applications based on SDK, you need to pay attention to the system architecture of the current control cabinet. JAKA controllers based on Debian Linux may have two configurations, x86 and x86_64. You can connect to the controller through the JAKA App and check the controller version suffix to obtain the specific information;

  • If the SDK application was deployed on the controller, it will share the resources with the existing JAKA controller and other system services. Users need to plan resource usage reasonably, including the use of CPU, memory, and disk space, to avoid affecting the robot control system.