LLM을 활용한 Robot 제어 논문을 찾아보던 중, ROS-LLM 이라는
github link : https://github.com/Auromix/ROS-LLM/tree/ros2-humble
GitHub - Auromix/ROS-LLM: ROS-LLM is a framework designed for embodied intelligence applications in ROS. It allows natural langu
ROS-LLM is a framework designed for embodied intelligence applications in ROS. It allows natural language interactions and leverages Large Language Models (LLMs) for decision-making and robot contr...
github.com
프로젝트 논문을 발견하였고, 이 안에 Turtlebot과 ChatGPT를 연동할 수 있게끔 코드를 구현하여 이를 Implementation 하고자 한다.
Github에 명시한 대로 패키지를 설치한다.
mkdir -p /turtlews/src
gitclone을 통해 패키지 설치.
colcon build하고, dependencies 를 설치하고 openai_api_key를 설정해준다.
그리고 파일들의 목록을 확인해보면
- /llm_robot에 turtle_robot.py 파일은 'turtle_robot' 이라는 노드를 만들며
- /turtle1/cmd_vel 토픽을 pub하는 코드
- /ChatGPT_function_call_service 서비스를 생성하는 코드 가 있다.
- /llm_interfaces에는 .msg와 .srv 파일이 있으며
- /llm_model 에는 chatgpt.py 파일이 있으며 이에는 ChatGPT 노드를 생성하며,
- /llm_state 토픽을 발행하고 구독하는 코드, /llm_input_audio_to_text를 구독하는 코드, /llm_response_type을 발행하는 코드, /llm_feedback_to_user를 발행하는 코드, /ChatGPT_function_call_service 서비스 클라이언트를 생성하는 코드
- /ChatGPT_text_output 을 발행하는 코드, chat_history 를 JSON 형태로 저장하는 코드가 있다.
terminal 1 -> turtlesim 실행
terminal 2 -> /llm_feedback_to_user 토픽을 echo 하는 노드
terminal 3 -> turtle_robot 노드
terminal 4 -> /llm_input_audio_to_text 토픽을 발행하여 chatgpt에 명령 msg 넘김
테스트
내가 입력한 자연어 명령을 이해하고, turtle bot를 동작시키는지 테스트해보았다.
feedback에서 linear velocity를 2m/s , anuglar velocity를 3rad/s 로 만든다고 명시하였다.
다음에는 다양한 명령어와 turtle bot을 2개를 놓으며 테스트 해볼 것.
그리고 코드를 분석하고자 한다.
'ROS2 프로젝트 > LLM+ROS2+GAZEBO Control' 카테고리의 다른 글
[프로젝트2] LLM 과 Gazebo를 활용한 Mobile robot 주행 control (+VLM과 Yolo Image Detection) (3) | 2024.08.19 |
---|---|
[프로젝트1] LLM 과 ROS2를 결합한 Turtlesim 컨트롤 (3) (0) | 2024.07.21 |
[프로젝트1] LLM 과 ROS2를 결합한 Turtlesim 컨트롤 (1) (0) | 2024.06.07 |