in my code i got an error [Err] [gazebo_shared.cc:46] System is attempting to load a plugin, but detected an incorrect plugin type. Plugin filename[libgazebo_ros_ray_sensor.so]. I am using gazebo11 on RoS2 Humble. I have made the apt changes to the URDF files, CMake file, packages.xml file and the launch files to no avail. I tried using ultrasonic sensors but then switched. Most online resources are failing.
<gazebo reference="sensor_link">
<sensor type="ray" name="ultrasonic">
<pose>0 0 0 0 0 0</pose> <!-- Adjust the pose as needed -->
<ray>
<scan>
<horizontal>
<samples>1</samples> <!-- Number of samples -->
<resolution>1</resolution> <!-- Resolution of the scan -->
<min_angle>-0.5</min_angle> <!-- Minimum angle of the scan -->
<max_angle>0.5</max_angle> <!-- Maximum angle of the scan -->
</horizontal>
</scan>
<range>
<min>0.02</min> <!-- Minimum range (meters) -->
<max>10.0</max> <!-- Maximum range (meters) -->
<resolution>0.01</resolution> <!-- Range resolution -->
</range>
</ray>
<plugin name="gazebo_ros_ray_sensor" filename="libgazebo_ros_ray_sensor.so">
<ros>
<namespace>/</namespace>
<remapping>~/out:=ultrasonic</remapping>
</ros>
<alwaysOn>true</alwaysOn>
<robotNamespace>/my_robot</robotNamespace> <!-- Namespace for the ROS topics -->
<topicName>/ultrasonic</topicName> <!-- ROS topic to publish data -->
<updateRate>50</updateRate> <!-- Update rate in Hz -->
<frameName>sensor_link</frameName> <!-- Frame of reference for the sensor -->
<radiation_type>ultrasound</radiation_type>
<output_type>sensor_msgs/msg/LaserScan</output_type>
<minRange>0.02</minRange> <!-- Minimum measurable distance (meters) -->
<maxRange>10.0</maxRange> <!-- Maximum measurable distance (meters) -->
<rayCount>1</rayCount> <!-- Number of rays emitted by the sensor -->
<rangeResolution>0.01</rangeResolution> <!-- Resolution of distance measurements -->
<noise>0.01</noise> <!-- Optional: adds noise to the sensor readings -->
</plugin>
</sensor>
</gazebo>
</robot>
I tried this code and my gazebo sensor plugin should have worked but it is not.