ut-ims-robotics-sandbox / odom_ign_plugin

Plugin for odometry on ignition gazebo
0 stars 0 forks source link

What are the steps to generate the .so file and get the plugin running? #1

Closed addy1997 closed 3 years ago

addy1997 commented 3 years ago

Hi,

I am a beginner in ignition gazebo. I have made .hh and .cc files already. I have also source installed the ign-plugin repository. Now, what are the next steps?

How do you generate the CmakeLists.txt file and the build folder?

Thanks

addy1997 commented 3 years ago

Hi,

I am a beginner in ignition gazebo. I have made .hh and .cc files already. I have also source installed the ign-plugin repository. Now, what are the next steps?

How do you generate the CmakeLists.txt file and the build folder?

Thanks

@FabianPG11 can you please help me with this?

FabianPG11 commented 3 years ago

Hey, Basically, the CMakeList contains instructions to generate build files based on the project's source and target files. In order to generate your plugin, you need the .hh .cc and CMakeList.txt files. For the last one, you need to define the CMake version, the name of the project and add the directories / packages (depending on your application). You can modify the CMakeList.txt yourself. Using the add_library() you specify the library to build, and with the target_link_library() command you specify which libraries an executable target links against.

Once you are done with it, do:

mkdir build/
cd build/
cmake ..
make

It should generate the .so file then export IGN_GAZEBO_SYSTEM_PLUGIN_PATH=your_path/build

and on Ignition Gazebo just import it as a regular plugin:

<plugin
            filename="yourlib.so"
            name="ignition::gazebo::systems::name">
            <arg> xyz</arg>
        </plugin>       

Hope it helps. You can follow the ign_plugin documentation: https://github.com/ignitionrobotics/ign-plugin

CMakeList documentation: http://wiki.ros.org/catkin/CMakeLists.txt

FabianPG11 commented 3 years ago

Also this one: Create System Plugins

addy1997 commented 3 years ago

Thanks, @FabianPG11. I have installed all the libraries from here and built them from the source. I have my header and source file ready. Now, what do I do?