From fa39f8cdfd622581f0fb3b21bc5fa65cff69f45e Mon Sep 17 00:00:00 2001 From: rafal-gorecki Date: Mon, 6 May 2024 14:36:17 +0200 Subject: [PATCH 1/2] Package rename --- panther/panther_simulation.repos | 4 ++-- panther_gazebo/README.md | 2 +- panther_gazebo/launch/simulation.launch.py | 2 +- panther_gazebo/package.xml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/panther/panther_simulation.repos b/panther/panther_simulation.repos index 05dad7358..ed297c975 100644 --- a/panther/panther_simulation.repos +++ b/panther/panther_simulation.repos @@ -1,5 +1,5 @@ repositories: - husarion_office_gz: + husarion_gz_worlds: type: git - url: https://github.com/husarion/husarion_office_gz.git + url: https://github.com/husarion/husarion_gz_worlds.git version: main diff --git a/panther_gazebo/README.md b/panther_gazebo/README.md index 66bf24a67..81ee75763 100644 --- a/panther_gazebo/README.md +++ b/panther_gazebo/README.md @@ -18,7 +18,7 @@ The recommended method for launching the simulation is by utilizing the [simulat - `publish_robot_state` [*bool*, default: **true**]: Whether to launch the robot_state_publisher node. When set to `false`, users should publish their own robot description. - `wheel_config_path` [*string*, default: **panther_description/config/.yaml**]: Path to the wheel configuration file. If you want to use a custom configuration, you can specify the path to your custom wheel configuration file here. Please refer to the `wheel_type` parameter description for more information. - `wheel_type` [*string*, default: **WH01**]: Specify the type of wheel. If you select a value from the provided options (`WH01`, `WH02`, `WH04`), you can disregard the `wheel_config_path` and `controller_config_path` parameters. If you have custom wheels, set this parameter to `CUSTOM` and provide the necessary configurations. -- `world` [*string*, default: **-r /worlds/husarion_world.sdf**]: path to Gazebo world file used for simulation. +- `world` [*string*, default: **-r /worlds/husarion_world.sdf**]: path to Gazebo world file used for simulation. ### Changing Wheel Type diff --git a/panther_gazebo/launch/simulation.launch.py b/panther_gazebo/launch/simulation.launch.py index 76c5cd1ed..d9912a1cf 100644 --- a/panther_gazebo/launch/simulation.launch.py +++ b/panther_gazebo/launch/simulation.launch.py @@ -111,7 +111,7 @@ def generate_launch_description(): "-r ", PathJoinSubstitution( [ - FindPackageShare("husarion_office_gz"), + FindPackageShare("husarion_gz_worlds"), "worlds", "husarion_world.sdf", ], diff --git a/panther_gazebo/package.xml b/panther_gazebo/package.xml index 4f7eac314..95f39b6b1 100644 --- a/panther_gazebo/package.xml +++ b/panther_gazebo/package.xml @@ -17,7 +17,7 @@ ament_cmake controller_manager - husarion_office_gz + husarion_gz_worlds ign_ros2_control launch launch_ros From 20b8e2676b4956b35d0626d0488e31d4189b6298 Mon Sep 17 00:00:00 2001 From: rafal-gorecki Date: Mon, 6 May 2024 18:47:48 +0200 Subject: [PATCH 2/2] use new launch --- panther_description/urdf/gazebo.urdf.xacro | 2 +- panther_gazebo/README.md | 2 ++ panther_gazebo/launch/simulation.launch.py | 20 +------------------- 3 files changed, 4 insertions(+), 20 deletions(-) diff --git a/panther_description/urdf/gazebo.urdf.xacro b/panther_description/urdf/gazebo.urdf.xacro index 30fc0b6cc..a007f39ea 100644 --- a/panther_description/urdf/gazebo.urdf.xacro +++ b/panther_description/urdf/gazebo.urdf.xacro @@ -28,7 +28,7 @@ true ${battery_config['charging_time']} 2.0 - + ${battery_config['power_load']/100.0} ${battery_config['simulate_discharging']} diff --git a/panther_gazebo/README.md b/panther_gazebo/README.md index 81ee75763..7859d7bb1 100644 --- a/panther_gazebo/README.md +++ b/panther_gazebo/README.md @@ -11,6 +11,8 @@ The recommended method for launching the simulation is by utilizing the [simulat - `battery_config_path` [*string*, default: **panther_gazebo/config/battery_plugin_config.yaml**]: Path to the Ignition `LinearBatteryPlugin` configuration file. This configuration is intended for use in simulations only. For more information on how to configure this plugin, please refer to the [Linear Battery Plugin](#linear-battery-plugin) section. - `controller_config_path` [*string*, default: **panther_controller/config/_controller.yaml**]: Path to the controller configuration file. If you want to use a custom configuration, you can specify the path to your custom controller configuration file here. - `gz_bridge_config_path` [*string*, default: **panther_gazebo/config/gz_bridge.yaml**]: Path to the `parameter_bridge` configuration file. For detailed information on configuring the `parameter_bridge`, please refer to this [example](https://github.com/gazebosim/ros_gz/tree/ros2/ros_gz_bridge#example-5-configuring-the-bridge-via-yaml). +- `gz_log_level` [*[0-4]*, default: **1**]: Adjust the level of console output. +- `headless_mode` [*bool*, default: **False**]: Run the simulation in headless mode. Useful when a GUI is not needed or to reduce the amount of calculations. - `pos_x` [*float*, default: **5.0**]: spawn position **[m]** of the robot in the world in **X** direction. - `pos_y` [*float*, default: **-5.0**]: spawn position **[m]** of the robot in the world in **Y** direction. - `pos_z` [*float*, default: **0.2**]: spawn position **[m]** of the robot in the world in **Z** direction. diff --git a/panther_gazebo/launch/simulation.launch.py b/panther_gazebo/launch/simulation.launch.py index d9912a1cf..c12251015 100644 --- a/panther_gazebo/launch/simulation.launch.py +++ b/panther_gazebo/launch/simulation.launch.py @@ -104,22 +104,6 @@ def generate_launch_description(): description="Path to the parameter_bridge configuration file", ) - world_cfg = LaunchConfiguration("world") - declare_world_arg = DeclareLaunchArgument( - "world", - default_value=[ - "-r ", - PathJoinSubstitution( - [ - FindPackageShare("husarion_gz_worlds"), - "worlds", - "husarion_world.sdf", - ], - ), - ], - description="SDF world file", - ) - pose_x = LaunchConfiguration("pose_x") declare_pose_x_arg = DeclareLaunchArgument( "pose_x", @@ -167,13 +151,12 @@ def generate_launch_description(): PythonLaunchDescriptionSource( PathJoinSubstitution( [ - FindPackageShare("ros_gz_sim"), + FindPackageShare("husarion_gz_worlds"), "launch", "gz_sim.launch.py", ] ) ), - launch_arguments={"gz_args": world_cfg}.items(), ) gz_spawn_entity = Node( @@ -232,7 +215,6 @@ def generate_launch_description(): return LaunchDescription( [ - declare_world_arg, declare_pose_x_arg, declare_pose_y_arg, declare_pose_z_arg,