Skip to content

Commit

Permalink
Merge panther and lynx description pkg
Browse files Browse the repository at this point in the history
  • Loading branch information
rafal-gorecki committed Nov 20, 2024
1 parent 66de8ed commit 8ce1d57
Show file tree
Hide file tree
Showing 68 changed files with 119 additions and 530 deletions.
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: check-added-large-files
# mesh files has to be taken into account
Expand Down Expand Up @@ -34,7 +34,7 @@ repos:
- id: cmake-format

- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v18.1.8
rev: v19.1.3
hooks:
- id: clang-format

Expand Down Expand Up @@ -63,7 +63,7 @@ repos:
args: [--mapping, '2', --sequence, '4', --offset, '2', --width, '100']

- repo: https://github.com/psf/black
rev: 24.8.0
rev: 24.10.0
hooks:
- id: black
args: ["--line-length=99"]
Expand All @@ -87,11 +87,11 @@ repos:

# Docs - RestructuredText hooks
- repo: https://github.com/PyCQA/doc8
rev: v1.1.1
rev: v1.1.2
hooks:
- id: doc8
args: ["--max-line-length=100", "--ignore=D001"]
exclude: ^.*\/CHANGELOG\.rst/.*$
exclude: ^.*\/CHANGELOG\.rst$

- repo: https://github.com/tier4/pre-commit-hooks-ros
rev: v0.10.0
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Launch arguments are largely common to both simulation and physical robot. Howev
||| `add_world_transform` | Adds a world frame that connects the tf trees of individual robots (useful when running multiple robots). <br/> ***bool:*** `False` |
||| `animations_config_path` | Path to a YAML file with a description of led configuration. This file includes definition of robot panels, virtual segments and default animations. <br/> ***string:*** [`{robot_model}_animations.yaml`](./husarion_ugv_lights/config) |
||| `battery_config_path` | Path to the Ignition LinearBatteryPlugin configuration file. This configuration is intended for use in simulations only. <br/> ***string:*** `None` |
||| `components_config_path` | Additional components configuration file. Components described in this file are dynamically included in robot's URDF. Available options are described in [the manual](https://husarion.com/manuals/panther/panther-options). <br/> ***string:*** [`components.yaml`](./panther_description/config/components.yaml) |
||| `components_config_path` | Additional components configuration file. Components described in this file are dynamically included in robot's URDF. Available options are described in [the manual](https://husarion.com/manuals/panther/panther-options). <br/> ***string:*** [`components.yaml`](./husarion_ugv_description/config/components.yaml) |
||| `controller_config_path` | Path to controller configuration file. A path to custom configuration can be specified here. <br/> ***string:*** [`{wheel_type}_controller.yaml`](./husarion_ugv_controller/config/) |
||| `disable_manager` | Enable or disable manager_bt_node. <br/> ***bool:*** `False` |
||| `fuse_gps` | Include GPS for data fusion. <br/> ***bool:*** `False` |
Expand All @@ -111,7 +111,7 @@ Launch arguments are largely common to both simulation and physical robot. Howev
||| `use_rviz` | Run RViz simultaneously. <br/> ***bool:*** `True` |
||| `use_sim` | Whether simulation is used. <br/> ***bool:*** `False` |
||| `user_led_animations_path` | Path to a YAML file with a description of the user-defined animations. <br/> ***string:*** `''` |
||| `wheel_config_path` | Path to wheel configuration file. <br/> ***string:*** [`{wheel_type}.yaml`](./panther_description/config) |
||| `wheel_config_path` | Path to wheel configuration file. <br/> ***string:*** [`{wheel_type}.yaml`](./husarion_ugv_description/config) |
||| `wheel_type` | Specify the wheel type. If the selected wheel type is not 'custom', the wheel_config_path and controller_config_path arguments will be automatically adjusted and can be omitted. <br/> ***string:*** `WH01` (for Panther), `WH05` (for Lynx) (choices: `WH01`, `WH02`, `WH04`, `WH05`, `custom`) |
||| `x` | Initial robot position in the global 'x' axis. <br/> ***float:*** `0.0` |
||| `y` | Initial robot position in the global 'y' axis. <br/> ***float:***` -2.0` |
Expand Down
2 changes: 1 addition & 1 deletion husarion_ugv/CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Changelog for package panther
Changelog for package husarion_ugv
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2.1.1 (2024-09-05)
Expand Down
2 changes: 1 addition & 1 deletion husarion_ugv_battery/CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Changelog for package panther_battery
Changelog for package husarion_ugv_battery
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2.1.1 (2024-09-05)
Expand Down
2 changes: 1 addition & 1 deletion husarion_ugv_bringup/CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Changelog for package panther_bringup
Changelog for package husarion_ugv_bringup
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2.1.1 (2024-09-05)
Expand Down
2 changes: 1 addition & 1 deletion husarion_ugv_controller/CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Changelog for package panther_controller
Changelog for package husarion_ugv_controller
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2.1.1 (2024-09-05)
Expand Down
2 changes: 1 addition & 1 deletion husarion_ugv_controller/CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ The default drive controller is based on [diff_drive_controller](https://control

## Changing Wheel Type

Changing wheel types is possible and can be done for both the real robot and the simulation. By default, three types of wheels are supported using the launch argument `wheel_type`. If you want to use custom wheels, all you need to do is point to the new wheel and controller configuration files using the `wheel_config_path` and `controller_config_path` parameters. These files should be based on the default files, i.e. [WH01_controller.yaml](./config/WH01_controller.yaml) and [WH01.yaml](../panther_description/config/WH01.yaml).
Changing wheel types is possible and can be done for both the real robot and the simulation. By default, three types of wheels are supported using the launch argument `wheel_type`. If you want to use custom wheels, all you need to do is point to the new wheel and controller configuration files using the `wheel_config_path` and `controller_config_path` parameters. These files should be based on the default files, i.e. [WH01_controller.yaml](./config/WH01_controller.yaml) and [WH01.yaml](../husarion_ugv_description/config/WH01.yaml).
20 changes: 6 additions & 14 deletions husarion_ugv_controller/launch/controller.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def generate_launch_description():
declare_components_config_path_arg = DeclareLaunchArgument(
"components_config_path",
default_value=PathJoinSubstitution(
[FindPackageShare("panther_description"), "config", "components.yaml"]
[FindPackageShare("husarion_ugv_description"), "config", "components.yaml"]
),
description=(
"Additional components configuration file. Components described in this file "
Expand Down Expand Up @@ -100,7 +100,7 @@ def generate_launch_description():
declare_robot_model_arg = DeclareLaunchArgument(
"robot_model",
default_value=robot_model_dict[robot_model_env],
description="Specify robot model",
description="Specify robot model.",
choices=["lynx", "panther"],
)

Expand All @@ -112,20 +112,19 @@ def generate_launch_description():
choices=["True", "true", "False", "false"],
)

robot_description_pkg = PythonExpression(["'", robot_model, "_description'"])
wheel_config_path = LaunchConfiguration("wheel_config_path")
declare_wheel_config_path_arg = DeclareLaunchArgument(
"wheel_config_path",
default_value=PathJoinSubstitution(
[
FindPackageShare(robot_description_pkg),
FindPackageShare("husario_ugv_description"),
"config",
PythonExpression(["'", wheel_type, ".yaml'"]),
]
),
description=(
"Path to wheel configuration file. By default, it is located in "
"'panther_description/config/{wheel_type}.yaml'. You can also specify the path "
"'husarion_ugv_description/config/{wheel_type}.yaml'. You can also specify the path "
"to your custom wheel configuration file here. "
),
)
Expand All @@ -143,25 +142,18 @@ def generate_launch_description():
)

# Get URDF via xacro
robot_description_pkg = PythonExpression(["'", robot_model, "_description'"])
robot_description_file = PythonExpression(["'", robot_model, ".urdf.xacro'"])
imu_pos_x = os.environ.get("ROBOT_IMU_LOCALIZATION_X", "0.168")
imu_pos_y = os.environ.get("ROBOT_IMU_LOCALIZATION_Y", "0.028")
imu_pos_z = os.environ.get("ROBOT_IMU_LOCALIZATION_Z", "0.083")
imu_rot_r = os.environ.get("ROBOT_IMU_ORIENTATION_R", "3.14")
imu_rot_p = os.environ.get("ROBOT_IMU_ORIENTATION_P", "-1.57")
imu_rot_y = os.environ.get("ROBOT_IMU_ORIENTATION_Y", "0.0")
urdf_file = PythonExpression(["'", robot_model, ".urdf.xacro'"])
robot_description_content = Command(
[
PathJoinSubstitution([FindExecutable(name="xacro")]),
" ",
PathJoinSubstitution(
[
FindPackageShare(robot_description_pkg),
"urdf",
robot_description_file,
]
),
PathJoinSubstitution([FindPackageShare("husario_ugv_description"), "urdf", urdf_file]),
" use_sim:=",
use_sim,
" wheel_config_file:=",
Expand Down
3 changes: 1 addition & 2 deletions husarion_ugv_controller/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,13 @@

<exec_depend>controller_manager</exec_depend>
<exec_depend>diff_drive_controller</exec_depend>
<exec_depend>husarion_ugv_description</exec_depend>
<exec_depend condition="$HUSARION_ROS_BUILD_TYPE == hardware">husarion_ugv_hardware_interfaces</exec_depend>
<exec_depend>imu_sensor_broadcaster</exec_depend>
<exec_depend>joint_state_broadcaster</exec_depend>
<exec_depend>launch</exec_depend>
<exec_depend>launch_ros</exec_depend>
<exec_depend>lynx_description</exec_depend>
<exec_depend>mecanum_drive_controller</exec_depend>
<exec_depend>panther_description</exec_depend>
<exec_depend>robot_state_publisher</exec_depend>
<exec_depend>xacro</exec_depend>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Changelog for package panther_description
Changelog for package husarion_ugv_description
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2.1.1 (2024-09-05)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
cmake_minimum_required(VERSION 3.10.2)
project(panther_description)
project(husarion_ugv_description)

find_package(ament_cmake REQUIRED)

install(DIRECTORY config launch meshes rviz urdf
DESTINATION share/${PROJECT_NAME})

ament_environment_hooks(
"${CMAKE_CURRENT_SOURCE_DIR}/hooks/${PROJECT_NAME}.sh.in")
ament_environment_hooks("${CMAKE_CURRENT_SOURCE_DIR}/hooks/setup_envs.sh.in")

ament_package()
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
# panther_description
# husarion_ugv_description

The package contains URDF files responsible for creating a representation of the robot by specifying the relationships and types of connections (joints) between individual links. It also contains information about the robot's mesh.

## Launch Files

- `load_urdf.launch.py` - loads the robot's URDF and creates simple bindings to display moving joints.
- `overwrite_robot_description.launch.py` - launch is able to change `robot_description` topic in runtime.
- `rviz.launch.py` - launch RViz2 with basic configuration.

## Configuration Files

- [`components.yaml`](./config/components.yaml): Allows you to quickly add visualization of sensors, TF connections and simulate their behavior in the simulator.
- [`WH01.yaml`](./config/WH01.yaml): Description of physical and visual parameters for the wheel WH01.
- [`WH02.yaml`](./config/WH02.yaml): Description of physical and visual parameters for the wheel WH02.
- [`WH04.yaml`](./config/WH04.yaml): Description of physical and visual parameters for the wheel WH04.
- [`WH05.yaml`](./config/WH05.yaml): Description of physical and visual parameters for the wheel WH05.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ wheel_separation: 0.697
mass: 3.0
inertia: { ixx: 0.022510, iyy: 0.034850, izz: 0.022510 }
inertia_y_offset: 0.0
mesh_package: panther_description
mesh_package: husarion_ugv_description
folder_path: meshes/WH01
mecanum: False
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ wheel_separation: 0.6785
mass: 2.4
inertia: { ixx: 0.010050, iyy: 0.016496, izz: 0.010068 }
inertia_y_offset: 0.0
mesh_package: panther_description
mesh_package: husarion_ugv_description
folder_path: meshes/WH02
mecanum: True
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ wheel_separation: 0.616
mass: 0.85
inertia: { ixx: 0.003099, iyy: 0.005849, izz: 0.003101 }
inertia_y_offset: 0.0
mesh_package: panther_description
mesh_package: husarion_ugv_description
folder_path: meshes/WH04
mecanum: False
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ wheel_separation: 0.45
mass: 2.5
inertia: { ixx: 0.014738, iyy: 0.0261, izz: 0.014738 }
inertia_y_offset: 0.0
mesh_package: lynx_description
mesh_package: husarion_ugv_description
folder_path: meshes/WH05
mecanum: False
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# By default panther is loaded without any components.
# By default Husarion UGV is loaded without any components.

components: []

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,11 @@ def generate_launch_description():
declare_components_config_path_arg = DeclareLaunchArgument(
"components_config_path",
default_value=PathJoinSubstitution(
[FindPackageShare("lynx_description"), "config", "components.yaml"]
[FindPackageShare("husarion_ugv_description"), "config", "components.yaml"]
),
description=(
"Additional components configuration file. Components described in this file "
"are dynamically included in Lynx's urdf."
"Lynx options are described here "
"https://husarion.com/manuals/lynx/lynx-options/"
"Specify file which contains components. These components will be included in URDF."
"Available options can be found in manuals: https://husarion.com/manuals"
),
)

Expand Down Expand Up @@ -91,6 +89,16 @@ def generate_launch_description():
description="Add namespace to all launched nodes.",
)

robot_model = LaunchConfiguration("robot_model")
robot_model_dict = {"LNX": "lynx", "PTH": "panther"}
robot_model_env = os.environ.get("ROBOT_MODEL", default="PTH")
declare_robot_model_arg = DeclareLaunchArgument(
"robot_model",
default_value=robot_model_dict[robot_model_env],
description="Specify robot model.",
choices=["lynx", "panther"],
)

use_sim = LaunchConfiguration("use_sim")
declare_use_sim_arg = DeclareLaunchArgument(
"use_sim",
Expand All @@ -104,27 +112,28 @@ def generate_launch_description():
"wheel_config_path",
default_value=PathJoinSubstitution(
[
FindPackageShare("lynx_description"),
FindPackageShare("husarion_ugv_description"),
"config",
PythonExpression(["'", wheel_type, ".yaml'"]),
]
),
description=(
"Path to wheel configuration file. By default, it is located in "
"'lynx_description/config/{wheel_type}.yaml'. You can also specify the path "
"'husarion_ugv_description/config/{wheel_type}.yaml'. You can also specify the path "
"to your custom wheel configuration file here. "
),
)

default_wheel_type = {"lynx": "WH05", "panther": "WH01"}
declare_wheel_type_arg = DeclareLaunchArgument(
"wheel_type",
default_value="WH05",
default_value=PythonExpression([f"{default_wheel_type}['", robot_model, "']"]),
description=(
"Specify the wheel type. If the selected wheel type is not 'custom', "
"the 'wheel_config_path' and 'controller_config_path' arguments will be "
"automatically adjusted and can be omitted."
),
choices=["WH05", "custom"],
choices=["WH01", "WH02", "WH04", "WH05", "custom"],
)

# Get URDF via xacro
Expand All @@ -134,13 +143,12 @@ def generate_launch_description():
imu_rot_r = os.environ.get("ROBOT_IMU_ORIENTATION_R", "3.14")
imu_rot_p = os.environ.get("ROBOT_IMU_ORIENTATION_P", "-1.57")
imu_rot_y = os.environ.get("ROBOT_IMU_ORIENTATION_Y", "0.0")
urdf_file = PythonExpression(["'", robot_model, ".urdf.xacro'"])
robot_description_content = Command(
[
PathJoinSubstitution([FindExecutable(name="xacro")]),
" ",
PathJoinSubstitution(
[FindPackageShare("lynx_description"), "urdf", "lynx.urdf.xacro"]
),
PathJoinSubstitution([FindPackageShare("husario_ugv_description"), "urdf", urdf_file]),
" use_sim:=",
use_sim,
" wheel_config_file:=",
Expand Down Expand Up @@ -185,6 +193,7 @@ def generate_launch_description():
declared_add_wheel_joints_arg,
declare_battery_config_path_arg,
declare_components_config_path_arg,
declare_robot_model_arg, # robot_model is used by wheel_type
declare_wheel_type_arg, # wheel_type is used by controller_config_path
declare_controller_config_path_arg,
declare_namespace_arg,
Expand Down
Loading

0 comments on commit 8ce1d57

Please sign in to comment.