Commit 8ae1b1d
NetworkManager: fix entity creation in network secondary (#3160)
Fixes #3158
## Summary
This fixes a bug which prevents the simulation server running in multiple processes as described in https://gazebosim.org/api/sim/10/distributedsimulation.html.
The issue is described in #3158, essentially the NetworkManagerSecondary does not have the parent model associated with the performer entity.
There is also another issue where a dereference of a parent component to obtain the parent entity causes a segmentation fault when running more than one secondary. A check is added to prevent that.
There are some other issues with the distributed simulation as well, such as the pause button not having any effect, but that and other issues will not be dealt with in this PR as they do not prevent the example from running.
## Details
The example used is levels.sdf. It is run in distributed mode on two secondaries as follows.
Terminal 1: secondary 1
```
gz sim -v4 -s -r --levels --network-role secondary levels.sdf
```
Terminal 2: secondary 2
```
gz sim -v4 -s -r --levels --network-role secondary levels.sdf
```
Terminal 3: primary
```
gz sim -v4 -s -r --levels --network-role primary --network-secondaries 2 levels.sdf
```
Terminal 4: gui
```
gz sim -v4 -g
```
Before this patch the errors reported in the associated issue occur. After this no errors are reported.
Signed-off-by: Rhys Mainwaring <[email protected]>
Co-authored-by: Arjo Chakravarty <[email protected]>
(cherry picked from commit 4f48629)1 parent e8a0907 commit 8ae1b1d
2 files changed
+15
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
858 | 858 | | |
859 | 859 | | |
860 | 860 | | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
861 | 872 | | |
862 | 873 | | |
863 | 874 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
134 | 137 | | |
135 | 138 | | |
136 | 139 | | |
| |||
0 commit comments