Skip to content

Commit

Permalink
refactor: drop ROS 2 dependency for core rai packages (#411)
Browse files Browse the repository at this point in the history
Co-authored-by: Kajetan Rachwał <[email protected]>
Co-authored-by: Bartłomiej Boczek <[email protected]>
  • Loading branch information
3 people authored Feb 7, 2025
1 parent 47d7090 commit ce4885c
Show file tree
Hide file tree
Showing 139 changed files with 336 additions and 1,535 deletions.
26 changes: 5 additions & 21 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,9 @@ repos:
hooks:
- id: shellcheck

- repo: https://github.com/pycqa/autoflake
rev: v2.3.1
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.4
hooks:
- id: autoflake
args: ["--remove-all-unused-imports", "--in-place"]

- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
args: ["--profile", "black", "--filter-files"]

- repo: https://github.com/psf/black
rev: 24.4.2
hooks:
- id: black

- repo: https://github.com/pycqa/flake8
rev: 7.1.0
hooks:
- id: flake8
args: ["--ignore=E501,E731,W503,W504,E203"]
- id: ruff
args: [--extend-select, "I,RUF022", --fix, --ignore, E731]
- id: ruff-format
12 changes: 6 additions & 6 deletions examples/agriculture-demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@
import argparse

import rclpy
from rclpy.action import ActionClient
from rclpy.callback_groups import ReentrantCallbackGroup
from rclpy.executors import MultiThreadedExecutor
from rclpy.node import Node
from std_srvs.srv import Trigger

from rai.node import RaiStateBasedLlmNode, describe_ros_image
from rai.tools.ros.native import (
GetCameraImage,
Expand All @@ -30,6 +24,12 @@
Ros2ShowMsgInterfaceTool,
)
from rai.tools.time import WaitForSecondsTool
from rclpy.action import ActionClient
from rclpy.callback_groups import ReentrantCallbackGroup
from rclpy.executors import MultiThreadedExecutor
from rclpy.node import Node
from std_srvs.srv import Trigger

from rai_interfaces.action import Task


Expand Down
1 change: 0 additions & 1 deletion examples/manipulation-demo-streamlit.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

import streamlit as st
from langchain_core.messages import AIMessage, HumanMessage, ToolMessage

from rai.agents.integrations.streamlit import get_streamlit_cb, streamlit_invoke
from rai.messages import HumanMultimodalMessage

Expand Down
1 change: 0 additions & 1 deletion examples/manipulation-demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import rclpy
import rclpy.qos
from langchain_core.messages import HumanMessage

from rai.agents.conversational_agent import create_conversational_agent
from rai.node import RaiBaseNode
from rai.tools.ros.manipulation import GetObjectPositionsTool, MoveToPointTool
Expand Down
3 changes: 1 addition & 2 deletions examples/rosbot-xl-demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
import rclpy
import rclpy.executors
import rclpy.logging
from rai_open_set_vision.tools import GetDetectionTool, GetDistanceToObjectsTool

from rai.node import RaiStateBasedLlmNode
from rai.tools.ros.native import (
GetMsgFromTopic,
Expand All @@ -35,6 +33,7 @@
Ros2RunActionAsync,
)
from rai.tools.time import WaitForSecondsTool
from rai_open_set_vision.tools import GetDetectionTool, GetDistanceToObjectsTool

p = argparse.ArgumentParser()
p.add_argument("--allowlist", type=Path, required=False, default=None)
Expand Down
4 changes: 2 additions & 2 deletions examples/taxi-demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
from langchain_community.tools.tavily_search import TavilySearchResults
from langchain_core.messages import BaseMessage, HumanMessage
from langchain_core.tools import tool
from std_msgs.msg import String

from rai.agents.conversational_agent import create_conversational_agent
from rai.tools.ros.cli import Ros2ServiceTool
from rai.tools.ros.native import Ros2PubMessageTool
from rai.utils.model_initialization import get_llm_model, get_tracing_callbacks
from std_msgs.msg import String

from rai_hmi.api import GenericVoiceNode, split_message

system_prompt = """
Expand Down
66 changes: 65 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 9 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tool.poetry]
name = "rai"
name = "rai_framework"
version = "1.0.0"
description = "RAI is a framework for building general multi-agent systems, bringing Gen AI features to ROS enabled robots."
readme = "README.md"
Expand All @@ -10,8 +10,14 @@ classifiers = [
"License :: OSI Approved :: Apache Software License",
]
package-mode = false

[tool.poetry.dependencies]
python = "^3.10, <3.13"

rai = {path = "src/rai_core", develop = true}
rai_asr = {path = "src/rai_asr", develop = true}
rai_tts = {path = "src/rai_tts", develop = true}

langchain-core = "^0.3"
langchain = "*"
langgraph = "*"
Expand Down Expand Up @@ -78,11 +84,9 @@ visualnav_transformer = { git = "https://github.com/RobotecAI/visualnav-transfor
gdown = "^5.2.0"

[build-system]
requires = ["setuptools>=42", "wheel"]
build-backend = "setuptools.build_meta"
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.isort]
profile = "black"

[tool.pytest.ini_options]
markers = [
Expand Down
1 change: 0 additions & 1 deletion src/examples/turtlebot4/turtlebot_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import rclpy.qos
import rclpy.subscription
import rclpy.task

from rai.node import RaiStateBasedLlmNode
from rai.tools.ros.native import (
GetCameraImage,
Expand Down
Loading

0 comments on commit ce4885c

Please sign in to comment.