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

Some sensor systems do not work when model is spawned #1245

Closed
iche033 opened this issue Dec 11, 2021 · 2 comments
Closed

Some sensor systems do not work when model is spawned #1245

iche033 opened this issue Dec 11, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@iche033
Copy link
Contributor

iche033 commented Dec 11, 2021

Environment

  • OS Version: Ubuntu 20.04
  • Source or binary build? binary, ignition-gazebo 6.2.0

Description

spawn a model with air pressure, imu, or magnetometer sensors into the world

  • Expected behavior: data are published to ign topics
  • Actual behavior: ign-gazebo produces these errors:
    [Err] [AirPressure.cc:229] Failed to update magnetometer: 42. Entity not found.
    

Steps to reproduce

  1. ign gazebo -v 4 sensors.sdf
  2. Drag and drop this UAV model which has all the above sensors: https://app.ignitionrobotics.org/OpenRobotics/fuel/models/X3%20UAV%20Config%203
  3. Press play to see errors printed in the console

Possible cause of issue

Looks like it's an issue with the order in which systems are run. For the sensors.sdf world, the error is gone is you just move the User Command system in the world SDF file before all the different sensor systems:

diff --git a/examples/worlds/sensors.sdf b/examples/worlds/sensors.sdf
index 85746503..751dc860 100644
--- a/examples/worlds/sensors.sdf
+++ b/examples/worlds/sensors.sdf
@@ -19,6 +19,10 @@
       filename="ignition-gazebo-physics-system"
       name="ignition::gazebo::systems::Physics">
     </plugin>
+    <plugin
+      filename="ignition-gazebo-user-commands-system"
+      name="ignition::gazebo::systems::UserCommands">
+    </plugin>
     <plugin
       filename="ignition-gazebo-air-pressure-system"
       name="ignition::gazebo::systems::AirPressure">
@@ -35,10 +39,6 @@
       filename="ignition-gazebo-magnetometer-system"
       name="ignition::gazebo::systems::Magnetometer">
     </plugin>
-    <plugin
-      filename="ignition-gazebo-user-commands-system"
-      name="ignition::gazebo::systems::UserCommands">
-    </plugin>
     <plugin
       filename="ignition-gazebo-scene-broadcaster-system"
       name="ignition::gazebo::systems::SceneBroadcaster">
@iche033 iche033 added the bug Something isn't working label Dec 11, 2021
@iche033 iche033 changed the title Some sensors system does not work when model is spawned Some sensor systems do not work when model is spawned Dec 11, 2021
@chapulina
Copy link
Contributor

Possibly related to #797

@chapulina
Copy link
Contributor

I believe this should be fixed since #1281, please reopen if that's not the case.

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
None yet
Development

No branches or pull requests

2 participants