GithubHelp home page GithubHelp logo

lachie-aerialrobotics / m3dp-sim Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ai4ce/m3dp-sim

0.0 0.0 0.0 21.13 MB

Home Page: https://ai4ce.github.io/M3DP-Sim

C++ 65.68% Python 2.39% C 2.13% Makefile 22.50% CMake 6.38% GLSL 0.92%

m3dp-sim's Introduction

M3DP-sim Instructions

To use this simulation tool (Tested on Ubuntu version 18.04 and 20.04) follow these instructions :

Table of Contents


Install the Required dependencies

From The Gazebo Installation Guide

  1. 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'
    
  2. Setup keys and Update:

    wget https://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -
    sudo apt-get update
    
  3. 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 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)

Install build essentials

sudo apt update
sudo apt install build-essentials 

Install Gazebo

  1. 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

  1. 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

Install Gazebo Fluid Simulation Plugin with SPlisHSPlasH

  1. open your bash nano ~/.bashrc

    1. 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
      
    2. save changes and exit before runnig: source ~/.bashrc
  2. Clone our repo

https://github.com/ai4ce/M3DP-Sim.git 

Fluid Engine Dev for meshing simulations

  1. Install fluid-engine_dev plugin

    1. Clone the Fluid Engine Dev - Jet repo
    2. Build it on your machine accordingly as you did with Gazebo mkdir build && cd build && cmake .. && make
  2. Locate the particles2obj executable

    e.g /home/<User_name>/fluid-engine-dev/build/bin/particles2obj

    1. 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

    2. 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!

ROS to connect the plugin for multi robot simulations

  1. Desktop Full Install ROS

    1. Follow the ROS Installation Instructions. At 1.4 choose Desktop-Full Install
  2. Connect ROS to Gazebo

    1. Install gazebo_ros_pkgs
      git clone https://github.com/ros-simulation/gazebo_ros_pkgs.git -b melodic-devel
      
    2. Use Rosdep to check for missing pckgs (dont install gazebo9 & libgazebo9-dev)
      rosdep check --from-paths . --ignore-src --rosdistro melodic
      
  3. Install moveit

     git clone https://github.com/ros-simulation/gazebo_ros_pkgs.git -b melodic-devel
    
  4. Create a Catkin Workspace

  5. Download catkin_make

Running TurtleBots

  1. Create a Catkin Workspace
  2. cd srcand Download turtlebot3
  3. Download ttbot with open-manipulator (change to melodic)

m3dp-sim's People

Contributors

uljad avatar simbaforrest avatar wenyuhan-lina avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.