diff --git a/CMakeLists.txt b/CMakeLists.txt index f888281e9c..da6f8248b0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -417,7 +417,7 @@ set(plugins ) foreach(plugin ${plugins}) - target_link_libraries(${plugin} ${Boost_LIBRARIES} ${GAZEBO_LIBRARIES} ${TinyXML_LIBRARIES}) + target_link_libraries(${plugin} ${Boost_LIBRARIES} ${GAZEBO_LIBRARIES} ${TinyXML_LIBRARIES} ignition-gazebo1-ignition-sensors) endforeach() target_link_libraries(gazebo_opticalflow_plugin ${OpticalFlow_LIBS}) diff --git a/include/gazebo_sensor_plugin.h b/include/gazebo_sensor_plugin.h index a334a83a51..b164265cb0 100644 --- a/include/gazebo_sensor_plugin.h +++ b/include/gazebo_sensor_plugin.h @@ -2,13 +2,13 @@ #include -#include -#include +#include +#include namespace gazebo { - class CollisionPlugin : public SensorPlugin + class CollisionPlugin : public ignition::gazebo::SensorPlugin { public: @@ -16,12 +16,12 @@ namespace gazebo virtual ~CollisionPlugin(){} - virtual void Load(sensors::SensorPtr _sensor, sdf::ElementPtr _sdf); + void Load(sensors::SensorPtr _sensor, sdf::ElementPtr _sdf) override; private: std::string GetObjName(std::string const& object); - virtual void OnUpdate(); + void OnUpdate() override; sensors::ContactSensorPtr parentSensor; event::ConnectionPtr updateConnection; transport::NodePtr node; diff --git a/src/gazebo_sensor_plugin.cpp b/src/gazebo_sensor_plugin.cpp index d6656a8d72..7274315c27 100644 --- a/src/gazebo_sensor_plugin.cpp +++ b/src/gazebo_sensor_plugin.cpp @@ -2,7 +2,7 @@ #include "SensorMessage.pb.h" using namespace gazebo; -GZ_REGISTER_SENSOR_PLUGIN(CollisionPlugin) +IGNITION_ADD_PLUGIN(CollisionPlugin) void CollisionPlugin::Load(sensors::SensorPtr _sensor, sdf::ElementPtr _sdf) {