Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact 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

refactor: demos rewrite, rai_interfaces import guards #449

Open
wants to merge 15 commits into
base: development
Choose a base branch
from

Conversation

maciejmajek
Copy link
Member

@maciejmajek maciejmajek commented Mar 7, 2025

Purpose

Using RAI as a standalone framework is unfeasible due to many custom ROS 2 dependencies. Some of the parts of RAI could already be used in a pip install rai installation.

Proposed Changes

This PR adds various changes including:

  • Guarding the rai_interfaces, rai_openset ... imports
  • Removing deprecated files
  • Rewriting demos

Issues

  • Links to relevant issues

Testing

  • How was it tested, what were the results?

@maciejmajek maciejmajek changed the title refactor: allow "import rai" in unsourced environment refactor: demos rewrite, rai_interfaces import guards Mar 7, 2025
@maciejmajek maciejmajek requested a review from boczekbartek March 7, 2025 23:19
@boczekbartek
Copy link
Member

@maciejmajek Could you please resolve confilicts?

Copy link
Member

@boczekbartek boczekbartek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maciejmajek
This PR introduces major changes. I left some initial questions about the plan support rai features.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing this file will break turtlebot_demo, so I think it should be refactored as well

@@ -114,32 +81,31 @@ def main(allowlist: Optional[Path] = None):
(0.92, 1.01, 0.0)
"""

node = RaiStateBasedLlmNode(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maciejmajek
I can see that RaiStateBasedLlmNode has been replaced with a simpler agent.
Could you please clarify which of it's capabilities are planned to be added again and which will be dropped? Here is the overview of features:

  • robot state
    - observing a ros2 topic and postprocessing/interpreting it's output. Adding the output of interpretation to the agent history.
    - observing rosout with rai_state_logs node
  • ros2 action interface - this node had ros2 action interface, which could be used to send a mission to the robot. Then summary of langgraph agent has been posted as ros2 action feedbacks

Copy link
Member Author

@maciejmajek maciejmajek Mar 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

robot state

I think we can reintroduce it either by using a separate node in a graph, or by specifying topic name in connector sources.

ros2 action interface

The action interface can be reintroduced with support for actions in connectors. If you feel that this is important, we can add it to examples catalog showcasing ros2 usage using action server api from rclpy

Copy link
Member

@boczekbartek boczekbartek Mar 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can reintroduce it either by using a separate node in a graph, or by specifying topic name in connector sources.

I think it'll require both, because state should be received (connector) and then placed in the LLM context (node in the graph). In general, it sounds like a good idea, if you don't plan to refactor it in this PR, how about adding an Issue that has to be resolved before the next release to add it again?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please clarify which features of rai_whoami are planned to be still supported in rai?

  • RAG for documentation
  • "embodiment" in system prompt using documentation and images
  • setting robot constitution

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that the system prompt propagation should be done via ros2 or any other communication protocol at the moment. Right now I find it easier to use text files, but in the future we could build a specific database with system prompt versioning.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • I think the design can be changed to the easier one (for example text files instead of ros2 node).
    However my question is more about removing/leaving functionalities:
  • automatic creation of the system prompt using documents and images (can be used to create a system prompt in a file)
  • RAG for robot documentation (I think it might be too much for the rai_core, so I think rai_whoami package might be a good place for it. ros interface is up to discussion, probably RAG can be queried directly in the tool call.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants