1. 前置工作:
现在ubuntu系统是20.04+ros1,现在用docker新建并安装ros2:
最简单的,用大佬的一键安装:
wget http://fishros.com/install -O fishros && . fishros
其次自己装下:
sudo docker pull osrf/ros:foxy-desktop
看镜像:sudo docker images
启动镜像:sudo docker run -it osrf/ros:foxy-desktop
测试ros2: ros2 -h
run turtlesim: ros2 run turtlesim turtlesim_node
new term:
sudo docker run -it osrf/ros:foxy-desktop
ros2 run turtlesim turtle_teleop_key
如果安装好了但是启动不了小乌龟:
有人这样解决
sudo systemctl enable docker.service
sudo systemctl enable containerd.service
sudo usermod -aG docker $USER我可行方法是xhost+ --net=host -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix --name ROS2 docker-images-name:
xhost +local:
docker run -itd --rm --net=host -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix --name ROS2 fishros/ros:foxy-desktop
docker exec -it ROS2 /ros_entrypoint.sh bash
ros2 run turtlesim turtlesim_node
rosbridge_server报错就安一下
ros2 launch rosbridge_server rosbridge_websocket_launch.xml就可以了
再开:
python main.py --key your_key
key要花钱,所以没有再继续了, 不出意外的话,直接输入prompt,小乌龟就可以动了.
项目地址:https://github.com/ros-ai/ros2_llm_if
常用docker命令:
docker ps -a
docker container start xxx
docker container exec -it ubuntu-latest-buildroot /bin/bash
cat /etc/issue 查看ubuntu版本docker container exec -it xxx /bin/bashsudo docker rm CONTAINER-ID -fsudo docker image rm IMAGE ID -f
2.项目代码:
https://github.com/mgonzs13/llama_ros
其他可复现的llm项目:
https://github.com/JShollaj/awesome-llm-web-ui
3,进入docker, 复现项目步骤和命令
mkdir -p ~/ros2_ws/src
cd ros2_ws
cd src
git clone --recurse-submodules https://github.com/mgonzs13/llama_ros.git
git clone --recurse-submodules https://github.com/mgonzs13/llama_ros.git
如果docker没装pip:
17 apt-get update
18 apt-get install python3
19 apt-get install python3-pip
pip3 install -r llama_ros/requirements.txt
cd ~/ros2_ws
colcon build