diff --git a/src/nav2_turtlebot_simulator/launch/simulator.launch.py b/src/nav2_turtlebot_simulator/launch/simulator.launch.py index fdb3953..480b007 100644 --- a/src/nav2_turtlebot_simulator/launch/simulator.launch.py +++ b/src/nav2_turtlebot_simulator/launch/simulator.launch.py @@ -21,6 +21,18 @@ HOUSE_FURNITURE_BOXES = { 'table_marble/': ('1.40 0.86 0.76', None), } +LOCAL_GROUND_PLANE_MODEL = ''' + 1 + + 0 0 1100 100 + false0 0 1100 1000.24 0.27 0.32 10.24 0.27 0.32 1 + + ''' + +LOCAL_SUN_LIGHT = ''' + false0 0 10 0 0 00.8 0.8 0.8 10.2 0.2 0.2 1-0.5 0.1 -0.9 + ''' + def replace_house_visual_meshes_with_boxes(house_model): """Keep physical mesh collisions, but render furniture as inexpensive boxes.""" @@ -109,7 +121,14 @@ def create_flat_house_world(gazebo_dir): ) with open(world_path, 'r', encoding='utf-8') as source: - flat_world = source.read().replace('model://turtlebot3_house', 'model://turtlebot3_house_flat') + flat_world = source.read() + flat_world = flat_world.replace( + ' \n model://ground_plane\n ', + LOCAL_GROUND_PLANE_MODEL, + ).replace( + ' \n model://sun\n ', + LOCAL_SUN_LIGHT, + ).replace('model://turtlebot3_house', 'model://turtlebot3_house_flat') flat_world_path = os.path.join(tempfile.gettempdir(), 'nav2_turtlebot3_house_flat.world') with open(flat_world_path, 'w', encoding='utf-8') as destination: @@ -119,6 +138,7 @@ def create_flat_house_world(gazebo_dir): os.environ['GAZEBO_MODEL_PATH'] = os.pathsep.join( part for part in (flat_models_dir, existing_model_path) if part ) + os.environ['GAZEBO_MODEL_DATABASE_URI'] = '' return flat_world_path