8) Simulating Darwin-OP

We will now simulate the Darwin-OP model. You can see the final model loaded a picture below.

The Darwin-OP model on Gazebo

Make Sure you have the installed GitHub explained in the Simulating Darwin tutorial.

If you do not have the GitHub installed go the Simulating Darwin tutorial and perform only the 1st step (Installing GitHub). NOTE : This is only is DO NOT have the GitHub already installed.

Now to simulate the Darwin-OP model we need to do the following steps :

    • Download the Darwin-OP package from Github.
    • Move the package to the models directory.
    • Build the plugin for Darwin-OP model.
    • Run gazebo and insert the model in GUI

STEP 1 : Download the Darwin-OP package

Download the Darwin-OP package by pasting the following code in your terminal.

git clone https://github.com/Bharadwaj-Ramesh/Darwin_OP.git

This down downloads the Darwin package to the directory you are currently. Make sure you are in the Home directory so it makes things easy for you.

STEP 2 : Moving the model

The Darwin package must be moved to the models folder where all the models are stored. Paste the following in your terminal.

cp -r Darwin_OP ~/.gazebo/models/

STEP 3 : Building the Controller/Plugin

The model is controller by a plugin file.This plugin file is present in the Darwin Model package that we just moved. The plugin is a cpp script and it must be build for us top use it. To build it we first move to the plugin folder.

cd ~/.gazebo/models/Darwin_OP/darwin_plugin

We create a new directory build for us to build the plugin, we do this by saying :

mkdir build

cd build

Then we build it :

cmake ..;make

You will see the following load up in your terminal :

-- The C compiler identification is GNU

-- The CXX compiler identification is GNU

-- Check for working C compiler: /usr/bin/gcc

-- Check for working C compiler: /usr/bin/gcc -- works

-- Detecting C compiler ABI info

-- Detecting C compiler ABI info - done

-- Check for working CXX compiler: /usr/bin/c++

-- Check for working CXX compiler: /usr/bin/c++ -- works

-- Detecting CXX compiler ABI info

-- Detecting CXX compiler ABI info - done

-- checking for module 'gazebo'

-- found gazebo, version 1.4.0

-- Configuring done

-- Generating done

-- Build files have been written to: /home/bramesh/.gazebo/models/Darwin_OP/darwin_plugin/build

Scanning dependencies of target darwin_plugin

[100%] Building CXX object CMakeFiles/darwin_plugin.dir/darwin_plugin.cc.o

Linking CXX shared library libdarwin_plugin.so

[100%] Built target darwin_plugin

The plugin file has been build and you will have a lot of file in the build folder. The libdarwin_plugin.so file is the plugin file. Now we need to add this to the gazebo plugin path, which tells gazebo where to look for the plugin.

export GAZEBO_PLUGIN_PATH=`pwd`:$GAZEBO_PLUGIN_PATH

That ends the building process and now we can open gazebo and look at the model.

STEP 4 : Starting Gazebo and Inserting the model

Now open gazebo,

gazebo

Go to insert you must be able to see the Darwin-OP model in the list, insert it in the world. You must see the Darwin-OP model standing. Here is the video of how the Darwin-OP model looks when you open it on gazebo.