Synchronization issues with RealTimeScheduler #989
-
Thank you for allowing us to discuss some INET issues here. I have another question as follows: I want to implement network simulation (OMNeT++ as a network emulator receives the position information passed in the gazebo of the physical simulator), so I use ExtLowerEthernetInterface, and the use of this port requires the RealTimescheduler scheduling class. Although the role of RealTimescheduler is to simulate the time as close as possible to the time in the real world. Makes the simulation appear to be running in real time, but this still has some lag. How to erase or reduce this difference. get your help, thank you! ! ! ps: gazebo is time-driven |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Simulation will always have some kind of extra overhead and you will get lag especially if you are running the simulation under Qtenv (the whole GUI introduces a lot of delay). On the other hand, you seem to want to create a co-simulation where two simulator run in tandem. None of the simulators are inherently 'real-time' so using the ExtLowerEtherInterface is a bit hard constraint. To get the best possible result you would need to write your own Scheduler class that can synchronize between the gazebo and omnetpp simulation kernels. That way you would be able to speed up gazebo and omnetpp would follow or vice versa. I'm not sure if gazebo has an API that allows souch a tight control for its simulation loop, but if it has, I would go along that route and leave out the realtime requirement. |
Beta Was this translation helpful? Give feedback.
Simulation will always have some kind of extra overhead and you will get lag especially if you are running the simulation under Qtenv (the whole GUI introduces a lot of delay). On the other hand, you seem to want to create a co-simulation where two simulator run in tandem. None of the simulators are inherently 'real-time' so using the ExtLowerEtherInterface is a bit hard constraint. To get the best possible result you would need to write your own Scheduler class that can synchronize between the gazebo and omnetpp simulation kernels. That way you would be able to speed up gazebo and omnetpp would follow or vice versa. I'm not sure if gazebo has an API that allows souch a tight control for …