Skip to content

License requirement

The functionality described requires a MANUS Bodypack or a MANUS license dongle containing one of these licenses to be connected:
Core Pro Core XR Core Xsens Pro Core Qualisys Pro Core OptiTrack Pro Demo

Getting Started

This guide gets you started with our Linux SDK in C++ with a simple working example.

Note

This guide is about using our C++ SDK on Linux, usage still requires an active MANUS Core installation reachable within the network. The MANUS devices would need to be connected to that machine. Currently MANUS Core only runs on windows.

Prerequisites

Supported Distros

These are the currently supported and verified Linux distributions. Unlisted distributions might work fine, but your milage may vary.

Distro Version Tag
Ubuntu 20.04 Focal Fossa
Ubuntu 22.04 Jammy Jellyfish

Packages

Our Linux SDK requires you to have the following packages installed.

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 6.2.0 (latest) (for example minimal client)
OpenSSH-Server 8.2 (latest) (for cross compiling with VS)
GDB 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.

Packages

Use the following command to install the necessary packages, some packages can be removed depending on our specific use case.

Installing required packages
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
Single line: Installing 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
Single line sudo: Installing required packages
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

GRPC

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

Cloning GRPC
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
Single line: Cloning GRPC
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
Single line sudo: Cloning GRPC
sudo git clone -b v1.28.1 https://github.com/grpc/grpc /var/local/git/grpc && cd /var/local/git/grpc && sudo git submodule update --init --recursive

Install the protobuf dependency by running the following command:

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
Single line: 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
Single line sudo: Installing Protobuf
cd /var/local/git/grpc/third_party/protobuf && sudo ./autogen.sh && sudo ./configure --enable-shared && sudo make -j$(nproc) && sudo make -j$(nproc) check && sudo make install && sudo make clean && sudo ldconfig

Finally install GRPC by running the command below

Installing GRPC
cd /var/local/git/grpc && \
    make -j$(nproc) && \
    make install && \
    make clean && \
    ldconfig
Single line: Installing GRPC
cd /var/local/git/grpc && make -j$(nproc) && make install && make clean && ldconfig
Single line sudo: Installing GRPC
cd /var/local/git/grpc && sudo make -j$(nproc) && sudo make install && sudo make clean && sudo ldconfig

Docker

Instead of setting up a linux machine, you can also use docker to set up your development environment. The Dockerfile is added at the bottom of this section, and also included within the SDK package. Please be mindful to replace the {USERNAME:PASSWORD} to whichever you prefer.

First, build the Docker image containing the necessary dependencies and tools:

Build docker image
docker build -t manus-linux .

Once the Docker image is built, run a container with the ManusLinux image, the --net=host parameter will make the application look like they are running on the host itself (thus enabling it to find MANUS Core instances on the network).

Run docker container
docker run --net=host -i -t manus-linux /bin/bash

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-linux .

# To Run
#   docker run --net=host -i -t manus-linux /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 

# copy dependencies to usr/local
COPY ManusSDK /usr/local/ManusSDK

# change default SSH port to 5000 to not conflict with system ssh in host mode
RUN echo "Port 5000" >> /etc/ssh/sshd_config

ENTRYPOINT service ssh start && \
id -u manus >/dev/null 2>&1 || useradd -m -d /home/manus -s /bin/bash -G sudo manus && \
echo "manus:default" | chpasswd && bin/bash

EXPOSE 5000