From fce22bf4b0e2da13f023dc6884e51b90a146e831 Mon Sep 17 00:00:00 2001 From: Matthijs van der Burgh Date: Wed, 20 Sep 2023 11:49:28 +0200 Subject: [PATCH] (pykdl_ros) add typing to internal variable --- pykdl_ros/src/pykdl_ros/__init__.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pykdl_ros/src/pykdl_ros/__init__.py b/pykdl_ros/src/pykdl_ros/__init__.py index e332164..11396c0 100644 --- a/pykdl_ros/src/pykdl_ros/__init__.py +++ b/pykdl_ros/src/pykdl_ros/__init__.py @@ -23,8 +23,8 @@ def __init__(self, frame: kdl.Frame, stamp: Time, frame_id: str): assert isinstance(frame, kdl.Frame) assert isinstance(stamp, Time) assert isinstance(frame_id, str) - self.frame = frame - self.header = Header(frame_id=frame_id, stamp=stamp) + self.frame: kdl.Frame = frame + self.header: Header = Header(frame_id=frame_id, stamp=stamp) def __repr__(self): pos = f"(x={self.frame.p.x()}, y={self.frame.p.y()}, z={self.frame.p.z()})" @@ -95,8 +95,8 @@ def __init__(self, twist: kdl.Twist, stamp: Time, frame_id: str): assert isinstance(twist, kdl.Twist) assert isinstance(stamp, Time) assert isinstance(frame_id, str) - self.twist = twist - self.header = Header(frame_id=frame_id, stamp=stamp) + self.twist: kdl.Twist = twist + self.header: Header = Header(frame_id=frame_id, stamp=stamp) def __repr__(self): vel = f"(x={self.twist.vel.x()}, y={self.twist.vel.y()}, z={self.twist.vel.z()})" @@ -166,8 +166,8 @@ def __init__(self, vector: kdl.Vector, stamp: Time, frame_id: str): assert isinstance(vector, kdl.Vector) assert isinstance(stamp, Time) assert isinstance(frame_id, str) - self.vector = vector - self.header = Header(frame_id=frame_id, stamp=stamp) + self.vector: kdl.Vector = vector + self.header: Header = Header(frame_id=frame_id, stamp=stamp) def __repr__(self): xyz = f"(x={self.vector.x()}, y={self.vector.y()}, z={self.vector.z()})" @@ -239,8 +239,8 @@ def __init__(self, wrench: kdl.Wrench, stamp: Time, frame_id: str): assert isinstance(wrench, kdl.Wrench) assert isinstance(stamp, Time) assert isinstance(frame_id, str) - self.wrench = wrench - self.header = Header(frame_id=frame_id, stamp=stamp) + self.wrench: kdl.Wrench = wrench + self.header: Header = Header(frame_id=frame_id, stamp=stamp) def __repr__(self): force = f"(x={self.wrench.force.x()}, y={self.wrench.force.y()}, z={self.wrench.force.z()})"