8000 refactor: internal api by maciejmajek · Pull Request #520 · RobotecAI/rai · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

refactor: internal api #520

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and conta 8000 ct its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions src/rai_asr/rai_asr/agents/asr_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@
import numpy as np
from numpy.typing import NDArray
from rai.agents.base import BaseAgent
from rai.communication import (
from rai.communication.ros2 import (
ROS2ARIConnector,
ROS2ARIMessage,
ROS2HRIConnector,
ROS2HRIMessage,
)
from rai.communication.sound_device import (
SoundDeviceConfig,
SoundDeviceConnector,
SoundDeviceMessage,
Expand Down Expand Up @@ -80,13 +82,12 @@ def __init__(
)
ros2_hri_connector = ROS2HRIConnector(ros2_name, targets=["/from_human"])
ros2_ari_connector = ROS2ARIConnector(ros2_name + "ari")
super().__init__(
connectors={
"microphone": microphone,
"ros2_hri": ros2_hri_connector,
"ros2_ari": ros2_ari_connector,
}
)
self.connectors = {
"microphone": microphone,
"ros2_hri": ros2_hri_connector,
"ros2_ari": ros2_ari_connector,
}
super().__init__()
self.should_record_pipeline: List[BaseVoiceDetectionModel] = []
self.should_stop_pipeline: List[BaseVoiceDetectionModel] = []

Expand Down
22 changes: 0 additions & 22 deletions src/rai_core/rai/communication/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,6 @@
from .ari_connector import ARIConnector, ARIMessage
from .base_connector import BaseConnector, BaseMessage
from .hri_connector import HRIConnector, HRIMessage
from .ros2 import (
ROS2ARIConnector,
ROS2ARIMessage,
ROS2HRIConnector,
ROS2HRIMessage,
TopicConfig,
)
from .sound_device.connector import (
SoundDeviceConfig,
SoundDeviceConnector,
SoundDeviceError,
SoundDeviceMessage,
)

__all__ = [
"ARIConnector",
Expand All @@ -36,13 +23,4 @@
"BaseMessage",
"HRIConnector",
"HRIMessage",
"ROS2ARIConnector",
"ROS2ARIMessage",
"ROS2HRIConnector",
"ROS2HRIMessage",
"SoundDeviceConfig",
"SoundDeviceConnector",
"SoundDeviceError",
"SoundDeviceMessage",
"TopicConfig",
]
12 changes: 2 additions & 10 deletions src/rai_core/rai/communication/ros2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,17 @@
# limitations under the License.

from .api import (
ConfigurableROS2TopicAPI,
IROS2Message,
ROS2ActionAPI,
ROS2ServiceAPI,
ROS2TopicAPI,
TopicConfig,
IROS2Message, # TODO: IROS2Message should not be a part of the public API
TopicConfig, # TODO: TopicConfig should not be a part of the public API
)
from .connectors import ROS2ARIConnector, ROS2HRIConnector
from .messages import ROS2ARIMessage, ROS2HRIMessage

__all__ = [
"ConfigurableROS2TopicAPI",
"IROS2Message",
"ROS2ARIConnector",
"ROS2ARIMessage",
"ROS2ActionAPI",
"ROS2HRIConnector",
"ROS2HRIMessage",
"ROS2ServiceAPI",
"ROS2TopicAPI",
"TopicConfig",
]
27 changes: 27 additions & 0 deletions src/rai_core/rai/communication/ros2/api/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright (C) 2025 Robotec.AI
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from .action import ROS2ActionAPI
from .base import IROS2Message
from .service import ROS2ServiceAPI
from .topic import ConfigurableROS2TopicAPI, ROS2TopicAPI, TopicConfig

__all__ = [
"ConfigurableROS2TopicAPI",
"IROS2Message",
"ROS2ActionAPI",
"ROS2ServiceAPI",
"ROS2TopicAPI",
"TopicConfig",
]
Loading
0