GithubHelp home page GithubHelp logo

ai4ce / m3dp-sim Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 4.0 21.13 MB

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

CMake 6.38% C++ 65.68% C 2.13% Python 2.39% GLSL 0.92% Makefile 22.50%
3d-printing mobile-robotics robot-simulation mobile-3d-printing fluid-simulation viscoelastic

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

simbaforrest avatar uljad avatar wenyuhan-lina avatar

Stargazers

 avatar  avatar

Watchers

 avatar

m3dp-sim's Issues

Ros Noetic Support

Hello, congrats for the very interesting work. I am trying to setup the simulation on ROS Noetic and Ubuntu 20.04. Do you know if it is possible and what steps should be changed in order to do that?

Thank you!

Launch simple simulation Problem

Hello,

I am trying to set up a simple simulation and since the documentation is not that clear I tried to launch the fluid_world.sdf through the following roslaunch.

<launch>
    <include file="$(find gazebo_ros)/launch/empty_world.launch">
        <arg name="world_name" value="/home/marios/M3DP-Sim/splisplash/fluid_world.sdf"/>
    </include>
</launch>

After I launch it the Gazebo's initial small icon is lagging and hangs there until I get a window saying that it is not responding.
Here is the console output as well:

marios@marios-ThinkPad-P14s-Gen-3:~/M3DP-Sim/catkin_ws/src$ roslaunch marios_test test.launch 
... logging to /home/marios/.ros/log/d57cf1c8-926c-11ed-ad26-c3a6ede0f82c/roslaunch-marios-ThinkPad-P14s-Gen-3-415984.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://marios-ThinkPad-P14s-Gen-3:36851/

SUMMARY
========

PARAMETERS
 * /gazebo/enable_ros_network: True
 * /rosdistro: noetic
 * /rosversion: 1.15.15
 * /use_sim_time: True

NODES
  /
    gazebo (gazebo_ros/gzserver)
    gazebo_gui (gazebo_ros/gzclient)

auto-starting new master
process[master]: started with pid [416007]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to d57cf1c8-926c-11ed-ad26-c3a6ede0f82c
process[rosout-1]: started with pid [416032]
started core service [/rosout]
process[gazebo-2]: started with pid [416035]
process[gazebo_gui-3]: started with pid [416042]
[ INFO] [1673523166.117603021]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...
[ INFO] [1673523166.118302483]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1673523166.168398657]: waitForService: Service [/gazebo_gui/set_physics_properties] has not been advertised, waiting...
[ INFO] [1673523166.169515964]: Finished loading Gazebo ROS API Plugin.
Error Code 12 Msg: Unable to find uri[model://nrp_panel]
[ INFO] [1673523372.139837714, 0.005000000]: waitForService: Service [/gazebo/set_physics_properties] is now available.
[ INFO] [1673523372.164053416, 0.027000000]: Physics dynamic reconfigure ready.
../src/intel/isl/isl.c:2105: FINISHME: ../src/intel/isl/isl.c:isl_surf_supports_ccs: CCS for 3D textures is disabled, but a workaround is available.
Killed
[gazebo_gui-3] process has died [pid 416042, exit code 137, cmd /home/marios/M3DP-Sim/catkin_ws/src/gazebo_ros_pkgs/gazebo_ros/scripts/gzclient __name:=gazebo_gui __log:=/home/marios/.ros/log/d57cf1c8-926c-11ed-ad26-c3a6ede0f82c/gazebo_gui-3.log].
log file: /home/marios/.ros/log/d57cf1c8-926c-11ed-ad26-c3a6ede0f82c/gazebo_gui-3*.log
^C[gazebo-2] killing on exit
[rosout-1] killing on exit
[master] killing on exit
shutting down processing monitor...
... shutting down processing monitor complete
done

Could you please help me with that or provide a tutorial on how to launch a simple simulation with the extruder printing material while moving freely, as in the paper?

Thank you in advance.

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.