File tree Expand file tree Collapse file tree
lbr_demos/lbr_moveit/lbr_moveit Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- from dataclasses import dataclass
1+ from dataclasses import dataclass , field
22
33import numpy as np
44import rclpy
@@ -25,8 +25,8 @@ class Rotation:
2525 z : float = 0.0
2626
2727 joints : list
28- translation : Translation = Translation ( )
29- rotation : Rotation = Rotation ( )
28+ translation : Translation = field ( default_factory = Translation )
29+ rotation : Rotation = field ( default_factory = Rotation )
3030
3131 @dataclass
3232 class KeyboardLayout :
@@ -47,9 +47,9 @@ class Z:
4747 increase : str = "q"
4848 decrease : str = "e"
4949
50- x : X = X ( )
51- y : Y = Y ( )
52- z : Z = Z ( )
50+ x : X = field ( default_factory = X )
51+ y : Y = field ( default_factory = Y )
52+ z : Z = field ( default_factory = Z )
5353
5454 @dataclass
5555 class Rotation :
@@ -68,13 +68,13 @@ class Z:
6868 increase : str = "y"
6969 decrease : str = "h"
7070
71- x : X = X ( )
72- y : Y = Y ( )
73- z : Z = Z ( )
71+ x : X = field ( default_factory = X )
72+ y : Y = field ( default_factory = Y )
73+ z : Z = field ( default_factory = Z )
7474
7575 joints : list
76- translation : Translation = Translation ( )
77- rotation : Rotation = Rotation ( )
76+ translation : Translation = field ( default_factory = Translation )
77+ rotation : Rotation = field ( default_factory = Rotation )
7878 escape : str = "Key.esc"
7979 pause : str = "p"
8080 reverse_joints : str = "r"
You can’t perform that action at this time.
0 commit comments