Skip to content

PS4 DualShock client fails to import on Python 3.11 and newer #4023

Backlog

Description

@sylvesterkaczmarek

[written by AI]

Description

Importing the PS4 DualShock Python client on Python 3.11+ fails because PS4DualShock uses mutable dataclass instances as field defaults. On older Python versions, those defaults are shared between configurations. The teleop constructor also shares a default configuration across instances.

Reproduction

from moveit.servo_client.devices.ps4_dualshock import PS4DualShock

Expected behavior

The module imports successfully and each default configuration owns its axis/button mappings.

Actual behavior

ValueError: mutable default <class '...DualShockAxes'> for field Axes is not allowed: use default_factory.

Environment

Reproduced at main (5399d29) using Python 3.12 with ROS imports stubbed for isolated testing. No robot or running ROS node is needed to reproduce the dataclass failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions