Skip to content
This repository has been archived by the owner on Feb 3, 2025. It is now read-only.

State log won't play with gazebo 8.3 because of a model plugin #2427

Closed
osrf-migration opened this issue Feb 14, 2018 · 7 comments
Closed

State log won't play with gazebo 8.3 because of a model plugin #2427

osrf-migration opened this issue Feb 14, 2018 · 7 comments
Labels
bug Something isn't working major

Comments

@osrf-migration
Copy link

Original report (archived issue) by Deanna Hood (Bitbucket: d_hood).

The original report had attachments: insertion_deletion.log, insertion_deletion_plugin.log


After upgrading to gazebo 8.3 I am having issues playing existing log files because of a particular model plugin. I think the plugin never used to load during log playback before, but with 8.3 it does.

This affects ARIAC logging with the ur10, but I've managed to reproduce an ARIAC-agnostic example.

Using the insertion_deletion.log added in https://osrf-migration.github.io/gazebo-gh-pages/#!/osrf/gazebo/pull-requests/2608 (because it's a log file without encoding), if you make the following modification, it will play in gazebo 8.2 but it will not play in gazebo 8.3.

diff --git a/insertion_deletion.log b/insertion_deletion_plugin.log
index a946e73..2800a41 100644
--- a/insertion_deletion.log
+++ b/insertion_deletion_plugin.log
@@ -39,6 +39,9 @@
 </chunk>
 <chunk encoding='txt'>
 <![CDATA[<sdf version='1.6'><state world_name='default'><sim_time>1 607000000</sim_time><wall_time>1488833218 801500869</wall_time><real_time>1 658504778</real_time><iterations>1607</iterations><insertions><model name='unit_box'>
+  <plugin name='ros_control' filename='libgazebo_ros_control.so'>
+    <robotNamespace>/</robotNamespace>
+  </plugin>
   <pose frame=''>-0.541687 -2.44761 0.5 0 -0 0</pose>
   <link name='link'>
     <inertial>

I think that model plugins used to be ignored in log playback, because if you change libgazebo_ros_control.so to dummy.so, nothing changes in gazebo 8.2, while gazebo 8.3 will complain that it can't find the plugin:

[Err] [Plugin.hh:180] Failed to load plugin dummy.so: dummy.so: cannot open shared object file: No such file or directory

I can appreciate that there are some plugins for which it makes sense for them to be loaded during playback (e.g. visual plugins), but it doesn't make sense for this particular plugin. Was this behaviour change intentional? If so would it be appropriate to add an option to disable plugin loading at playback?

@osrf-migration
Copy link
Author

Original comment by Louise Poubel (Bitbucket: chapulina, GitHub: chapulina).


I think all plugins are supposed to work during playback (as of now). I think one trick we did for the SRC was to playback the log while the plugins were not in the path, so they weren't loaded.

So I'd expect the plugin to be loaded on 8.2 too. Is the unit_box inserted at all on Gazebo 8.2?

@osrf-migration
Copy link
Author

Original comment by Deanna Hood (Bitbucket: d_hood).


The unit_box is inserted, yeah, in both cases. But it seems that for some reason that model plugin doesn't even attempt to load with 8.2 (judging from the lack of error message when I use dummy.so, though that's not a 100% certain).

I am running the gazebo invocations in the same terminal, so the plugin should be on the path either way (since there's not warning).

It might be relevant that the model is being inserted in the log file. I just noticed this line in a PR merged in the last release cycle: https://osrf-migration.github.io/gazebo-gh-pages/#!/osrf/gazebo/pull-requests/2608/process-insertions-and-deletions-on-gz-log/diff#Lgazebo/physics/World.ccF549 that makes me think that in the past, plugins were loaded for models (as you mentioned), but not for inserted models?

@osrf-migration
Copy link
Author

Original comment by Louise Poubel (Bitbucket: chapulina, GitHub: chapulina).


Ohh nice catch! Now inserted models are loaded through World::SetState and plugins are loaded too.

So my assumption was wrong, some plugins have not been loaded during playback until now. This was definitely an unintended change in behaviour. I know for a fact that GUI plugins are loaded, and I think @tfoote has been recently using a world/system plugin during log playback.

I tried adding a plugin both to a model which starts in the world and one that is inserted, and I only get an error message for grape on 8.3:

diff -r 3c0acfb27fc36b0ada8e4bf12675db18f7ec6474 test/logs/insertion_deletion.log
--- a/test/logs/insertion_deletion.log	Sat Feb 10 11:22:45 2018 -0800
+++ b/test/logs/insertion_deletion.log	Wed Feb 14 16:20:59 2018 -0800
@@ -33,6 +33,10 @@
     <elevation>0</elevation>
     <heading_deg>0</heading_deg>
   </spherical_coordinates>
+  <model name="banana">
+    <plugin name='banana' filename='banana.so'>
+    </plugin>
+  </model>
 </world>
 </sdf>
 ]]>
@@ -89,6 +93,10 @@
     <kinematic>0</kinematic>
   </link>
 </model>
+  <model name="grape">
+    <plugin name='grape' filename='grape.so'>
+    </plugin>
+  </model>

We need a consistent behaviour between preexistent models and inserted ones. Let me try something out.

In any case, it would be nice to document somewhere which plugins are loaded during playback.

@osrf-migration
Copy link
Author

Original comment by Louise Poubel (Bitbucket: chapulina, GitHub: chapulina).


See pull request #2884 for a patch

@osrf-migration
Copy link
Author

Original comment by Tully Foote (Bitbucket: Tully Foote, GitHub: tfoote).


I'm attempting to use a system plugin during playback here: ros-simulation/gazebo_ros_pkgs#674

@osrf-migration
Copy link
Author

Original comment by Deanna Hood (Bitbucket: d_hood).


I put some prints in LoadPlugins methods; it seems that only visual plugins and sensor plugins are loaded during playback, but not world or model plugins (except currently the inserted models). Not sure if this was always the case, or if world plugins used to be loaded, for example.

@osrf-migration
Copy link
Author

Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).


  • changed state from "new" to "resolved"

pull request #2884

@osrf-migration osrf-migration added major bug Something isn't working labels Apr 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working major
Projects
None yet
Development

No branches or pull requests

1 participant