To use this simulation tool (Tested on Ubuntu version 18.04 and 20.04) follow these instructions :
From The Gazebo Installation Guide
sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list'
Setup keys and Update:
wget https://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -
sudo apt-get update
wget https://raw.githubusercontent.com/ignition-tooling/release-tools/master/jenkins-scripts/lib/dependencies_archive.sh -O /tmp/dependencies.sh
GAZEBO_MAJOR_VERSION=version ROS_DISTRO=dummy . /tmp/dependencies.sh
echo $BASE_DEPENDENCIES $GAZEBO_BASE_DEPENDENCIES | tr -d '\\' | xargs sudo apt-get -y install
We recommend using ROS_DISTRO=meolodic
and GAZEBO_MAJOR_VERSION=9
Refer to The Gazebo Installation from Source for optional additional physics engines (not required for the basic functionalities of our tool)
sudo apt update
sudo apt install build-essentials
git clone https://bitbucket.org/hbpneurorobotics/gazebo.git
Note that more recent version of Gazebo may not be fully compatible, which is why we are providing this version
cd gazebo
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=$HOME/.local ..
make -j8
make install
You can use make -j4
or another lower number than 8 based on the available memory
## Install Gazebo Fluid Simulation Plugin with SPlisHSPlasH
open your bash nano ~/.bashrc
export LD_LIBRARY_PATH=/home/jason2/.local/lib:$LD_LIBRARY_PATH:/home/<your_User_Name>/splisplash/build/lib
source ~/.bashrc
Clone our repo
https://github.com/ai4ce/M3DP-Sim.git
## Fluid Engine Dev for meshing simulations
Install fluid-engine_dev plugin
mkdir build && cd build && cmake .. && make
Locate the particles2obj executable
e.g /home/<User_name>/fluid-engine-dev/build/bin/particles2obj
/particles2obj -i ./hybrid_liquid_sim_output/yuewei/frame_14000.xyz -r 700,700,700 -k 0.04 -m anisotropic -o ./hybrid_liquid_sim_output/frame_test
The command above specifies the input path, output path for the .obj file and the resolution, meshing method, SPH kernel and grid spacing. For more info on the scope of options, type –help in the end of the command. Refer to Issue#303 for more
FluidSimulator::RunStep
from file GazeboFluidSimulator.cpp the following is used:
string command = "'/home/uljad1b/fluid-engine-dev/build/bin/particles2obj' -i '" + path + "' -r 100,100,100 -g 0.01 -k 0.2 -m spherical -o '/home/uljad1b/fluid-engine-dev/build/bin/hybrid_liquid_sim_output/" + std::to_string(simulationSteps) + ".obj'";
system((command).c_str());
Through string command
you can specify the path where your mesh will be saved during runtime. Use absolute path!
## ROS to connect the plugin for multi robot simulations
Desktop Full Install ROS
Connect ROS to Gazebo
git clone https://github.com/ros-simulation/gazebo_ros_pkgs.git -b melodic-devel
rosdep check --from-paths . --ignore-src --rosdistro melodic
Install moveit
git clone https://github.com/ros-simulation/gazebo_ros_pkgs.git -b melodic-devel
cd src
and Download turtlebot3