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

Hello World plugin

Plugins are designed to be simple. Here, we will discuss a bare bones World plugin which contains a class with a few member functions.

First, we will make a directory and a .cc file for the new plugin:

$ mkdir ~/gazebo_plugin_tutorial
$ cd ~/gazebo_plugin_tutorial
$ gedit hello_world.cc

You can also use the existing package from the chapter3_tutorials/ gazebo_plugin_tutorial file on GitHub.

Next, we will add the following code to hello_world.cc:

#include <gazebo/gazebo.hh> namespace gazebo { class WorldPluginTutorial : public WorldPlugin { public: WorldPluginTutorial() : WorldPlugin() { printf("Gazebo Says: Hello World!n"); } public: void Load(physics::WorldPtr _world, sdf::ElementPtr _sdf) { } }; GZ_REGISTER_WORLD_PLUGIN(WorldPluginTutorial) ...
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