Skip to content

Commit ce4885c

Browse files
maciejmajekrachwalkboczekbartek
authored
refactor: drop ROS 2 dependency for core rai packages (#411)
Co-authored-by: Kajetan Rachwał <[email protected]> Co-authored-by: Bartłomiej Boczek <[email protected]>
1 parent 47d7090 commit ce4885c

File tree

139 files changed

+336
-1535
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+336
-1535
lines changed

.pre-commit-config.yaml

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -23,25 +23,9 @@ repos:
2323
hooks:
2424
- id: shellcheck
2525

26-
- repo: https://github.com/pycqa/autoflake
27-
rev: v2.3.1
26+
- repo: https://github.com/astral-sh/ruff-pre-commit
27+
rev: v0.9.4
2828
hooks:
29-
- id: autoflake
30-
args: ["--remove-all-unused-imports", "--in-place"]
31-
32-
- repo: https://github.com/pycqa/isort
33-
rev: 5.13.2
34-
hooks:
35-
- id: isort
36-
args: ["--profile", "black", "--filter-files"]
37-
38-
- repo: https://github.com/psf/black
39-
rev: 24.4.2
40-
hooks:
41-
- id: black
42-
43-
- repo: https://github.com/pycqa/flake8
44-
rev: 7.1.0
45-
hooks:
46-
- id: flake8
47-
args: ["--ignore=E501,E731,W503,W504,E203"]
29+
- id: ruff
30+
args: [--extend-select, "I,RUF022", --fix, --ignore, E731]
31+
- id: ruff-format

examples/agriculture-demo.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,6 @@
1515
import argparse
1616

1717
import rclpy
18-
from rclpy.action import ActionClient
19-
from rclpy.callback_groups import ReentrantCallbackGroup
20-
from rclpy.executors import MultiThreadedExecutor
21-
from rclpy.node import Node
22-
from std_srvs.srv import Trigger
23-
2418
from rai.node import RaiStateBasedLlmNode, describe_ros_image
2519
from rai.tools.ros.native import (
2620
GetCameraImage,
@@ -30,6 +24,12 @@
3024
Ros2ShowMsgInterfaceTool,
3125
)
3226
from rai.tools.time import WaitForSecondsTool
27+
from rclpy.action import ActionClient
28+
from rclpy.callback_groups import ReentrantCallbackGroup
29+
from rclpy.executors import MultiThreadedExecutor
30+
from rclpy.node import Node
31+
from std_srvs.srv import Trigger
32+
3333
from rai_interfaces.action import Task
3434

3535

examples/manipulation-demo-streamlit.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
import streamlit as st
1818
from langchain_core.messages import AIMessage, HumanMessage, ToolMessage
19-
2019
from rai.agents.integrations.streamlit import get_streamlit_cb, streamlit_invoke
2120
from rai.messages import HumanMultimodalMessage
2221

examples/manipulation-demo.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import rclpy
1818
import rclpy.qos
1919
from langchain_core.messages import HumanMessage
20-
2120
from rai.agents.conversational_agent import create_conversational_agent
2221
from rai.node import RaiBaseNode
2322
from rai.tools.ros.manipulation import GetObjectPositionsTool, MoveToPointTool

examples/rosbot-xl-demo.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
import rclpy
1919
import rclpy.executors
2020
import rclpy.logging
21-
from rai_open_set_vision.tools import GetDetectionTool, GetDistanceToObjectsTool
22-
2321
from rai.node import RaiStateBasedLlmNode
2422
from rai.tools.ros.native import (
2523
GetMsgFromTopic,
@@ -35,6 +33,7 @@
3533
Ros2RunActionAsync,
3634
)
3735
from rai.tools.time import WaitForSecondsTool
36+
from rai_open_set_vision.tools import GetDetectionTool, GetDistanceToObjectsTool
3837

3938
p = argparse.ArgumentParser()
4039
p.add_argument("--allowlist", type=Path, required=False, default=None)

examples/taxi-demo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
from langchain_community.tools.tavily_search import TavilySearchResults
2121
from langchain_core.messages import BaseMessage, HumanMessage
2222
from langchain_core.tools import tool
23-
from std_msgs.msg import String
24-
2523
from rai.agents.conversational_agent import create_conversational_agent
2624
from rai.tools.ros.cli import Ros2ServiceTool
2725
from rai.tools.ros.native import Ros2PubMessageTool
2826
from rai.utils.model_initialization import get_llm_model, get_tracing_callbacks
27+
from std_msgs.msg import String
28+
2929
from rai_hmi.api import GenericVoiceNode, split_message
3030

3131
system_prompt = """

poetry.lock

Lines changed: 65 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tool.poetry]
2-
name = "rai"
2+
name = "rai_framework"
33
version = "1.0.0"
44
description = "RAI is a framework for building general multi-agent systems, bringing Gen AI features to ROS enabled robots."
55
readme = "README.md"
@@ -10,8 +10,14 @@ classifiers = [
1010
"License :: OSI Approved :: Apache Software License",
1111
]
1212
package-mode = false
13+
1314
[tool.poetry.dependencies]
1415
python = "^3.10, <3.13"
16+
17+
rai = {path = "src/rai_core", develop = true}
18+
rai_asr = {path = "src/rai_asr", develop = true}
19+
rai_tts = {path = "src/rai_tts", develop = true}
20+
1521
langchain-core = "^0.3"
1622
langchain = "*"
1723
langgraph = "*"
@@ -78,11 +84,9 @@ visualnav_transformer = { git = "https://github.com/RobotecAI/visualnav-transfor
7884
gdown = "^5.2.0"
7985

8086
[build-system]
81-
requires = ["setuptools>=42", "wheel"]
82-
build-backend = "setuptools.build_meta"
87+
requires = ["poetry-core>=1.0.0"]
88+
build-backend = "poetry.core.masonry.api"
8389

84-
[tool.isort]
85-
profile = "black"
8690

8791
[tool.pytest.ini_options]
8892
markers = [

src/examples/turtlebot4/turtlebot_demo.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import rclpy.qos
2424
import rclpy.subscription
2525
import rclpy.task
26-
2726
from rai.node import RaiStateBasedLlmNode
2827
from rai.tools.ros.native import (
2928
GetCameraImage,

0 commit comments

Comments
 (0)