Commit 5fad8b0
NetworkManager: fix entity creation in network secondary (gazebosim#3160)
Fixes gazebosim#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 gazebosim#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]>1 parent e67b3f9 commit 5fad8b0
2 files changed
+15
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
914 | 914 | | |
915 | 915 | | |
916 | 916 | | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
917 | 928 | | |
918 | 929 | | |
919 | 930 | | |
| |||
| 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