Issue subscribing to topic that is populated from libgazebo_ros_ray_sensor.so
I have created a ray sensor in my Gazebo SDF file. This sensor includes the following plugin defined:
<plugin name="aft_stbd_plugin" filename="libgazebo_ros_ray_sensor.so">
<ros>
<!-- Configure namespace and remap to publish to /ray/range -->
<namespace>/ray</namespace>
<remapping>~/out:=range</remapping>
</ros>
<output_type>sensor_msgs/Range</output_type>
<radiation_type>ultrasound</radiation_type>
</plugin>
In my ROS2 node c++ file, i use the following to subscribe to the /ray/range topic:
ray_sub = this->create_subscription<sensor_msgs::msg::range>( "ray/range", 1, std::bind(&DVL::setRayData, this, std::placeholders::_1));
I put a simple print statement in the setRayData() function. When I run my test world with the ray sensor model and my ROS2 node, it never makes it to the setRayData() function.
In a terminal: ros2 topic list has /ray/range included ros2 topic echo /ray/range shows the data and it is updating at the appropriate rate
Am I missing something unique that may be needed in the node when using the gazebo_ros sensor plugins available?
FYI: ROS2 Foxy, Gazebo 11