在编写gazebo插件时,代码最后注册的插件宏指令名称有GZ_REGISTER_WORLD_PLUGIN,GZ_REGISTER_MODEL_PLUGIN
, GZ_REGISTER_SENSOR_PLUGIN
, GZ_REGISTER_GUI_PLUGIN
, GZ_REGISTER_SYSTEM_PLUGIN
and GZ_REGISTER_VISUAL_PLUGIN
.
如:
代码编译过程如平时一样,生成动态链接库.so文件,然后将库路径添加到gazebo插件路径下
$ export GAZEBO_PLUGIN_PATH=${GAZEBO_PLUGIN_PATH}:~/gazebo_plugin_tutorial/build
然后打开gzserver, gzserver ~/gazebo_plugin_tutorial/hello.world --verbose