1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414
15+ from __future__ import annotations
16+
1517# Base Classes
1618from abc import ABC
1719from abc import ABCMeta
1820from abc import abstractmethod
1921from typing import Any
2022from typing import ClassVar
2123from typing import Generic
24+ from typing import TYPE_CHECKING
2225from typing import TypeVar
2326
2427
28+ if TYPE_CHECKING :
29+ from action_msgs .srv ._cancel_goal import CancelGoal
30+ from action_msgs .msg ._goal_status_array import GoalStatusArray
31+
32+
2533class MessageTypeSupportMeta (ABCMeta ):
2634
2735 _CREATE_ROS_MESSAGE : ClassVar [Any ]
@@ -69,9 +77,24 @@ class BaseService(ABC, Generic[RequestT, ResponseT], metaclass=ServiceTypeSuppor
6977 Response : type [ResponseT ]
7078
7179
80+ SendGoalServiceT = TypeVar ('SendGoalServiceT' )
81+ GetResultServiceT = TypeVar ('GetResultServiceT' )
82+ FeedbackMessageT = TypeVar ('FeedbackMessageT' )
83+
84+
85+ class BaseImpl (ABC , Generic [SendGoalServiceT , GetResultServiceT , FeedbackMessageT ]):
86+
87+ SendGoalService : type [SendGoalServiceT ]
88+ GetResultService : type [GetResultServiceT ]
89+ FeedbackMessage : type [FeedbackMessageT ]
90+ CancelGoalService : type [CancelGoal ]
91+ GoalStatusMessage : type [GoalStatusArray ]
92+
93+
7294GoalT = TypeVar ('GoalT' )
7395ResultT = TypeVar ('ResultT' )
7496FeedbackT = TypeVar ('FeedbackT' )
97+ ImplT = TypeVar ('ImplT' , bound = BaseImpl [Any , Any , Any ])
7598
7699
77100class ActionTypeSupportMeta (ABCMeta ):
@@ -83,8 +106,10 @@ class ActionTypeSupportMeta(ABCMeta):
83106 def __import_type_support__ (cls ) -> None : ...
84107
85108
86- class BaseAction (ABC , Generic [GoalT , ResultT , FeedbackT ], metaclass = ActionTypeSupportMeta ):
109+ class BaseAction (ABC , Generic [GoalT , ResultT , FeedbackT , ImplT ], metaclass = ActionTypeSupportMeta ):
87110
88111 Goal : type [GoalT ]
89112 Result : type [ResultT ]
90113 Feedback : type [FeedbackT ]
114+
115+ Impl : type [ImplT ]
0 commit comments