Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Crash after respawn using sensors #1489

Closed
Kakcalu13 opened this issue May 16, 2022 · 4 comments
Closed

Crash after respawn using sensors #1489

Kakcalu13 opened this issue May 16, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@Kakcalu13
Copy link

Environment

  • OS Version: 20.04
  • Binary build: 3.12.0 and 6.9.0 (Citadel and Fortress
  • Rendering engine: ogre2
  • Camera duplicated error
  • Not related to GUI/render issue
Warning [GenericJoint.hpp:1480] [GenericJoint::setRestPosition] Value of _q0 [0], is out of the limit range [0.1, 3.1] for index [0] of Joint [Joint].
[Err] [SystemPaths.cc:449] Could not resolve file [freenove_smart_car.sdf/wheel_cover.png]
[Err] [SceneManager.cc:544] Unable to find file [wheel_cover.png]
[Err] [SystemPaths.cc:449] Could not resolve file [freenove_smart_car.sdf/wheel_cover.png]
[Err] [SceneManager.cc:556] Unable to find file [wheel_cover.png]
[Err] [SystemPaths.cc:449] Could not resolve file [freenove_smart_car.sdf/wheel_cover.png]
[Err] [SceneManager.cc:544] Unable to find file [wheel_cover.png]
[Err] [SystemPaths.cc:449] Could not resolve file [freenove_smart_car.sdf/wheel_cover.png]
[Err] [SceneManager.cc:556] Unable to find file [wheel_cover.png]
[Err] [SystemPaths.cc:449] Could not resolve file [freenove_smart_car.sdf/wheel_cover.png]
[Err] [SceneManager.cc:544] Unable to find file [wheel_cover.png]
[Err] [SystemPaths.cc:449] Could not resolve file [freenove_smart_car.sdf/wheel_cover.png]
[Err] [SceneManager.cc:556] Unable to find file [wheel_cover.png]
[Err] [EntityComponentManager.cc:486] Trying to create a component of type [9436740692853731264] attached to entity [62], but this entity does not exist. This create component request will be ignored.
[Err] [EntityComponentManager.cc:486] [Err] [EntityComponentManager.cc:486] [Err] [SystemPaths.cc:449] Trying to create a component of type [Could not resolve file [9436740692853731264freenove_smart_car.sdf/wheel_cover.png] attached to entity []63
[Err] [SceneManager.cc:544] Unable to find file [wheel_cover.png]
], but this entity does not exist. This create component request will be ignored.exist. This create component request will be ignored.[Err] [SystemPaths.cc:449] 
Could not resolve file [freenove_smart_car.sdf/wheel_cover.png]][Err] [EntityComponentManager.cc:486] 
Trying to create a component of type [[Err] [SceneManager.cc:556] 9436740692853731264Unable to find file [] attached to entity [wheel_cover.png64]
], but this entity does not exist. This create component request will be ignored.
[Err] [EntityComponentManager.cc:486] Trying to create a component of type [9436740692853731264] attached to entity [65], but this entity does not exist. This create component request will be ignored.
[Err] [EntityComponentManager.cc:486] Trying to create a component of type [9436740692853731264] attached to entity [67], but this entity does not exist. This create component request will be ignored.
[Err] [EntityComponentManager.cc:486] Trying to create a component of type [9436740692853731264] attached to entity [68], but this entity does not exist. This create component request will be ignored.
terminate called after throwing an instance of 'Ogre::ItemIdentityException'
  what():  OGRE EXCEPTION(4:ItemIdentityException): Camera with name 'freenove_smart_car::right_IR::rgbd_camera' already exists in SceneManager::createCamera at /var/lib/jenkins/workspace/ogre-2.1-debbuilder/repo/OgreMain/src/OgreSceneManager.cpp (line 302)
Stack trace (most recent call last) in thread 1325484:
#24   Object "[0xffffffffffffffff]", at 0xffffffffffffffff, in 
#23   Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7fd9ac000162, in clone
#22   Object "/lib/x86_64-linux-gnu/libpthread.so.0", at 0x7fd9abec6608, in 
#21   Object "/lib/x86_64-linux-gnu/libstdc++.so.6", at 0x7fd9a7fde6b3, in 
#20   Object "/usr/lib/x86_64-linux-gnu/ign-gazebo-3/plugins/libignition-gazebo-sensors-system.so", at 0x7fd982c72ff7, in ignition::gazebo::v3::systems::SensorsPrivate::RenderThread()
#19   Object "/usr/lib/x86_64-linux-gnu/ign-gazebo-3/plugins/libignition-gazebo-sensors-system.so", at 0x7fd982c72887, in ignition::gazebo::v3::systems::SensorsPrivate::RunOnce()
#18   Object "/lib/x86_64-linux-gnu/libignition-gazebo3-rendering.so.3", at 0x7fd982bd4859, in ignition::gazebo::v3::RenderUtil::Update()
#17   Object "/usr/lib/x86_64-linux-gnu/ign-gazebo-3/plugins/libignition-gazebo-sensors-system.so", at 0x7fd982c75aed, in std::_Function_handler<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > (sdf::v9::Sensor const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&), std::_Bind<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > (ignition::gazebo::v3::systems::Sensors::*(ignition::gazebo::v3::systems::Sensors*, std::_Placeholder<1>, std::_Placeholder<2>))(sdf::v9::Sensor const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)> >::_M_invoke(std::_Any_data const&, sdf::v9::Sensor const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
#16   Object "/usr/lib/x86_64-linux-gnu/ign-gazebo-3/plugins/libignition-gazebo-sensors-system.so", at 0x7fd982c71f2c, in ignition::gazebo::v3::systems::Sensors::CreateSensor(sdf::v9::Sensor const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
#15   Object "/usr/lib/x86_64-linux-gnu/libignition-sensors3-rgbd_camera.so", at 0x7fd97234dba7, in ignition::sensors::v3::RgbdCameraSensor::SetScene(std::shared_ptr<ignition::rendering::v3::Scene>)
#14   Object "/usr/lib/x86_64-linux-gnu/libignition-sensors3-rgbd_camera.so", at 0x7fd97234b5e4, in ignition::sensors::v3::RgbdCameraSensor::CreateCameras()
#13   Object "/lib/x86_64-linux-gnu/libignition-rendering3.so.3", at 0x7fd982a4167e, in ignition::rendering::v3::BaseScene::CreateDepthCamera(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
#12   Object "/lib/x86_64-linux-gnu/libignition-rendering3.so.3", at 0x7fd982a42d0f, in ignition::rendering::v3::BaseScene::CreateDepthCamera(unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
#11   Object "/usr/lib/x86_64-linux-gnu/ign-rendering-3/engine-plugins/libignition-rendering-ogre2.so", at 0x7fd97375c1f2, in ignition::rendering::v3::Ogre2Scene::CreateDepthCameraImpl(unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
#10   Object "/usr/lib/x86_64-linux-gnu/ign-rendering-3/engine-plugins/libignition-rendering-ogre2.so", at 0x7fd97375abc7, in ignition::rendering::v3::Ogre2Scene::InitObject(std::shared_ptr<ignition::rendering::v3::Ogre2Object>, unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
#9    Object "/usr/lib/x86_64-linux-gnu/ign-rendering-3/engine-plugins/libignition-rendering-ogre2.so", at 0x7fd9736ff171, in ignition::rendering::v3::Ogre2DepthCamera::Init()
#8    Object "/usr/lib/x86_64-linux-gnu/ign-rendering-3/engine-plugins/libignition-rendering-ogre2.so", at 0x7fd9736feeb3, in ignition::rendering::v3::Ogre2DepthCamera::CreateCamera()
#7    Object "/lib/x86_64-linux-gnu/libOgreMain.so.2.1.0", at 0x7fd9730f9bc2, in 
#6    Object "/lib/x86_64-linux-gnu/libOgreMain.so.2.1.0", at 0x7fd9730da71b, in 
#5    Object "/lib/x86_64-linux-gnu/libstdc++.so.6", at 0x7fd9a7fb18e8, in __cxa_throw
#4    Object "/lib/x86_64-linux-gnu/libstdc++.so.6", at 0x7fd9a7fb1646, in std::terminate()
#3    Object "/lib/x86_64-linux-gnu/libstdc++.so.6", at 0x7fd9a7fb15db, in 
#2    Object "/lib/x86_64-linux-gnu/libstdc++.so.6", at 0x7fd9a7fa5a30, in 
#1    Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7fd9abf03858, in abort
#0    Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7fd9abf2403b, in gsignal
Aborted (Signal sent by tkill() 1325448 1000)

This issue is somewhat mixed with #1107 and #959

The issue is that this stores the RGB camera in SceneManager::createCamera. I was able to load this if I remove this line

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

which is located in free_world.sdf at line #249.

The problem is that when I load it without that plugin, I won't be able to read sensors. So when I added it, it cause issue after respawn due to registered the camera from the previous model. I believe that if there's somewhat unregister this entity would solve the issue.

Description

  • Expected behavior: Expected to respawn with sensor.
  • Actual behavior: Crash after respawn

Steps to reproduce

Command line only

  1. ign gazebo -r free_world.sdf
  2. ign service -s /world/free_world/create --reqtype ignition.msgs.EntityFactory --reptype ignition.msgs.Boolean --timeout 300 --req 'sdf_filename: ''"freenove_smart_car.sdf" pose: {position: {y: 0}} '
  3. ign service -s /world/free_world/remove --reqtype ignition.msgs.Entity --reptype ignition.msgs.Boolean --timeout 300 --req 'name: "freenove_smart_car" type: MODEL'
  4. ign service -s /world/free_world/create --reqtype ignition.msgs.EntityFactory --reptype ignition.msgs.Boolean --timeout 300 --req 'sdf_filename: ''"freenove_smart_car.sdf" pose: {position: {y: 0}} '

CRASHED!

I feel like this is more of mixed bug and enhancement. I don't know, I will let you decide that.

Output

You can use this zip.

delete_this.zip

@Kakcalu13 Kakcalu13 added the bug Something isn't working label May 16, 2022
@Kakcalu13
Copy link
Author

Actually, this is almost exact same as #1473

but this one required to clear the entity of camera RGB.

I found the site: https://gazebosim.org/api/msgs/6.1/classignition_1_1msgs_1_1EntityFactory.html#a9bde302c3181bfcafce2cc1442c2c860

Attempted several like:
ign service -s /world/free_world/create --reqtype ignition.msgs.EntityFactory --reptype ignition.msgs.Boolean --timeout 300 --req 'sdf_filename: ''"freenove_smart_car.sdf" pose: {position: {z: 0}} Clear: true

I think this is what would make the "reset" come true

Still trying stuff

@Kakcalu13
Copy link
Author

Closing since this is not bug and this belongs to answers gazebo com

@Kakcalu13
Copy link
Author

Wait, no. This issue is actually belongs to here now.

When I tried to clear entities through ign service,

ign service -s /world/free_world/remove --reqtype ignition.msgs.Entity --reptype ignition.msgs.Boolean --timeout 300 --req id:25

I was able to respawn the robot through command line only.

See here without ogre2 plugin

vid1.mp4

See how I just spammed to respawn it over and over. No problem. I can do it all day.

The problem with this is that it is unable to read sensors such as camera RGB

So to be able to read those sensors, it needs to have a plugin like this:

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

So see the video where it ran with a plugin

vid1.mp4

Boom, crashed :(

It was due to unable to register a new camera RGB in entitymanager.

See here:

Could not resolve file [freenove_smart_car.sdf/wheel_cover.png]][Err] [EntityComponentManager.cc:486] 
Trying to create a component of type [[Err] [SceneManager.cc:556] 9436740692853731264Unable to find file [] attached to entity [wheel_cover.png64]
], but this entity does not exist. This create component request will be ignored.
[Err] [EntityComponentManager.cc:486] Trying to create a component of type [9436740692853731264] attached to entity [65], but this entity does not exist. This create component request will be ignored.
[Err] [EntityComponentManager.cc:486] Trying to create a component of type [9436740692853731264] attached to entity [67], but this entity does not exist. This create component request will be ignored.
[Err] [EntityComponentManager.cc:486] Trying to create a component of type [9436740692853731264] attached to entity [68], but this entity does not exist. This create component request will be ignored.
terminate called after throwing an instance of 'Ogre::ItemIdentityException'
  what():  OGRE EXCEPTION(4:ItemIdentityException): Camera with name 'freenove_smart_car::right_IR::rgbd_camera' already exists in SceneManager::createCamera at /var/lib/jenkins/workspace/ogre-2.1-debbuilder/repo/OgreMain/src/OgreSceneManager.cpp (line 302)
Stack trace (most recent call last) in thread 1325484:

So, I tried to remove it using ign service

ign service -s /world/free_world/remove --reqtype ignition.msgs.Entity --reptype ignition.msgs.Boolean --timeout 300 --req id:25 but this just acts like ign service -s /world/free_world/remove --reqtype ignition.msgs.Entity --reptype ignition.msgs.Boolean --timeout 300 --req 'name: "freenove_smart_car" type: MODEL'

I tried several include this:
ign service -s /world/free_world/remove --reqtype ignition.msgs.Entity --reptype ignition.msgs.Boolean --timeout 300 --req 'name: "freenove_smart_car::right_IR::rgbd_camera" type: SENSOR'

No luck.

I tried ign service -s /world/free_world/control --reqtype ignition.msgs.WorldControl --reptype ignition.msgs.Boolean --timeout 300 --req reset:{}

They just return error like this (using ign service -s /world/free_world/remove --reqtype ignition.msgs.Entity --reptype ignition.msgs.Boolean --timeout 300 --req id:65)

image

or returns nothing but says data:true

I believe this would resolve the respawn issue if entitymanager can be accessed and removed everytime it loads.

Is there any way we can access to remove the rgb camera memory in the entity manager at any time using ign service?

@Kakcalu13
Copy link
Author

Kakcalu13 commented May 18, 2022

Closing since it's pretty much duplicated. Moving to #1107

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

1 participant