To use this simulation tool (Tested on Ubuntu version 18.04 and 20.04) follow these instructions :
From The Gazebo Installation Guide
-
Setup your computer to accept software from packages.osrfoundation.org
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
-
Install prerequisites. A clean Ubuntu system will need the following (replace version with the major version of gazebo you intend to build, eg: 7, 8, 9. And if using ROS, replace dummy with your ROS version, eg: indigo, jade, kinetic...):
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
andGAZEBO_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
- clone the repository
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
- Install using the following commands
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
-
open your bash
nano ~/.bashrc
- Add a line to the bottom of the file
export LD_LIBRARY_PATH=/home/jason2/.local/lib:$LD_LIBRARY_PATH:/home/<your_User_Name>/splisplash/build/lib
- save changes and exit before runnig:
source ~/.bashrc
- Add a line to the bottom of the file
-
Clone our repo
https://github.com/ai4ce/M3DP-Sim.git
-
Install fluid-engine_dev plugin
- Clone the Fluid Engine Dev - Jet repo
- Build it on your machine accordingly as you did with Gazebo
mkdir build && cd build && cmake .. && make
-
Locate the particles2obj executable
e.g
/home/<User_name>/fluid-engine-dev/build/bin/particles2obj
-
Run the conversion from cartesian coordinates to mesh to verify the installation
/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
-
This tool uses a system call to connect the simulation results to the tools. In
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!
-
-
Desktop Full Install ROS
- Follow the ROS Installation Instructions. At 1.4 choose Desktop-Full Install
-
Connect ROS to Gazebo
- Install gazebo_ros_pkgs
git clone https://github.com/ros-simulation/gazebo_ros_pkgs.git -b melodic-devel
- Use Rosdep to check for missing pckgs (dont install gazebo9 & libgazebo9-dev)
rosdep check --from-paths . --ignore-src --rosdistro melodic
- Install gazebo_ros_pkgs
-
Install moveit
git clone https://github.com/ros-simulation/gazebo_ros_pkgs.git -b melodic-devel
-
Create a Catkin Workspace
-
Download catkin_make
- Create a Catkin Workspace
cd src
and Download turtlebot3- Download ttbot with open-manipulator (change to melodic)