Repository navigation
Development with Skyhub SDK
This is a quick guideline how to build ROS-based examples to run with Skyhub services.
To start development work on regular PC workstatin with Intel/AMD based CPUs, you'll need:
- Setup Ubuntu Linux 22.04 Operation system.
- Setup ROS 2 Humble packages.
- Setup Skyhub SDK package.
- Get PC workstation with installed Linux x86-64 Ubuntu 22.04 distribution.
- Install ROS 2 Humble using apt package manager:
sudo apt-get install ros-humble-ros-base. - Install required tools using apt package manager:
sudo apt-get install git cmake curl gnupg2 lsb-release wget tar libasio-dev python3-colcon-common-extensions libpython3.10-dev python3-dev - Download Skyhub SDK package from here.
- Install SDK using this command:
sudo dpkg -i ugcs-skyhub-sdk_1.6.0.484_amd64.deb
You may build all samples in a batch or one-by-one. In any way you'll use colcon utility as it used for any ROS2 projects. These steps to build examples from this repository.
- Clone this repository on you build workstation:
git clone git@github.com:ugcs/skyhub-ros-sdk.git - Change directory to the package you want to build:
cd skyhub-ros-sdk - Source you workspace with ROS2 humble framework:
source /opt/ros/humble/setup.bash - Source you workspace with Skyhub SDK:
source /opt/ugcs/skyhub-ros/local_setup.bash - Now build the sample with colcon:
colcon build --event-handlers console_direct+ --cmake-args -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON
Then build process complete, your module will be in ./install/skyhub_demo/ directory.
To be able to run mouse-log example, you may need to adjust the access rights:
sudo chmod 666 /dev/input/mouse0
Now run the built module (mouse-log for example):
SKYHUB_CONFIG_FILE=./skyhub.conf ~/skyhub-ros-sdk/install/skyhub_demo/lib/skyhub_demo/mouse-log
To make run you modules on target Skyhub platform you must use cross-compile environment. We provide the docker container which contains the required toolchain.
- Cross-build is supported on the same Linux x86-64 Ubuntu 22.04 OS as for regular x86-development. Use this OS as your base.
- Pull the docker image, suited for the used SDK version (1.4):
docker pull ugcs/skyhub-ros-drivers:sdk-1.5 - Run the contaier:
docker run -it -d --name driver-build-containerugcs/skyhub-ros-drivers:sdk-1.5 /bin/bash` - Copy the desired package to build into the running contaier:
docker cp ~/skyhub-ros-sdk/skyhub_demo driver-build-container:/root/ - Connect to the target container:
docker attach driver-build-container - Inside the container set the target platform:
export DESKTOP_ARCH=arm64 && export UBUNTU_NAME=hirsute - Now switch to the package directory inside the container: 'cd skyhub_demo'
- Source the toolchain settings:
source /opt/ros2_env.bash - And run the command to build the package:
colcon build --cmake-args -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_TOOLCHAIN_FILE=$TOOLCHAIN_FILE -DCMAKE_BUILD_TYPE=Release
After the successful build you will get the binaries INSIDE the container in the /root/skyhub_demo/install directory. Now you may get it back to the host:
tar -cvzf driver.tar.gz ./install
exit
docker cp driver-build-container:/root/skyhub_demo/driver.tar.gz ./
Remove the container if you do not need to re-run the build: docker rm -f driver-build-container | true
Then you get the binaries for the target platform (ARM64), you need to put them into Skyhub eco-system.
- Copy the driver.tar.gz to the running Skyhub using SCP utility:
scp driver.tar.gz root@10.1.0.1 - Connect to the Skyhub using SSH:
ssh root@10.1.0.1 - Untar the archive:
tar -xvzf driver.tar.gz - Create the directory for the new Skyhub module:
mkdir -p /var/skyhub/modules/skyhub_demo - Copy the content of the archive:
mv ~/install/* /var/skyhub/modules/ - Add the new section to the /etc/skyhub/payloads.conf: MOUSE. Use any existing section as a template. You need to replace the package and binary names.
- Now restart the Skyhub service:
service skyhub restart.
Then the service will start again, you will see the desired payload module (MOUSE=false) in the 'ROS_PAYLOADS' section. Set it to enable (MOUSE=true) and restart the service again. Now it will add the default configuration section for this module.