Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ros2 lynx sim #414

Merged
merged 19 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,15 @@ Launch arguments are largely common to both simulation and physical robot. Howev
| 🤖🖥️ | `localization_mode` | Specifies the localization mode: <br/>- 'relative' `odometry/filtered` data is relative to the initial position and orientation. <br/>- 'enu' `odometry/filtered` data is relative to initial position and ENU (East North Up) orientation. <br/> ***string:*** `relative` (choices: `relative`, `enu`) |
| 🤖🖥️ | `namespace` | Add namespace to all launched nodes. <br/> ***string:*** `env(ROBOT_NAMESPACE)` |
| 🤖🖥️ | `publish_robot_state` | Whether to publish the default Panther robot description. <br/> ***bool:*** `True` |
| 🖥️ | `robots` | The list of the robots spawned in the simulation e.g. `robots:='robot1={x: 1.0, y: -2.0}; robot2={x: 1.0, y: -4.0}'` <br/> ***string:*** `''` |
| 🖥️ | `robot_configuration` | Path to robot configuration YAML file. <br/> ***string:*** [`configuration.yaml`](panther_gazebo/config/configuration.yaml) |
| 🖥️ | `robot_model` | Specify robot model type. <br/> ***string:*** `env(ROBOT_MODEL)` if not specified `panther` (choices: `lynx`, `panther`) |
| 🤖🖥️ | `safety_bt_project_path` | Path to BehaviorTree project file, responsible for safety and shutdown management. <br/> ***string:*** [`PantherSafetyBT.btproj`](./panther_manager/behavior_trees/PantherSafetyBT.btproj) |
| 🤖🖥️ | `shutdown_hosts_config_path` | Path to file with list of hosts to request shutdown. <br/> ***string:*** [`shutdown_hosts_config.yaml`](./panther_manager/config/shutdown_hosts_config.yaml) |
| 🤖🖥️ | `use_ekf` | Enable or disable EKF. <br/> ***bool:*** `True` |
| 🤖🖥️ | `use_sim` | Whether simulation is used. <br/> ***bool:*** `False` |
| 🤖🖥️ | `user_led_animations_file` | 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_type` | Type of wheel. If you choose a value from the preset options ('WH01', 'WH02', 'WH04'), you can ignore the 'wheel_config_path' and 'controller_config_path' parameters. For custom wheels, please define these parameters to point to files that accurately describe the custom wheels. <br/> ***string:*** `WH01` (choices: `WH01`, `WH02`, `WH04`, `custom`) |
| 🤖🖥️ | `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` (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` |
| 🖥️ | `z` | Initial robot position in the global 'z' axis. <br/> ***float:*** `0.2` |
Expand Down
1 change: 1 addition & 0 deletions lynx_description/config/WH05.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ inertia: { ixx: 0.014738, iyy: 0.0261, izz: 0.014738 }
inertia_y_offset: 0.0
mesh_package: lynx_description
folder_path: meshes/WH05
mecanum: False
3 changes: 3 additions & 0 deletions lynx_description/urdf/gazebo.urdf.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
<parameters>${config_file}</parameters>
<ros>
<namespace>${namespace}</namespace>
<remapping>gz_ros2_control/e_stop:=hardware/e_stop</remapping>
<remapping>gz_ros2_control/e_stop_reset:=hardware/e_stop_reset</remapping>
<remapping>gz_ros2_control/e_stop_trigger:=hardware/e_stop_trigger</remapping>
<remapping>imu_broadcaster/imu:=imu/data</remapping>
<remapping>drive_controller/cmd_vel_unstamped:=cmd_vel</remapping>
<remapping>drive_controller/odom:=odometry/wheels</remapping>
Expand Down
5 changes: 3 additions & 2 deletions lynx_description/urdf/lynx_macro.urdf.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@
<ros2_control name="${ns}lynx_system" type="system">
<hardware>
<xacro:if value="${use_sim}">
<plugin>ign_ros2_control/IgnitionSystem</plugin>
<plugin>panther_gazebo/GzPantherSystem</plugin>
<param name="e_stop_initial_state">true</param>
</xacro:if>

<xacro:unless value="$(arg use_sim)">
Expand Down Expand Up @@ -139,7 +140,7 @@
</xacro:if>
</ros2_control>

<xacro:unless value="$(arg use_sim)">
<xacro:unless value="${use_sim}">
<ros2_control name="${ns}imu" type="sensor">
<hardware>
<plugin>panther_hardware_interfaces/PantherImuSensor</plugin>
Expand Down
7 changes: 4 additions & 3 deletions panther_bringup/launch/bringup.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
PathJoinSubstitution,
)
from launch_ros.substitutions import FindPackageShare
from panther_utils.welcomeMsg import welcomeMsg
from panther_utils.messages import welcome_msg


def generate_launch_description():
Expand All @@ -51,9 +51,10 @@ def generate_launch_description():
choices=["True", "true", "False", "false"],
)

robot_model = EnvironmentVariable("ROBOT_MODEL", default_value="panther")
KmakD marked this conversation as resolved.
Show resolved Hide resolved
serial_no = EnvironmentVariable(name="PANTHER_SERIAL_NO", default_value="----")
panther_version = EnvironmentVariable(name="PANTHER_ROBOT_VERSION", default_value="1.0")
KmakD marked this conversation as resolved.
Show resolved Hide resolved
welcome_msg = welcomeMsg(serial_no, panther_version)
welcome_info = welcome_msg(robot_model, serial_no, panther_version)

controller_launch = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
Expand Down Expand Up @@ -129,7 +130,7 @@ def generate_launch_description():
declare_disable_manager_arg,
declare_namespace_arg,
declare_use_ekf_arg,
welcome_msg,
welcome_info,
controller_launch,
system_monitor_launch,
delayed_action,
Expand Down
9 changes: 4 additions & 5 deletions panther_controller/launch/controller.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,11 @@ def generate_launch_description():
"wheel_type",
default_value="WH01",
description=(
"Type of wheel. If you choose a value from the preset options ('WH01', 'WH02',"
" 'WH04'), you can ignore the 'wheel_config_path' and 'controller_config_path'"
" parameters. For custom wheels, please define these parameters to point to files that"
" accurately describe the custom wheels."
"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=["WH01", "WH02", "WH04", "custom"],
choices=["WH01", "WH02", "WH04", "WH05", "custom"],
)

# Get URDF via xacro
Expand Down
7 changes: 3 additions & 4 deletions panther_description/launch/load_urdf.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,9 @@ def generate_launch_description():
"wheel_type",
default_value="WH01",
description=(
"Type of wheel. If you choose a value from the preset options ('WH01', 'WH02',"
" 'WH04'), you can ignore the 'wheel_config_path' and 'controller_config_path'"
" parameters. For custom wheels, please define these parameters to point to files that"
" accurately describe the custom wheels."
"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."
KmakD marked this conversation as resolved.
Show resolved Hide resolved
),
choices=["WH01", "WH02", "WH04", "custom"],
)
Expand Down
4 changes: 2 additions & 2 deletions panther_description/urdf/panther_macro.urdf.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<param name="e_stop_initial_state">true</param>
</xacro:if>

<xacro:unless value="$(arg use_sim)">
<xacro:unless value="${use_sim}">
<plugin>panther_hardware_interfaces/PantherSystem</plugin>

<param name="panther_version">${panther_version}</param>
Expand Down Expand Up @@ -143,7 +143,7 @@
</xacro:if>
</ros2_control>

<xacro:unless value="$(arg use_sim)">
<xacro:unless value="${use_sim}">
<ros2_control name="${ns}imu" type="sensor">
<hardware>
<plugin>panther_hardware_interfaces/PantherImuSensor</plugin>
Expand Down
14 changes: 14 additions & 0 deletions panther_gazebo/config/configuration.yaml
KmakD marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# The minimal configuration file with the default values.
# namespace: (optional - without this element namespace will not be provided)
# robot_model: panther
# init_pose: [0.0, 0.0, 0.0]
# init_rotation: [0.0, 0.0, 0.0]
# configuration:
# wheel_type: WH01

panther:
robot_model: panther
init_pose: [0.0, -2.0, 0.0]
init_rotation: [0.0, 0.0, 0.0]
configuration:
wheel_type: WH01
122 changes: 0 additions & 122 deletions panther_gazebo/launch/simulate_multiple_robots.launch.py

This file was deleted.

Loading