Note: This article applies to both Prime 3 Haptic XR Gloves and Prime 3 Mocap Gloves

Note: This article applies to both Quantum Mocap Metagloves and Quantum XR Metagloves.

Getting Started with MANUSLinux SDK in C++

Getting Started

This document provides a straightforward example to help you quickly get started with our SDK on Linux using C++.

Prerequisites

Supported Linux Distributions

Below are the Linux distributions that we currently support and have verified compatibility with. While other distributions may work, your experience may vary.

 

Distro

Version

Tag

Ubuntu

20.04

Focal Fossa

Ubuntu

22.04

Jammy Jellyfish

Required Packages

Before getting started, ensure that you have the following packages installed on your Linux system:

Package

Version

Required

GRPC

1.28.1

Yes

Protobuf

3.11.2

Yes

ZMQ

4.3.2 (latest)

Yes

build-essential

12.8 (latest)

Yes

git

2.25.1 (latest)

Yes

libtool

2.4.6 (latest)

Yes

spdlog

1.5.0 (latest)

(for example minimal client)

Ncurses (optional)

6.2.0 (latest)

(for example minimal client)

OpenSSH-Server (optional)

8.2 (latest)

(for cross compiling with VS)

GDB (optional)

9.2 (latest)

(for debugging with VS)

Installation

To get started with the Linux SDK, you'll need to install a few required packages. Follow the steps below for a guide to install them on your environment:

Installing Required Packages

Use the following command to install the necessary packages. You may remove some packages depending on your specific use case.



apt-get update && apt-get install -y \
# Required to install gRPC
build-essential \
git \
libtool \
# Required to use the Manus SDK
libzmq3-dev \
# Only required for visual studio debugging
openssh-server \
gdb \
# Only required for building the minimal client
libspdlog-dev \
libncurses5-dev \
&& apt-get clean


Alternatively, you can use the following single line command to install the required packages:



apt-get update && apt-get install -y build-essential git libtool libzmq3-dev openssh-server gdb libncurses5-dev libspdlog-dev && apt-get clean


If using sudo, you can run:



sudo apt-get update && sudo apt-get install -y build-essential git libtool libzmq3-dev openssh-server gdb libncurses5-dev libspdlog-dev && sudo apt-get clean


Cloning and Installing gRPC

Clone the gRPC repository and its submodules from GitHub to your local machine using the following command:



git clone -b v1.28.1 https://github.com/grpc/grpc /var/local/git/grpc && \
cd /var/local/git/grpc && \
git submodule update --init --recursive


Install the protobuf dependency byrunning the following commands:



cd /var/local/git/grpc/third_party/protobuf && \
./autogen.sh && \
./configure --enable-shared && \
make -j$(nproc) && \
make -j$(nproc) check && \
make install && \
make clean && \
ldconfig


Finally, install gRPC by running the following command:



cd /var/local/git/grpc && \
make -j$(nproc) && \
make install && \
make clean && \
ldconfig


Using Docker

Alternatively, you can use Docker to set up your development environment. Below is a Dockerfile and instructions for building the Docker image:


Dockerfile:



# Copyright 2018 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.#
#
# Based on https://hub.docker.com/r/grpc/cxx.

# To build
#   docker build -t manus-sdk .

# To Run
#   docker run -p 5000:22 -i -t manus-sdk /bin/bash

# FROM ubuntu:jammy as build
FROM ubuntu:focal as build
LABEL description="Visual Studio Manus SDK Build container" 

ENV TZ=Europe/Amsterdam
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

RUN apt-get update && apt-get install -y \
  # Required to install GRPC
  build-essential \
  git \
  libtool \
  libzmq3-dev \
  # Only required for building the SDK
  zlib1g-dev \
  libspdlog-dev \
  # Only required for building the minimal client
  libncurses5-dev \ 
  # Only required for visual studio debugging
  gdb \
  && apt-get clean

ENV GRPC_RELEASE_TAG="v1.28.1"
ENV USERNAME="username"
ENV PASSWORD="password"

RUN git clone -b ${GRPC_RELEASE_TAG} https://github.com/grpc/grpc /var/local/git/grpc && \
    cd /var/local/git/grpc && \
    git submodule update --init --recursive

RUN echo "-- installing protobuf" && \
    cd /var/local/git/grpc/third_party/protobuf && \
    ./autogen.sh && ./configure --enable-shared && \
    make -j$(nproc) && make -j$(nproc) check && make install && make clean && ldconfig

RUN echo "-- installing grpc" && \
    cd /var/local/git/grpc && \
    make -j$(nproc) && make install && make clean && ldconfig

# configure SSH for communication with Visual Studio 
RUN apt-get update && apt-get install -y openssh-server
RUN mkdir -p /var/run/sshd
RUN echo 'PasswordAuthentication yes' >> /etc/ssh/sshd_config && \ 
   ssh-keygen -A 

ENTRYPOINT service ssh start && \
useradd -m -d /home/${USERNAME} -s /bin/bash -G sudo ${USERNAME} && \
echo "${USERNAME}:${PASSWORD}" | chpasswd && bin/bash

EXPOSE 22



Set your username and password environment variables with your preferred credentials.


Building Docker Image

To build the Docker image containing the necessary dependencies and tools, use the following command:



docker build -t ManusLinux .


Running Docker Container

Once the Docker image is built, run a container with the MANUS Linux image:



docker run -p 5000:22 -i -t ManusLinux /bin/bash


download pdf