Skip to Content
Robot Operating System Cookbook
book

Robot Operating System Cookbook

by Kumar Bipin
June 2018
Intermediate to advanced
484 pages
11h 36m
English
Packt Publishing
Content preview from Robot Operating System Cookbook

Compiling the plugin

We should make sure that Gazebo has been properly installed. To compile the preceding plugin, we will create ~/gazebo_plugin_tutorial/CMakeLists.txt and add the rule for compilation:

cmake_minimum_required(VERSION 2.8 FATAL_ERROR) 
find_package(gazebo REQUIRED) 
include_directories(${GAZEBO_INCLUDE_DIRS}) 
link_directories(${GAZEBO_LIBRARY_DIRS}) 
list(APPEND CMAKE_CXX_FLAGS "${GAZEBO_CXX_FLAGS}") 
 
add_library(hello_world SHARED hello_world.cc) 
target_link_libraries(hello_world ${GAZEBO_LIBRARIES}) 
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GAZEBO_CXX_FLAGS}") 

Next, we will create the build directory and compile the code:

$ mkdir ~/gazebo_plugin_tutorial/build
$ cd ~/gazebo_plugin_tutorial/build
$ cmake ..
$ make  

The successful ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mobile Intelligent Autonomous Systems

Mobile Intelligent Autonomous Systems

Jitendra R. Raol, Ajith K. Gopal
Wheeled Mobile Robotics

Wheeled Mobile Robotics

Gregor Klancar, Andrej Zdesar, Saso Blazic, Igor Skrjanc

Publisher Resources

ISBN: 9781783987443Supplemental Content