Home | Tutorials | Wiki | Issues
Ask Your Question
0

What are the things to be included in the CMakeLists.txt file for using gazebo plugins with ROS?

asked 2016-06-14 15:04:52 -0500

vatsal gravatar image

I want a plugin for using camera in gazebo with ros integration. I already have the .cpp file for the plugin but dont know what all is to be included in the CMakeLists.txt file. Please Help!

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2016-06-23 14:23:34 -0500

m4k gravatar image

updated 2016-06-23 14:31:36 -0500

if you are "just" looking for the CMakeList.txt see below. It also depends on your plugin what 'includes/packages' are required. In addition you need your program to be in a catkin / ros package. (see the tutorial link below)

cmake_minimum_required(VERSION 2.8.3)
project(gazebo_tutorials)

# Load catkin and all dependencies required for this package
find_package(catkin REQUIRED COMPONENTS 
  roscpp 
  gazebo_ros 
)

# Depend on system install of Gazebo
find_package(gazebo REQUIRED)

link_directories(${GAZEBO_LIBRARY_DIRS})
include_directories(${Boost_INCLUDE_DIR} ${catkin_INCLUDE_DIRS} ${GAZEBO_INCLUDE_DIRS})

add_library(${PROJECT_NAME} src/simple_world_plugin.cpp)
target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES} ${GAZEBO_LIBRARIES})

catkin_package(
  DEPENDS 
    roscpp 
    gazebo_ros 
)

As mentioned previously you should go through the tutorial. This is from where I got the above code: http://gazebosim.org/tutorials?tut=ro...

To understand the CMakeList file, read here: http://wiki.ros.org/catkin/CMakeLists...

edit flag offensive delete link more
0

answered 2016-06-14 17:50:30 -0500

The tutorial on plugins demonstrates a simple CmakeLists.txt for a gazebo plugin

http://gazebosim.org/tutorials?tut=pl...

If you want to use ros as well you will some of the cmake from that as well. There are some examples, such as the hector and turtlbot gazebo plugins which you can look at as well.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2016-06-14 15:04:52 -0500

Seen: 1,085 times

Last updated: Jun 23 '16