ros-simulation / gazebo_ros_pkgs

Wrappers, tools and additional API's for using ROS with Gazebo
http://wiki.ros.org/gazebo_ros_pkgs
782 stars 773 forks source link

libgazebo_ros_imu_sensor with ign gazebo #1536

Open luxapana opened 4 months ago

luxapana commented 4 months ago

Hi all I am trying to use libgazebo_ros_imu_sensor.so plugin with ros2. The relevent part of urdf is given below:

<gazebo reference="imu_link">
        <sensor name="imu_sensor" type="imu">
            <plugin filename="libgazebo_ros_imu_sensor.so" name="imu_plugin">
                <ros>
                    <namespace>/demo</namespace>
                    <remapping>~/out:=imu</remapping>
                </ros>
                <initial_orientation_as_reference>false</initial_orientation_as_reference>
            </plugin>
            <always_on>true</always_on>
            <update_rate>100</update_rate>
        </sensor>
    </gazebo>

However, when launched through ros_gz_sim, I do not see any topics such as /demo. I am using ign gazebo. I am getting messages saying libgazebo_ros_imu_sensor is not exposing any symbols.

ruby $(which ign) gazebo-2] [INFO] [1720865080.083022565] [gz_ros2_control]: Loading sensor: imu_sensor
[ruby $(which ign) gazebo-2] Library [/opt/ros/humble/lib/libgazebo_ros_imu_sensor.so] does not export any plugins. The symbol [IgnitionPluginHook] is missing, or it is not externally visible.

what could I be doing wrong? Do these plugins work with ign gazebo?

Thanks

Muhammad540 commented 1 month ago

the namespace should be same as the name you provide to the plugin, in this case it should be "imu_plugin", if you want demo then change the plugin name to "demo"