Examples of registering a custom sensor (not plugin)
I'm trying to make a custom sensor (that inherits from RaySensor) but am having trouble getting it registered properly if it's not built within the gazebo source code.
I call:
GZ_REGISTER_STATIC_SENSOR("parallel_ray", ParallelRaySensor)
but when I try to add a model with that sensor, I end up with:
[Err] [SensorManager.cc:276] Unable to create sensor of type[parallel_ray]
because sensors::SensorFactory::GetSensorTypes()
doesn't list parallel_ray
as a type.
Can anyone share a link to some code where a custom sensor, from outside of the gazebo source code, has been registered with gazebo's SensorManager/SensorFactory? I suspect that I need to specify the path to the sensor's .so somehow.
@dhood did you find the solution to this problem? I am having exactly the same problem. Basically I want to add a new sensor without having the recompile Gazebo.
@javi-v I didn't, no. I made use of an existing sensor instead. (In this case, to get a parallel ray sensor I used a RaySensor with an origin "behind" the origin of the link, so that the rays are approximately parallel in the region "in front" of the link: https://bitbucket.org/osrf/ariac/src/6e6eebc181bed1eef147581b1604bbec3374f45d/osrf_gear/models/proximity_sensor/model.sdf?at=master&fileviewer=file-view-default#model.sdf-37 )