- Operating System: Ubuntu 18.04 Bionic
- ROS Version: ROS 1 Melody (Python3)
- Gazebo Version: Gazebo 9
Additional libraries:
| Name | Version |
|---|---|
| NumPy | 1.18.2 |
| EmPy | 3.3.4 |
| NASM | 2.15.05 |
| FFmpeg | 4.1.3 |
| VLC | 3.0.7.1 |
| Qt | 5.12.3 |
The Int-Ball2 Technology Demonstration Platform runs on Ubuntu 18.04. To install Ubuntu 18.04 in your environment, refer to the following website:
The Int-Ball2 Technology Demonstration Platform and its simulator require ROS/Gazebo. Since a Gazebo version higher than 9.0.0 is needed, follow these steps:
sudo apt update
sudo apt upgrade
sudo apt install -y wget git vim curl gnupg2 lsb-release iproute2-
Preparation to acquire the latest version, Gazebo 9: To get the latest version of Gazebo 9, execute steps 1 and 2 of the “Alternative installation: step-by-step” on the following website:
- Gazebo: Tutorial: Ubuntu (as of Mar. 28, 2024)
sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list' wget https://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add - sudo apt-get update
-
Installing ROS: Install ROS by following steps 1.1 to 1.6 on the following website:
- melodic/Installation/Ubuntu - ROS Wiki (as of Mar. 28, 2024)
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' sudo apt install curl curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add - sudo apt update sudo apt install ros-melodic-desktop sudo apt-get install -y python-rosdep python-rosinstall python-rosinstall-generator python-wstool build-essential
-
Installing the ROS-related package: Install the ROS-Gazebo collaboration package by executing the following command:
sudo apt install ros-melodic-gazebo-*
This system uses Python3 and its related packages. Follow these steps to install the necessary packages and adjust the settings file:
-
Install Python3:
sudo apt install python3 python3-pip
-
Install the ROS-related Python3 packages:
pip3 install rospkg pip3 install empy==3.3.4
Note: When installing "empy" with
pip3 install rospkg empy, the latest version (4.1 at the time of writing) is installed. However, the reference website here confirms this version has a bug causing the error “AttributeError: ‘module’ object has no attribute ‘RAW_OPT’”. Therefore, it is necessary to install version 3.3.4 specifically. -
Switching to Python3 for ROS package (catkin) build: Modify the settings file to use Python3 for building the ROS package (catkin):
sudo vi /opt/ros/melodic/etc/catkin/profile.d/1.ros_python_version.sh
Add the following line:
export ROS_PYTHON_VERSION=3
The software for the Technology Demonstration Platform is executed using the Ground Support Equipment (GSE) of Int-Ball2. Prepare the Int-Ball2 GSE operating environment with the following steps:
Build and install the assembler called “NASM” from the source file using the following procedure:
-
Decompress and place the NASM source files under “/usr/local/src”:
cd /usr/local/src sudo wget https://www.nasm.us/pub/nasm/releasebuilds/2.15.05/nasm-2.15.05.tar.gz sudo tar zxvf nasm-2.15.05.tar.gz -
Move to the directory where the source file is placed and conduct the build settings:
cd nasm-2.15.05 sudo ./configure -
Build the source file and install it:
sudo make install
Note: As mentioned in the reference description here, it is necessary to install “nasm” beforehand to install ffmpeg.
Build “x264” from the source file using the following steps:
-
Decompress and place the source file under “/usr/local/src”:
cd /usr/local/src(Option1)
sudo tar jxvf x264-master.tar.bz2 -C /usr/local/src/
(Option2)
sudo git clone https://code.videolan.org/videolan/x264.git /usr/local/src/x264-master
-
Move to the directory where the source file is placed and configure the build:
cd /usr/local/src/x264-master sudo ./configure --disable-asm --enable-shared --enable-static --enable-pic -
Build the source file and install it:
sudo make install
To build ffmpeg from the source file, follow these steps:
-
Decompress and place the
ffmpegsource file under “/usr/local/src”: (Option1)sudo tar xvzf ffmpeg-4.1.3.tar.gz -C /usr/local/src/
(Option2)
sudo git clone https://github.com/FFmpeg/FFmpeg.git -b n4.1.3 /usr/local/src/ffmpeg-4.1.3
-
Move to the directory where the source file is placed and configure the build:
cd /usr/local/src/ffmpeg-4.1.3 sudo ./configure --extra-cflags="-I/usr/local/include" \ --extra-ldflags="-L/usr/local/lib" \ --extra-libs="-lpthread -lm -ldl -lpng" \ --enable-pic \ --disable-programs \ --enable-shared \ --enable-gpl \ --enable-libx264 \ --enable-encoder=png \ --enable-version3
-
Build the source file and install it:
sudo make install
Install and build the VLC media player using the following procedure:
-
Install the dependency packages:
sudo apt install libasound2-dev libxcb-shm0-dev libxcb-xv0-dev \ libxcb-keysyms1-dev libxcb-randr0-dev libxcb-composite0-dev \ lua5.2 lua5.2-dev protobuf-compiler bison libdvbpsi-dev libpulse-dev -
Decompress and place the downloaded source file under “/usr/local/src”:
sudo wget https://download.videolan.org/vlc/3.0.7.1/vlc-3.0.7.1.tar.xz sudo tar Jxvf vlc-3.0.7.1.tar.xz -C /usr/local/src/
-
Move to the directory where the source file is placed and configure the build settings:
cd /usr/local/src/vlc-3.0.7.1 CFLAGS="-I/usr/local/include" \ LDFLAGS="-L/usr/local/lib" \ X264_CFLAGS="-L/usr/local/lib -I/usr/local/include" \ X264_LIBS="-lx264" \ X26410b_CFLAGS="-L/usr/local/lib -I/usr/local/include" \ X26410b_LIBS="-lx264" \ AVCODEC_CFLAGS="-L/usr/local/lib -I/usr/local/include" \ AVCODEC_LIBS="-lavformat -lavcodec -lavutil" \ AVFORMAT_CFLAGS="-L/usr/local/lib -I/usr/local/include" \ AVFORMAT_LIBS="-lavformat -lavcodec -lavutil" \ sudo ./configure --disable-a52 \ --enable-merge-ffmpeg \ --enable-x264 \ --enable-x26410b \ --enable-dvbpsi
-
Build the source file and install it:
sudo make install
-
Prepare the symbolic link to the downloaded source file:
sudo ln -s /usr/local/src/vlc-3.0.7.1 /usr/local/src/vlc
Install "Qt" using the following procedure:
-
Prepare the installation directory:
sudo mkdir /opt/Qt
-
Activate the downloaded installer for Linux: (Account registration is required.)
sudo wget https://download.qt.io/archive/qt/5.12/5.12.3/qt-opensource-linux-x64-5.12.3.run sudo chmod +x qt-opensource-linux-x64-5.12.3.run sudo ./qt-opensource-linux-x64-5.12.3.run
-
Check the box for “Using Open Source Qt”.
-
Specify the installation directory as “/opt/Qt”.
-
Select “5.12.3 Desktop gcc 64-bit” as the target version for installation and follow the installer’s instructions.
-
After installation is complete, prepare the symbolic link:
sudo ln -s /opt/Qt/5.12.3 /opt/Qt/5
-
Since the Int-Ball2 GSE uses the Roboto font, copy the font files to the following path and install them:
(Option1)
sudo cp Roboto*.ttf /usr/local/share/fonts/. fc-cache -f -v(Option2)
sudo apt install fonts-roboto
Deploy “Int-Ball2_platform_gse” to an arbitrary directory.
To exchange telemetry and commands between the Int-Ball2 Technology Demonstration Platform Simulator and the GSE, configure the communication setting parameters as follows:
-
Command Transmission Settings: Set the IP address of the computer running this system at
intball2_telecommand_target_ipinIntBall2_platform_gse/src/ground_system/communication_software/config/params.yml. Set an arbitrary command transmission port atintball2_telecommand_target_port. -
Telemetry Receiving Settings: Set an arbitrary telemetry receiving port at
intball2_telemetry_receive_portinIntBall2_platform_gse/src/ground_system/communication_software/config/params.yml.
Prepare the operating environment for using the Int-Ball2 Technology Demonstration Platform Simulator.
Install “Docker” by following the procedure on the following website:
- Install Docker Engine on Ubuntu | Docker Docs (as of Mar. 28, 2024) Follow steps 1 and 2 of “Install using the apt repository”.
- Install Docker-related packages on Python3:
pip3 install docker defusedxml netifaces
-
Ensure the services for containers are always active:
sudo systemctl enable docker docker.socket sudo systemctl start docker.socket -
Grant the authority to activate containers to the user running this system. Assuming the target user is "nvidia":
# Authority setting sudo gpasswd -a nvidia docker sudo chgrp docker /var/run/docker.sock # Restart services for containers sudo service docker restart
-
Run the following command as the user executing this system to confirm no errors (e.g., "permission denied") occur. If operating via SSH, disconnect and reconnect the SSH session before proceeding.
docker ps
Deploy “Int-Ball2_platform_simulator” to an arbitrary directory. Also, deploy platform_works under the home directory of the user executing this system.
To exchange telemetry and commands between the Int-Ball2 Technology Demonstration Platform Simulator and the GSE, configure the communication setting parameters as follows:
-
Command Transmission Settings: Set the same value for
intball2_telecommand_target_portas the receive port in section 4.5.7 inInt-Ball2_platform_simulator/src/flight_software/trans_communication/launch/bringup.launch. -
Telemetry Receiving Settings: Set the IP address of the computer running this system at
ocs_hostinInt-Ball2_platform_simulator/src/flight_software/trans_communication/launch/bringup.launch. Set the same value forintball2_telemetry_receive_portas in section
The Int-Ball2 Technology Demonstration Platform executes the user program using Docker. Configure the following settings related to the exchange between the host and the container:
-
IP of the Host Computer: Set the IP address of the computer running this system at
container_ros_master_uriinInt-Ball2_platform_simulator/src/platform_sim/platform_sim_tools/launch/platform_manager_bringup.launch. -
Container Workspace in the Host Computer: Set the path to
Int-Ball2_platform_simulatorasplatform worksathost_ib2_workspaceinInt-Ball2_platform_simulator/src/platform_sim/platform_sim_tools/launch/platform_manager_bringup.launch.
-
Since the Technology Demonstration Platform executes the user program in a container, it is necessary to build the container for executing the User Demonstration Platform. The tag name (
ib2_user) can be set arbitrarily but must have the prefix "ib2" for containers handled by the flight software.cd ~/platform_works/platform_docker/template docker build . -t ib2_user:0.1
-
Docker images are not cross-platform compatible and cannot be used on different CPU architectures (e.g., images prepared on Intel/AMD for normal computers cannot be used on ARM for Int-Ball2). To prepare images to run on the actual Int-Ball2, use the extended plug-in Docker buildx as shown in the following command:
docker buildx build --platform linux/arm64/v8 -t ib2_user:(version) --load
-
After the building is completed, execute the following command and confirm that "ib2_user" appears in the “REPOSITORY”:
docker images ib2_user
- The following outlines the deployment method for the user program used in the Technology Demonstration Platform. Deploy the user program in the following directory:
[Int-Ball2_platform_simulator_deployment_folder]/Int-Ball2_platform_simulator/src/user/
The files to be deployed should follow the format described below:
user001/
├── launch/
│ ├── program001.launch
│ ├── program002.launch
├── package.xml
├── CMakeLists.txt
├── (Others)
User programs are defined as ROS packages. Refer to the official procedure for preparing a new package:
The following is an example of the ROS package configuration for the Technology Demonstration Platform. In this configuration, it is assumed that the package name is “user001” and the user programs included in the package are “program001.launch” and “program002.launch”. The files to be placed under “launch” must follow the template of “roslaunch” for user programs as described below:
| Directory | Contents |
|---|---|
| user001/ | This is a package that contains a group of programs for a specific user. It can contain multiple user programs inside. Its directory name should be the same as the package name in the ROS package definition file described below. |
| launch/ | Deployment directory for “roslaunch” files. The directory name is fixed as “launch”. |
| program001.launch | Activation settings for user programs (nodes). |
| program002.launch | Activation settings for user programs (nodes). |
| package.xml | ROS package definition file. The “package name” to be defined must match the directory name “user001”. See the official procedure for how to define it: package.xml. |
| CMakeLists.txt | ROS package building settings file. See the official procedure for how to define it: CMakeLists.txt. |
| (Others) | Arbitrary source code and various configuration files can be deployed. |
-
A template (example definition) of the
roslaunchfile for the Technology Demonstration Platform is shown below. The<group ns="platform_launch">is a mandatory item; other items can be set arbitrarily.<?xml version="1.0"?> <launch> <group ns="platform_launch"> <!-- If set to false, the target nodes will be terminated when user logic is started. --> <param name="sensor_fusion" value="false" /> <param name="slam_wrapper" value="false" /> <param name="ctl_only" value="true" /> <param name="fsm" value="true" /> <!-- If you want to start up camera_left and camera_right, you need to stop (set false) slam_wrapper. --> <param name="camera_left" value="true" /> <param name="camera_right" value="true" /> </group> <node name="user_template" pkg="user_template" type="user_template.py" output="screen"> <!-- Parameters to be used in the user's program can be set here --> <param name="custom_parameter_integer" value="1" /> <param name="custom_parameter_float" value="2.0" /> <param name="custom_parameter_string" value="custom" /> <param name="custom_parameter_boolean" value="true" /> </node> </launch>
-
Specify whether to use the existing functions on the flight software side in
<group ns="platform_launch">. The ROS node corresponding to the function defined as "not used" (value="false") is stopped immediately before the start of the user implementation logic.
The correspondence between the item names in <group ns="platform_launch"> and the flight software functions is as follows:
sensor_fusion: Sensor fusionslam_wrapper: Visual SLAMctl_only: Thrust Calculationfsm: Thrust Allocation
To call the newly prepared program while using GSE, add the necessary information to the user_package_list.json in the folder Int-Ball2_platform_gse/src/ground_system/platform_gui/config where the GSE configuration files are stored. (It does not search for the user program automatically, so it is necessary to write the user program in the list beforehand.)
- Execute
catkin_makein the directory whereInt-Ball2_platform_gseis deployed.source /opt/ros/melodic/setup.bash catkin_make sudo mkdir /var/log/ground_system && sudo chown $USER:$USER /var/log/ground_system
```sh
sudo apt install libpcl-dev ros-melodic-pcl-ros
catkin_make –DWITH_PCA9685=OFF
```
- Execute
catkin_make -DWITH_PCA9685=OFFin the directory whereInt-Ball2_platform_simulatoris deployed. Note that-DWITH_PCA9685=OFFis an option to build the thrust function as a simulated node to operate the inductive control function in an environment where the PWM control board is not connected.
The procedure to execute this system is shown below:
-
Execute the following command in the terminal to activate the Int-Ball2 GSE:
source /opt/ros/melodic/setup.bash source /home/nvidia/IB2/Int-Ball2_platform_gse/devel/setup.bash roslaunch platform_gui bringup.launch
-
Execute the following command in a different terminal from step 1 to activate the Int-Ball2 Technology Demonstration Platform Simulator:
source /opt/ros/melodic/setup.bash source /home/nvidia/IB2/Int-Ball2_platform_simulator/devel/setup.bash rosrun platform_sim_tools simulator_bringup.sh
-
Press the “Play” button in Gazebo to start the simulation.
-
Press the “Navigation ON” button in the “Operation Type” on the “Platform Command” panel of the Int-Ball2 GSE to activate the navigation function.
-
Set User Node, User Launch File, and User Container in the “User Programming Platform” on the “Platform Command” panel of the Int-Ball2 GSE to the user programming function to be executed and press the “Start” button. Example:
- User Node: sample_tests
- User Launch File: simple_test.launch
- User Container: ib2_user:0.1
-
Set User Logic in the “User Programming Platform” on the “Platform Command” panel of the Int-Ball2 GSE to the user logic to be executed and press the “Start” button.
-
When step 6 is completed, press
Ctrl+Cin terminals 1 and 2 to exit the system.
Note: At the ISS URDF loading, a segmentation fault may occur when trying to load the node_1 and node_2 models. In such cases, comment out the relevant section in iss.urdf.