Skip to content

fix: correct dataclass instantiation bugs in GrpFault and GrpStatus#2

Open
juelg wants to merge 1 commit intoPhilNad:mainfrom
RobotControlStack:main
Open

fix: correct dataclass instantiation bugs in GrpFault and GrpStatus#2
juelg wants to merge 1 commit intoPhilNad:mainfrom
RobotControlStack:main

Conversation

@juelg
Copy link
Copy Markdown

@juelg juelg commented Apr 8, 2026

Two bugs caused GripperFault and GripperStatus to never be properly instantiated:

  • GripperStatus.fault used a mutable dataclass instance as a default value directly, which is invalid in Python dataclasses. Fixed by adding = False defaults to all GripperFault fields and using field(default_factory=GripperFault) instead.
  • read_status assigned the class objects themselves (GripperFault, GripperStatus) rather than instances, causing all field assignments to mutate class-level attributes instead of instance attributes. Fixed by constructing both objects properly via their constructors.

…Status

Two bugs caused GripperFault and GripperStatus to never be properly
instantiated:

- `GripperStatus.fault` used a mutable dataclass instance as a default
  value directly, which is invalid in Python dataclasses. Fixed by adding
  `= False` defaults to all `GripperFault` fields and using
  `field(default_factory=GripperFault)` instead.
- `read_status` assigned the class objects themselves (`GripperFault`,
  `GripperStatus`) rather than instances, causing all field assignments to
  mutate class-level attributes instead of instance attributes. Fixed by
  constructing both objects properly via their constructors.
@juelg juelg changed the title fix: correct dataclass instantiation bugs in GripperFault and Gripper… fix: correct dataclass instantiation bugs in GrpFault and GrpStatus Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant