Pausing simulink in parallel cosimulation
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Lukas Polacek
am 30 Nov. 2021
Beantwortet: Gaurav Bhosale
am 1 Dez. 2021
Hello,
I have a problem with pausing and continuing to run simulink. I need it for parallel cosimulation. Till now I didn't need parallelization I have used Gazebo pacer, but this does not support parallelization.
I need command how to pause and after next command to run the next step.
Do you have some suggestions about controlling cosimulation from matlab or through S-Function? Or some other way?
Thank you for any suggestion.
0 Kommentare
Akzeptierte Antwort
Gaurav Bhosale
am 1 Dez. 2021
Hi Lukas,
The parallel co-simulation is not yet supported. i.e. with current pacer block, connecting to multiple Gazebo instance ( with different port number ) is not possible. Like, you can not define port number as variable in pacer block. Further, the preferences are stored in single port number, changing in port number in same MATLAB instance is not possible.
You can execute following commands,
>> parpool
>> numSims = 3;
>> modelname = 'pacerTest';
>> load_system(modelname);
>> simIn(1:numSims) = Simulink.SimulationInput(modelname);
>> simOut = parsim(simIn)
But, as you are running these command in same Gazebo session, execute with parsim will not make any usage of parallel execution.
Further, to 'step' and 'pause' Gazebo, you can make use of following commands in MATLAB.
modename = 'pacerTest';
set_param(modename,'SimulationCommand','start')
set_param(modename,'SimulationCommand','pause')
set_param(modename,'SimulationCommand','step')
Thanks
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Gazebo Co-Simulation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!