Skip to content
This repository has been archived by the owner on Dec 13, 2024. It is now read-only.

Commit

Permalink
Pass world path instead of name.
Browse files Browse the repository at this point in the history
  • Loading branch information
uavster committed Nov 29, 2023
1 parent b965c95 commit f6e8d6e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions src/picknik_ur_gazebo_config/launch/sim/hardware_sim.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,18 @@ def path_pattern_change_for_gazebo(urdf_string):


def generate_simulation_description(context, *args, **settings):
package_name = settings.get("package_name", "picknik_ur_gazebo_config")
world_name = settings.get("gazebo_world_name", "space_station_blocks_world.sdf")
world_path = settings.get(
"gazebo_world_path",
"description/simulation_worlds/space_station_blocks_world.sdf",
)
use_gui = settings.get("gazebo_gui", False)
is_verbose = settings.get("gazebo_verbose", False)
gz_renderer = os.environ.get("GAZEBO_RENDERER", "ogre")

# Create a Gazebo world file that swaps out package:// paths with absolute path.
original_world_file = os.path.join(
get_package_share_directory(package_name),
"description",
"simulation_worlds",
world_name,
original_world_file = get_ros_path(
settings.get("gazebo_world_package_name", "picknik_ur_gazebo_config"),
world_path,
)
modified_world_file = os.path.join(
get_config_folder(), "auto_created", "gazebo_world.sdf"
Expand All @@ -76,7 +76,7 @@ def generate_simulation_description(context, *args, **settings):
file.write(world_sdf)

# Launch Gazebo.
print(f"Starting Gazebo with world {world_name}")
print(f"Starting Gazebo with world at {world_path}")
print(f"GUI: {use_gui}, Verbose: {is_verbose}")

sim_args = f"-r --render-engine {gz_renderer}"
Expand Down
4 changes: 2 additions & 2 deletions src/picknik_ur_gazebo_scan_and_plan_config/config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ based_on_package: "picknik_ur_gazebo_config"

# Optional parameters that can be read in your launch files for specific functionality
optional_feature_params:
package_name: "picknik_ur_gazebo_scan_and_plan_config"
gazebo_world_name: "scan_and_plan_world.sdf"
gazebo_world_package_name: "picknik_ur_gazebo_scan_and_plan_config"
gazebo_world_path: "description/simulation_worlds/scan_and_plan_world.sdf"

0 comments on commit f6e8d6e

Please sign in to comment.