There are three main prerequisties to running this project:
- Windows WSL
- Docker Desktop - wsl Backend
- VcXsrv Windows X server
You can install WSL either by following the documentation or the steps written here:
- Run the following command in an administrator PowerShell or Windows Command Prompt
wsl --install
The first time you launch a newly installed Linux distribution, a console window will open and you'll be asked to wait for files to de-compress and be stored on your machine. All future launches should take less than a second.
If you run wsl --install
and see the WSL help text, you already have WSL installed
- Restart your machine
You can install Docker Desktop either by following the documentation or the steps written here:
-
Download and install Docker Desktop (2.3.0.2 or a newer release)
-
Start Docker desktop
-
Select the Use the WSL 2 based engine checkbox
-
Click Apply & Restart
The Xserver is used to connect to the display.
You can install Windows Xserver either by following this guide or the steps written here:
-
Install VcXsrv Windows X Server
-
run Xlaunch from the start menu
-
Setup the configuration by following the steps shown in the pictures below
- Save the configuration file before you finish!
- Save it to one of the following locations:
- %appdata%\Xming
- %userprofile%\Desktop
- %userprofile%
- Save it to one of the following locations:
Clone the repository
Build the docker image using the following command:
docker build -t shakeit .
Run VsXrsv server by opening the config file that was saved during installation. When an Xserver is running you can find the logo in the taskbar as shown below.
Run the following line in Windows PowerShell to start the docker container.
$shakeip = Get-NetIPAddress -InterfaceAlias "vEthernet (WSL)" | select -exp "IPAddress"; docker run -it --rm --name shakeit -e DISPLAY=${shakeip}:0.0 shakeit ros2 launch shakeit_experiments run_sim_experiment.launch.py
If PowerShell shows the error exec /ros_entrypoint.sh: no such file or directory
then:
-
Open the ros_entrypoint.sh file loacted in root
-
Rebuild image and run container again
Run with docker-compose together with moni2, remember to set DISPLAY_IP in .env and to run the command in the same folder as docker-compose.yml
docker-compose up
In ~/.bashrc define environment variables for your ROS2 installation, e.g:
export ROS_VERSION=2
export ROS_PYTHON_VERSION=3
export ROS_DISTRO=foxy
source /opt/ros/foxy/setup.bash
Source ~/.bashrc
$ source ~/.bashrc
$ cd ros_pkg_ws
$ sudo apt install python3-wstool
$ sudo apt-get install python3-rosdep2
$ rosdep update
$ wstool init src/ src/src_dependencies.rosinstall --shallow
$ rosdep install --default-yes --ignore-packages-from-source --from-path ./src
NOTE: If the rosdep update gives errors change the following export in the bashrc file (Solution found here rosdep error)
Replace the following line:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$COPPELIASIM_ROOT
with the following:
export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH:$COPPELIASIM_ROOT
Install Colcon
sudo apt install python3-colcon-common-extensions
Check how to source Corppelia stuff: ros_pkg_ws/setup.bash_example
$ cd ros_pkg_ws
$ source setup.bash
$ colcon build
If you're not using CoppeliaSim skip the sim packages by:
colcon build --packages-skip sim_ros2_interface
Now go into the launch file and edit the path in L24 to the path of the src folder in this repo.
To open PyCharm with code-completion and imports working:
$ cd ros_pkg_ws
$ source setup.bash
$ pycharm
- shakeit_core: contains basic functionality
- shakeit_interfaces: common messages, services, and actions for the shakeit-project
- shakeit_models: models used for training and prediction
- shakeit_sim: simulation of the vibration feeder
Link to sensopart camera pc-software here