@@ -104,6 +104,9 @@ COMMANDS = { 'sim' =>
104
104
" --log-compress When recording, compress final log files. \n " \
105
105
" Only valid if recording is enabled. \n " \
106
106
"\n " \
107
+ " --seed [arg] Pass a custom seed value to the random \n " \
108
+ " number generator. \n " \
109
+ "\n " \
107
110
" --playback [arg] Use logging system to play back states. \n " \
108
111
" Argument is path to recorded states. \n " \
109
112
"\n " \
@@ -224,7 +227,8 @@ class Cmd
224
227
'render_engine_gui' => '' ,
225
228
'render_engine_server' => '' ,
226
229
'wait_gui' => 1 ,
227
- 'headless-rendering' => 0
230
+ 'headless-rendering' => 0 ,
231
+ 'seed' => 0
228
232
}
229
233
230
234
usage = COMMANDS [ args [ 0 ] ]
@@ -317,6 +321,9 @@ class Cmd
317
321
opts . on ( '--version' ) do
318
322
options [ 'version' ] = '1'
319
323
end
324
+ opts . on ( '--seed [arg]' , Integer ) do |i |
325
+ options [ 'seed' ] = i
326
+ end
320
327
321
328
end # opt_parser do
322
329
@@ -455,7 +462,7 @@ Please use [GZ_SIM_RESOURCE_PATH] instead."
455
462
const char *, int, int, const char *,
456
463
int, int, int, const char *, const char *,
457
464
const char *, const char *, const char *,
458
- const char *, int, int)'
465
+ const char *, int, int, int )'
459
466
460
467
# Import the runGui function
461
468
Importer . extern 'int runGui(const char *, const char *, int, const char *)'
@@ -491,7 +498,8 @@ See https://github.com/gazebosim/gz-sim/issues/44 for more info."
491
498
options [ 'render_engine_server' ] , options [ 'render_engine_gui' ] ,
492
499
options [ 'file' ] , options [ 'record-topics' ] . join ( ':' ) ,
493
500
options [ 'wait_gui' ] ,
494
- options [ 'headless-rendering' ] )
501
+ options [ 'headless-rendering' ] , options [ 'seed' ] )
502
+
495
503
end
496
504
497
505
guiPid = Process . fork do
@@ -528,8 +536,10 @@ See https://github.com/gazebosim/gz-sim/issues/44 for more info."
528
536
options [ 'playback' ] , options [ 'physics_engine' ] ,
529
537
options [ 'render_engine_server' ] , options [ 'render_engine_gui' ] ,
530
538
options [ 'file' ] , options [ 'record-topics' ] . join ( ':' ) ,
531
- options [ 'wait_gui' ] , options [ 'headless-rendering' ] )
532
- # Otherwise run the gui
539
+ options [ 'wait_gui' ] ,
540
+ options [ 'headless-rendering' ] , options [ 'seed' ] )
541
+ # Otherwise run the gui
542
+
533
543
else options [ 'gui' ]
534
544
ENV [ 'RMT_PORT' ] = '1501'
535
545
Importer . runGui ( options [ 'gui_config' ] , options [ 'file' ] ,
0 commit comments