"""Launch PS5 DualSense gamepad teleoperation node."""

from launch import LaunchDescription
from launch_ros.actions import Node
from ament_index_python.packages import get_package_share_directory
import os


def generate_launch_description():
    """Generate ROS2 launch description for gamepad teleop."""
    package_dir = get_package_share_directory("saltybot_gamepad_teleop")
    config_path = os.path.join(package_dir, "config", "gamepad_config.yaml")

    gamepad_node = Node(
        package="saltybot_gamepad_teleop",
        executable="gamepad_teleop_node",
        name="gamepad_teleop_node",
        output="screen",
        parameters=[config_path],
        remappings=[],
    )

    return LaunchDescription([gamepad_node])
