Error with gazebo_ros_multicamera plugin


I’m trying to run a roslaunch gazebo simulation with the stereo_camera model.

First, I added the iris_stereo_camera model to the build target and built it.
And make px4_sitl gazebo_iris_stereo_camera worked fine.
The file was also created within PX4-Autopilot/build/px4_sitl_default/build_gazebo/.

Then, I created a launch file to run using roslaunch and made the iris_stereo_camera.urdf file to use.
When roslaunch was executed, the image of the stereo camera could be checked with the gazebo topic.
However, the following error occurred while running the simulation, and the topic of the stereo camera could not be confirmed in rostopic.
[Err] [Plugin.hh:212] Failed to load plugin /home/kyungtaek/PX4-Autopilot/build/px4_sitl_default/build_gazebo/ /home/kyungtaek/PX4-Autopilot/build/px4_sitl_default/build_gazebo/ undefined symbol: _ZTIN6gazebo17MultiCameraPluginE
Of course, because there was no rostopic, it could not be confirmed in rviz.

If anyone has had the same problem as me, I’d appreciate it if you could tell me how to fix it.

Below are the codes I used.

1.Launch File

<?xml version="1.0"?>
	<!-- Posix SITL environment launch script -->
	<!-- launches PX4 SITL, Gazebo environment, and spawns vehicle -->
	<!-- vehicle pose -->
	<arg name="x" default="0"/>
	<arg name="y" default="0"/>
	<arg name="z" default="0"/>
	<arg name="R" default="0"/>
	<arg name="P" default="0"/>
	<arg name="Y" default="0"/>
	<!-- vehicle model and world -->
	<arg name="est" default="ekf2"/>
	<arg name="vehicle" default="iris_stereo_camera"/>
	<arg name="world" default="$(find mavlink_sitl_gazebo)/worlds/"/>
	<arg name="sdf" default="$(find mavlink_sitl_gazebo)/models/$(arg vehicle)/$(arg vehicle).sdf"/>
	<env name="PX4_SIM_MODEL" value="$(arg vehicle)" />
	<env name="PX4_ESTIMATOR" value="$(arg est)" />

	<!-- gazebo configs -->
	<arg name="gui" default="true"/>
	<arg name="debug" default="false"/>
	<arg name="verbose" default="true"/>
	<arg name="paused" default="false"/>
	<arg name="respawn_gazebo" default="false"/>
	<!-- PX4 configs -->
	<arg name="interactive" default="true"/>
	<!-- PX4 SITL -->
	<arg unless="$(arg interactive)" name="px4_command_arg1" value="-d"/>
	<arg		 if="$(arg interactive)" name="px4_command_arg1" value=""/>
	<node name="sitl" pkg="px4" type="px4" output="screen"
			args="$(find px4)/build/px4_sitl_default/etc -s etc/init.d-posix/rcS $(arg px4_command_arg1)" required="true"/>

	<!-- Gazebo sim -->
	<include file="$(find gazebo_ros)/launch/empty_world.launch">
			<arg name="gui" value="$(arg gui)"/>
			<arg name="world_name" value="$(arg world)"/>
			<arg name="debug" value="$(arg debug)"/>
			<arg name="verbose" value="$(arg verbose)"/>
			<arg name="paused" value="$(arg paused)"/>
			<arg name="respawn_gazebo" value="$(arg respawn_gazebo)"/>

	<!-- gazebo/rviz model -->
	<param name="robot_description" textfile="/home/kyungtaek/PX4-Autopilot/Tools/sitl_gazebo/models/iris_stereo_camera/urdf/iris_stereo_camera.urdf" />
	<node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher">
			<param name="publish_frequency" type="double" value="30.0" />
	<node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" />
	<node name="$(anon vehicle_spawn)" pkg="gazebo_ros" type="spawn_model" output="screen" args="-urdf -param /robot_description -model $(arg vehicle) -x $(arg x) -y $(arg y) -z $(arg z) -R $(arg R) -P $(arg P) -Y $(arg Y)"/>

	<!-- mavros node -->
	<include file="$(find mavros)/launch/px4.launch">
		<arg name="gcs_url" value=""/>
		<arg name="fcu_url" value="udp://:14540@localhost:14557"/>
		<arg name="respawn_mavros" value="false"/>

	<!-- rviz -->
	<node type="rviz" name="rviz" pkg="rviz" />

  1. Stereo camera in urdf file

  <joint name='stereo_joint' type='fixed'>
  <origin rpy='0 0 0.035' xyz='0 0 0'/>
    <parent link="base_link"/>
    <child link="stereo"/>
  <link name='stereo'>
    <origin rpy="0.01 0.025 0.025" xyz="0 0 0"/>
      <mass value="0.01"/>
      <inertia ixx="4.15e-6" ixy="0" ixz="0" iyy="2.407e-6" iyz="0" izz="2.407e-6"/>
        <box size="0.01 0.01 0.01"/>
  <gazebo reference='stereo'>
    <sensor name='stereo_cam' type='multicamera'>
      <camera name='left'>
        <pose>0.1 0.035 0 0 0 0</pose>
      <camera name='right'>
        <pose>0.1 -0.035 0 0 0 0</pose>
      <plugin name='stereo_camera_controller' filename=''>
  1. multicamera part in CMakeLists.txt (PX4-Autopilot/Tools/sitl_gazebo/)
  add_library(gazebo_ros_multicamera SHARED src/gazebo_ros_multicamera.cpp)
  list(APPEND plugins gazebo_ros_multicamera)
  message(STATUS "adding gazebo_ros_multicamera to build")