Hello everyone,
I’ve been experiencing a significant slowdown in the real-time factor when running my Isaac Sim simulation as a standalone Python script compared to running it directly through the Isaac Sim GUI. Specifically:
- With GUI:
real_time_factor = 0.6
- As a standalone Python script:
real_time_factor = 0.3
This is a simplified version of the script I’m running:
import argparse
from utils.file_operations import read_yaml
# ---------------------------------------------------------------------------- #
# Read the YAML configuration file #
# ---------------------------------------------------------------------------- #
parser = argparse.ArgumentParser()
parser.add_argument("--config_file", help="Path to the configuration file", default="config/params.yaml")
args = parser.parse_args()
config = read_yaml(args.config_file)
# ---------------------------------------------------------------------------- #
# Start The SimulationApp #
# ---------------------------------------------------------------------------- #
import isaacsim
from omni.isaac.kit import SimulationApp
simulation_app = SimulationApp(launch_config=config.launch_config)
import warnings
import omni.client
import omni.kit.commands
import omni.kit.app
import omni.timeline
import omni.usd
from omni.isaac.core import World
from omni.isaac.core.utils.stage import is_stage_loading
from omni.isaac.core.utils.extensions import enable_extension
# Enable ROS2 bridge extension
enable_extension("omni.isaac.ros2_bridge")
simulation_app.update()
import rclpy
from rclpy.node import Node
from rclpy.parameter import Parameter
warnings.filterwarnings("ignore")
class IsaacSim(Node):
def __init__(self):
super().__init__('IsaacSim')
# Set sim time to true
self.set_parameters([Parameter('use_sim_time', Parameter.Type.BOOL, True)])
omni.usd.get_context().open_stage("/home/lukas/git_clones/isaac-simulation-ros/usd_files/2024_09_05_robot_demo_space.usd")
# wait two frames so that stage starts loading
simulation_app.update()
simulation_app.update()
print("Loading stage...")
while is_stage_loading():
simulation_app.update()
print("Loading Complete")
self.world = World(stage_units_in_meters=1.0)
self.world.reset()
def run_simulation(self):
while simulation_app.is_running():
self.world.step(render=True)
# deal with pause/stop
if self.world.is_playing():
if self.world.current_time_step_index == 0:
self.world.reset()
simulation_app.close()
def main():
rclpy.init()
isaac_sim = IsaacSim()
isaac_sim.run_simulation()
rclpy.shutdown()
if __name__ == '__main__':
main()
System Specs:
- GPU: RTX 4080 Super
- CPU: AMD Ryzen 9 7950X 16-Core Processor
- RAM: 64 GB
- OS: Ubuntu 22.04
- Isaac Sim Version: 4.1.0 (running in Docker)
I’ve tried various suggestions from other forum posts to increase the real-time factor when running as a standalone python script, but nothing has made a significant difference.
Attached you can find a video where I start Isaac-sim.sh
and open the USD, and afterwards, I use the Python script to load the USD and start the simulation. The real-time factors of both can be compared by looking at the wall time in RVIZ.
Has anyone else encountered this issue? Any advice or insights into why the standalone script is performing so much slower would be greatly appreciated!
Thank you!