fatal error: gazebo/gazebo.hh: No such file or directory
Hey, I want to add a gps sensor on my robot. Initially i tried adding the gps sensor in the urdf.xacro file, but no much luck there. So I thought to create a .cpp file as i found by hector_plugins. But when im trying to compile the c++ file i get the following error
fatal error: gazebo/gazebo.hh: No such file or directory
#include <gazebo/gazebo.hh>
^~~~~~~~~~~~~~~~~~
compilation terminated.
When I'm doing the plugin_tutorials everything works perfectly, but when I try to compile it with my files i get the above error. My aim is to extract data about the x,y,z position of my rover.
My cpp code:
#include <functional>
#include <gazebo/gazebo.hh>
#include <gazebo/physics/physics.hh>
#include <gazebo/common/common.hh>
#include <ignition/math/Vector3.hh>
namespace gazebo
{
class ModelPush : public ModelPlugin
{
public: void Load(physics::ModelPtr _parent, sdf::ElementPtr /*_sdf*/)
//Store pointer to model
this->model = _parent;
//Listen to update event. This event is broadcast every simulation iteration
this->updateConnection = event::Events::ConnectWorldUpdateBegin(
std::bind(&ModelPush::OnUpdate, this));
}
//Called by the world update start event
public: void OnUpdate()
{
//Get x,y,z position
this->model->GetWorldPose();
}
//Pointer to the model
private: physics::ModelPtr model;
//Pointer to the update event connection
private: event::ConnectionPtr updateConnection;
};
//Register plugin with simulation
GZ_REGISTER_MODEL_PLUGIN(ModelPush)
}
And to compile it i added these two lines in the CMakeLists.txt
add_executable(xyz_push src/xyz_push.cpp) target_link_libraries(xyz_push ${catkin_LIBRARIES})
Any help will be appreciated. Thanks in advance!