Project Icon

rosa

基于自然语言的ROS机器人控制代理

ROSA是一款为ROS1和ROS2机器人系统开发的AI代理。它通过自然语言处理技术实现对话式机器人控制和管理。ROSA具备系统报告生成、日志分析和参数设置等功能,可适配多种机器人平台。作为机器人研发的实用工具,ROSA正在开发多模态模型和语音控制等新特性。


ROSA - Robot Operating System Agent

ROSA is an AI Agent designed to interact with ROS-based robotics systems using natural language queries.

GitHub Actions Workflow Status Static Badge Static Badge Static Badge PyPI - License PyPI - Version PyPI - Downloads SLIM

ROSA is an AI agent that can be used to interact with ROS1 and ROS2 systems in order to carry out various tasks. It is built using the open-source Langchain framework, and can be adapted to work with different robots and environments, making it a versatile tool for robotics research and development.

Features and Roadmap

  • Support for both ROS1 and ROS2
  • Generate system reports using fuzzy templates
  • Read, parse, and summarize ROS log files
  • Use natural language to run various ROS commands and tools, for example:
    • "Give me a list of nodes, categorize them into navigation, perception, control, and other"
    • "Show me a list of topics that have publishers but no subscribers"
    • "Set the /velocity parameter to 10"
    • "Echo the /robot/status topic"
    • "What is the message type of the /robot/status topic?"
  • Control the TurtleSim robot in simulation using ROSA
  • Easily adapt ROSA for your robot by adding new tools and prompts
  • Use multi-modal models for vision, scene understanding, and more (in-progress)
  • Web-based user interface with support for voice commands (in-progress)
  • Text and speech modalities for human-robot interaction (in-progress)

Support for Popular Robots

ROSA already supports any robot built with ROS1 or ROS2, but we are also working on custom agents for some popular robots. These custom agents go beyond the basic ROSA functionality to provide more advanced capabilities and features.

Contents

Quick Start

This guide provides a quick way to get started with ROSA.

Requirements

  1. Python 3.9 or higher
  2. ROS Noetic (or higher)

Note: ROS Noetic uses Python3.8, but LangChain requires Python3.9 or higher. To use ROSA with ROS Noetic, you will need to create a virtual environment with Python3.9 or higher and install ROSA in that environment.

Setup Instructions

pip3 install jpl-rosa

Usage Examples

from rosa import ROSA

llm = get_your_llm_here()
rosa = ROSA(ros_version=1, llm=llm)
rosa.invoke("Show me a list of topics that have publishers but no subscribers")

TurtleSim Demo

We have included a demo that uses ROSA to control the TurtleSim robot in simulation. To run the demo, you will need to have Docker installed on your machine.

The following video shows ROSA reasoning about how to draw a 5-point star, then executing the necessary commands to do so.

https://github.com/user-attachments/assets/77b97014-6d2e-4123-8d0b-ea0916d93a4e

Setup and run

  1. Clone this repository
  2. Configure the LLM in src/turtle_agent/scripts/llm.py
  3. Run the demo script: ./demo.sh
  4. Build and start the turtle agent:
catkin build && source devel/setup.bash && roslaunch turtle_agent agent
  1. Run example queries: examples

Adapting ROSA for Your Robot

ROSA is designed to be easily adaptable to different robots and environments. To adapt ROSA for your robot, you can either (1) create a new class that inherits from the ROSA class, or (2) create a new instance of the ROSA class and pass in the necessary parameters. The first option is recommended if you need to make significant changes to the agent's behavior, while the second option is recommended if you want to use the agent with minimal changes.

In either case, ROSA is adapted by providing it with a new set of tools and/or prompts. The tools are used to interact with the robot and the ROS environment, while the prompts are used to guide the agents behavior.

Adding Tools

There are two methods for adding tools to ROSA:

  1. Pass in a list of @tool functions using the tools parameter.
  2. Pass in a list of Python packages containing @tool functions using the tool_packages parameter.

The first method is recommended if you have a small number of tools, while the second method is recommended if you have a large number of tools or if you want to organize your tools into separate packages.

Hint: check src/turtle_agent/scripts/turtle_agent.py for examples on how to use both methods.

Adding Prompts

To add prompts to ROSA, you need to create a new instance of the RobotSystemPrompts class and pass it to the ROSA constructor using the prompts parameter. The RobotSystemPrompts class contains the following attributes:

  • embodiment_and_persona: Gives the agent a sense of identity and helps it understand its role.
  • about_your_operators: Provides information about the operators who interact with the robot, which can help the agent understand the context of the interaction.
  • critical_instructions: Provides critical instructions that the agent should follow to ensure the safety and well-being of the robot and its operators.
  • constraints_and_guardrails: Gives the robot a sense of its limitations and informs its decision-making process.
  • about_your_environment: Provides information about the physical and digital environment in which the robot operates.
  • about_your_capabilities: Describes what the robot can and cannot do, which can help the agent understand its limitations.
  • nuance_and_assumptions: Provides information about the nuances and assumptions that the agent should consider when interacting with the robot.
  • mission_and_objectives: Describes the mission and objectives of the robot, which can help the agent understand its purpose and goals.
  • environment_variables: Provides information about the environment variables that the agent should consider when interacting with the robot. e.g. $ROS_MASTER_URI, or $ROS_IP.

Example

Here is a quick and easy example showing how to add new tools and prompts to ROSA:

from langchain.agents import tool
from rosa import ROSA, RobotSystemPrompts


@tool
def move_forward(distance: float) -> str:
    """
    Move the robot forward by the specified distance.
    
    :param distance: The distance to move the robot forward.
    """
    # Your code here ...
    return f"Moving forward by {distance} units."


prompts = RobotSystemPrompts(
    embodiment_and_persona="You are a cool robot that can move forward."
)

llm = get_your_llm_here()
rosa = ROSA(ros_version=1, llm=llm, tools=[move_forward], prompts=prompts)
rosa.invoke("Move forward by 2
项目侧边栏1项目侧边栏2
推荐项目
Project Cover

豆包MarsCode

豆包 MarsCode 是一款革命性的编程助手,通过AI技术提供代码补全、单测生成、代码解释和智能问答等功能,支持100+编程语言,与主流编辑器无缝集成,显著提升开发效率和代码质量。

Project Cover

AI写歌

Suno AI是一个革命性的AI音乐创作平台,能在短短30秒内帮助用户创作出一首完整的歌曲。无论是寻找创作灵感还是需要快速制作音乐,Suno AI都是音乐爱好者和专业人士的理想选择。

Project Cover

白日梦AI

白日梦AI提供专注于AI视频生成的多样化功能,包括文生视频、动态画面和形象生成等,帮助用户快速上手,创造专业级内容。

Project Cover

有言AI

有言平台提供一站式AIGC视频创作解决方案,通过智能技术简化视频制作流程。无论是企业宣传还是个人分享,有言都能帮助用户快速、轻松地制作出专业级别的视频内容。

Project Cover

Kimi

Kimi AI助手提供多语言对话支持,能够阅读和理解用户上传的文件内容,解析网页信息,并结合搜索结果为用户提供详尽的答案。无论是日常咨询还是专业问题,Kimi都能以友好、专业的方式提供帮助。

Project Cover

讯飞绘镜

讯飞绘镜是一个支持从创意到完整视频创作的智能平台,用户可以快速生成视频素材并创作独特的音乐视频和故事。平台提供多样化的主题和精选作品,帮助用户探索创意灵感。

Project Cover

讯飞文书

讯飞文书依托讯飞星火大模型,为文书写作者提供从素材筹备到稿件撰写及审稿的全程支持。通过录音智记和以稿写稿等功能,满足事务性工作的高频需求,帮助撰稿人节省精力,提高效率,优化工作与生活。

Project Cover

阿里绘蛙

绘蛙是阿里巴巴集团推出的革命性AI电商营销平台。利用尖端人工智能技术,为商家提供一键生成商品图和营销文案的服务,显著提升内容创作效率和营销效果。适用于淘宝、天猫等电商平台,让商品第一时间被种草。

Project Cover

AIWritePaper论文写作

AIWritePaper论文写作是一站式AI论文写作辅助工具,简化了选题、文献检索至论文撰写的整个过程。通过简单设定,平台可快速生成高质量论文大纲和全文,配合图表、参考文献等一应俱全,同时提供开题报告和答辩PPT等增值服务,保障数据安全,有效提升写作效率和论文质量。

投诉举报邮箱: service@vectorlightyear.com
@2024 懂AI·鲁ICP备2024100362号-6·鲁公网安备37021002001498号