Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Including camera plugin more than once crashes Gazebo #497

Open
martincerven opened this issue Feb 7, 2025 · 0 comments
Open

Including camera plugin more than once crashes Gazebo #497

martincerven opened this issue Feb 7, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@martincerven
Copy link

Environment

  • OS Version: Ubuntu 22.04
  • Source or binary build?
    binary 8.8.0

Description

  • Expected behavior: Wanted to add camera sensor to world file to observe a robot:

<model name="camera_model">

	<plugin
		filename="gz-sim-sensors-system"
		name="gz::sim::systems::Sensors">
		<render_engine>ogre2</render_engine>
	</plugin>			 

      <pose>4 0 1.0 0 0.0 3.14</pose>
      <link name="link">
        <pose>0.05 0.05 0.05 0 0 0</pose>
        <inertial>
          <mass>0.1</mass>
          <inertia>
            <ixx>0.000166667</ixx>
            <iyy>0.000166667</iyy>
            <izz>0.000166667</izz>
          </inertia>
        </inertial>
        <collision name="collision">
          <geometry>
            <box>
              <size>0.1 0.1 0.1</size>
            </box>
          </geometry>
        </collision>
        <visual name="visual">
          <geometry>
            <box>
              <size>0.1 0.1 0.1</size>
            </box>
          </geometry>
        </visual>
        <sensor name="camera_sensor" type="camera">
          <camera>
            <horizontal_fov>1.047</horizontal_fov>
            <image>
              <width>320</width>
              <height>240</height>
            </image>
            <clip>
              <near>0.1</near>
              <far>100</far>
            </clip>
          </camera>
          <always_on>1</always_on>
          <update_rate>30</update_rate>
          <visualize>true</visualize>
          <topic>camera_topic</topic>
        </sensor>
      </link>
    </model>
  • Actual behavior:

got nondescriptive crash:

[gz sim -r-1] Stack trace (most recent call last) in thread 3411105:
[gz sim -r-1] #13   Object "[0xffffffffffffffff]", at 0xffffffffffffffff, in 
[gz sim -r-1] #12   Object "/lib/aarch64-linux-gnu/libc.so.6", at 0xffffa2be5edb, in 
[gz sim -r-1] #11   Object "/lib/aarch64-linux-gnu/libc.so.6", at 0xffffa2b7d5b7, in 
[gz sim -r-1] #10   Object "/lib/aarch64-linux-gnu/libstdc++.so.6", at 0xffff9eb331fb, in 
[gz sim -r-1] #9    Object "/usr/lib/aarch64-linux-gnu/gz-sim-8/plugins/libgz-sim-sensors-system.so", at 0xffff52cce28b, in gz::sim::v8::systems::SensorsPrivate::RenderThread()
[gz sim -r-1] #8    Object "/usr/lib/aarch64-linux-gnu/gz-sim-8/plugins/libgz-sim-sensors-system.so", at 0xffff52ccc58b, in gz::sim::v8::systems::SensorsPrivate::WaitForInit()
[gz sim -r-1] #7    Object "/lib/aarch64-linux-gnu/libgz-sim8-rendering.so.8", at 0xffff52c13f03, in gz::sim::v8::RenderUtil::Init()
[gz sim -r-1] #6    Object "/lib/aarch64-linux-gnu/libgz-rendering8.so.8", at 0xffff5298dc7b, in virtual thunk to gz::rendering::v8::BaseRenderEngine::CreateScene(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
[gz sim -r-1] #5    Object "/lib/aarch64-linux-gnu/libgz-rendering8.so.8", at 0xffff5298f09f, in gz::rendering::v8::BaseRenderEngine::CreateScene(unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
[gz sim -r-1] #4    Object "/lib/aarch64-linux-gnu/libgz-rendering8.so.8", at 0xffff529907df, in gz::rendering::v8::BaseScene::Init()
[gz sim -r-1] #3    Object "/usr/lib/aarch64-linux-gnu/gz-rendering-8/engine-plugins/libgz-rendering-ogre2.so", at 0xffff28379393, in gz::rendering::v8::Ogre2Scene::InitImpl()
[gz sim -r-1] #2    Object "/usr/lib/aarch64-linux-gnu/gz-rendering-8/engine-plugins/libgz-rendering-ogre2.so", at 0xffff28373ddf, in gz::rendering::v8::Ogre2Scene::UpdateShadowNode()
[gz sim -r-1] #1    Object "/usr/lib/aarch64-linux-gnu/gz-rendering-8/engine-plugins/libgz-rendering-ogre2.so", at 0xffff28371d33, in gz::rendering::v8::Ogre2Scene::CreateShadowNodeWithSettings(Ogre::CompositorManager2*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<Ogre::ShadowNodeHelper::ShadowParam, Ogre::STLAllocator<Ogre::ShadowNodeHelper::ShadowParam, Ogre::CategorisedAllocPolicy<(Ogre::MemoryCategory)0> > > const&)
[gz sim -r-1] #0    Object "/usr/lib/aarch64-linux-gnu/OGRE-2.3/libOgreNextMain.so.2.3.1", at 0xffff20e240e0, in Ogre::CompositorManager2::addShadowNodeDefinition(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
[gz sim -r-1] Segmentation fault (Address not mapped to object [(nil)])

Cause of crash

When I didn't spawn robot, I didn't get the crash, so I inspected the urdf of robot and they included the plugin there too.

Discussion

  • What is correct approach? For the authors of the robot to not include plugin directly in urdf(xacro)?
    But then if someone want's to spawn the robot it probably needs camera plugin included.
  • Should Gazebo just crash if the plugin is included multiple times? Especially if someone isn't author or some robot package, that is spawned in a simulation and just adds a camera like here, the error doesn't really say much...
@martincerven martincerven added the bug Something isn't working label Feb 7, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
Status: Inbox
Development

No branches or pull requests

1 participant