Setting Up the Simulation Environment¶
Preparing the Simulation PC¶
First, prepare a PC for simulation and install Choreonoid.
While the actual competition used Ubuntu 16.04 as the OS, the samples should run on more recent environments as well. The following explanation assumes the use of Ubuntu 18.04.
Please use a native installation of Ubuntu. While it may run on a virtual machine, the simulation will be slower and some issues may occur.
Installing Git¶
The version control system Git is required for the following work. If you haven’t installed it yet, install it with the following command:
sudo apt install git
Installing AGX Dynamics¶
If you have an AGX Dynamics license, install AGX Dynamics beforehand. Download the package for your corresponding Ubuntu version from the AGX Dynamics download site provided by the vendor. If you have been provided with a USB dongle, make sure to plug it into your PC.
Once you’ve downloaded the package, install it following the instructions in Installation of AGX Dynamics (Ubuntu Linux).
If you don’t have an AGX Dynamics license, skip this step.
Installing Choreonoid¶
Install the latest development version of Choreonoid following the Building and Installing from Source Code (Ubuntu Linux) section of the Choreonoid Latest Version (Development Version) Manual.
For installation details, please refer to the above document. For Ubuntu 18.04, execute the following commands:
First, obtain the Choreonoid source code from the Git repository:
git clone https://github.com/choreonoid/choreonoid.git
Move to the directory of the obtained source code:
cd choreonoid
Install the dependency packages:
misc/script/install-requisites-ubuntu-18.04.sh
Configure the build with CMake. If you only want to use Choreonoid’s default features, execute:
cmake .
However, to run the WRS2018 samples, you need to enable (turn ON) the following options:
WRS2018 samples
BUILD_WRS2018
Competition support plugin
BUILD_COMPETITION_PLUGIN
When using AGX Dynamics
BUILD_AGX_DYNAMICS_PLUGIN
BUILD_AGX_BODYEXTENSION_PLUGIN
ENABLE_INSTALL_RPATH_USE_LINK_PATH (see Option for AGX Dynamics Shared Library Reference Resolution)
To reproduce smoke and flames
BUILD_SCENE_EFFECTS_PLUGIN
When using multicopters
BUILD_MULTICOPTER_PLUGIN
These options can be set interactively using the ccmake command, but you can also pass -D options to the cmake command. For example, to enable all the above options, enter:
cmake -DBUILD_WRS2018=ON -DBUILD_COMPETITION_PLUGIN=ON -DBUILD_AGX_DYNAMICS_PLUGIN=ON -DBUILD_AGX_BODYEXTENSION_PLUGIN=ON -DBUILD_SCENE_EFFECTS_PLUGIN=ON -DBUILD_MULTICOPTER_PLUGIN=ON -DENABLE_INSTALL_RPATH_USE_LINK_PATH=ON
If you haven’t installed AGX Dynamics, remove the corresponding options from the above command line arguments.
Next, build with the make command:
make
If you’re using a multi-core CPU, it’s recommended to parallelize the build by adding the -j option to the make command. For example:
make -j 8
In this case, the build will execute up to 8 processes simultaneously. For a 4-core 8-thread CPU, this would be appropriate. Generally, specify the number of logical cores of your CPU.
Even after installation, you can always use the latest version of Choreonoid by executing the following in the source directory where you performed the above work:
git pull
make -j 8
Setting Up the Graphics Environment¶
Since the WRS2018 simulation requires advanced rendering capabilities, please refer to Graphics Environment Setup and set up the best graphics environment possible. If possible, use high-end GPUs such as NVIDIA’s GeForce or Quadro, and make sure to execute Installing GPU Drivers on Ubuntu Linux. For Three-Dimensional Rendering Engine, use the default new rendering engine (GLSL rendering engine). (Unless there’s a specific reason, don’t switch to the old rendering engine.) If these conditions aren’t met, rendering speed may be insufficient, and representations of lights, shadows, smoke, and flames may not be displayed.
It’s also desirable to properly configure Overview.
Preparing a Gamepad¶
In these samples, you can control the robot with a gamepad. To do this, prepare a gamepad and connect it to your PC.
For information about compatible gamepads, refer to Preparing the Gamepad in Tank Tutorial. The recommended option is the DUALSHOCK4 controller for PlayStation 4. The DUALSHOCK4 also supports wireless connection via a USB wireless adapter.