首页 > 其他分享 >关于安装ros和运行tuetlebot3的错误

关于安装ros和运行tuetlebot3的错误

时间:2024-04-19 15:33:45浏览次数:27  
标签:turtlebot3 git catkin com tuetlebot3 ros 安装 python3

https://blog.csdn.net/qq2650326396/article/details/124801005

安装ros

wget http://fishros.com/install -O fishros && . fishros

安装conda

wget https://repo.anaconda.com/archive/Anaconda3-2021.11-Linux-x86_64.sh
bash Anaconda3-2021.11-Linux-x86_64.sh

安装vim 更新源

apt-get update
apt install vim

关于报错 这里是找不到对应的安装包 但是其已经有了pytorch1.0 在py2.yaml中删掉无法定位的包就可以了

(base) root@f281de310469:~/turtlebot3_DQN# conda env create -f py2.yaml
Collecting package metadata (repodata.json): done
Solving environment: failed

ResolvePackageNotFound:

  • pytorch==1.4.0=py2.7_cpu_0
  • torchaudio==0.4.0=py27
  • torchvision==0.5.0=py27_cpu

在安装好的环境下 安装torch

pip install torch1.4.0 torchvision0.5.0

报错

CMake Error at /opt/ros/melodic/share/catkin/cmake/test/gtest.cmake:180 (add_executable):
add_executable cannot create target "test_transform_datatypes" because
another target with the same name already exists. The existing target is
an executable created in source directory
"/root/catkin_ws/src/geometry2/tf2". See documentation for policy CMP0002
for more details.

解决办法

cd /root/catkin_ws/src/geometry2/tf2
vim CMakeLists.txt
重命名 53-55行

报错

ImportError: "from catkin_pkg.package import parse_package" failed: No module named 'catkin_pkg'
Make sure that you have installed "catkin_pkg", it is up to date and on the PYTHONPATH.
CMake Error at /opt/ros/melodic/share/catkin/cmake/safe_execute_process.cmake:11 (message):
execute_process(/usr/bin/python3
"/opt/ros/melodic/share/catkin/cmake/parse_package_xml.py"
"/opt/ros/melodic/share/catkin/cmake/../package.xml"
"/root/catkin_ws/build/catkin/catkin_generated/version/package.cmake")
returned error code 1

解决办法 链接的路径不对

echo $PYTHONPATH 查看当前链接的路径
which python3 查看python3路径
catkin_make -DPYTHON_EXECUTABLE=/root/anaconda3/bin/python3 由于import需要使用python3 链接到python3路径即可

报错

AttributeError: module 'em' has no attribute 'RAW_OPT'

解决办法 版本太高 降版本

pip install empy==3.3.4

创建工作空间

mkdir -p catkin_ws/src
cd catkin_ws/src
git clone https://gitclone.com/github.com/ros/geometry.git
git clone https://gitclone.com/github.com/ros/geometry2.git
git clone https://gitee.com/fangxiaosheng666/PPO-SAC-DQN-DDPG
cd ..
catkin_make -DPYTHON_EXECUTABLE=/usr/bin/python3

创建工作空间

mkdir -p ws/src
cd ws/src
git clone https://gitclone.com/github.com/ROBOTIS-GIT/turtlebot3.git
git clone https://gitclone.com/github.com/ROBOTIS-GIT/turtlebot3_simulations.git
git clone https://gitclone.com/github.com/ROBOTIS-GIT/turtlebot3_msgs.git
cd ..
source /opt/ros/melodic/setup.bash
echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
source ~/.bashrc
catkin_make

运行gazebo仿真环境 机器人的环境

source ~/ws/devel/setup.bash
export TURTLEBOT3_MODEL=burger
roslaunch turtlebot3_gazebo turtlebot3_stage_2.launch

工作空间的程序 使用的是python3

source ~/catkin_ws/devel/setup.bash
python3 PPO.py

运行dqn 使用的是python2 不能在环境变量中用python3 会产生混用的错误

export TURTLEBOT3_MODEL=burger
conda activate py2
cd ~/turtlebot3_DQN/DQN
python DQN2.py

export TURTLEBOT3_MODEL=burger
roslaunch turtlebot3_fake turtlebot3_fake.launch #rviz仿真
roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch #控制节点

roslaunch turtlebot3_gazebo turtlebot3_world.launch

相关网址

https://zhuanlan.zhihu.com/p/265184095

rviz

http://www.autolabor.com.cn/book/ROSTutorials/di-6-zhang-ji-qi-ren-xi-tong-fang-zhen/62-fang-zhen-urdf-ji-cheng-rviz.html

标签:turtlebot3,git,catkin,com,tuetlebot3,ros,安装,python3
From: https://www.cnblogs.com/wangxinxinying/p/18145990

相关文章

  • 安装VMware vSphere vCenter 8.0
    安装VMwarevSpherevCenter8.01运行安装程序  2语言选择中文  3点下一步 4接受许可协议,点下一步 5填写部署vCenter服务的ESXI主机IP地址以及对应ESXI主机的账号密码,这里将vCenter服务部署在192.168.1.14这台主机上 6接受证书警告 7设置vCenter的主......
  • 安装iptables报错
    安装ittables报错:apt-getinstalliptablesReadingpackagelists...DoneBuildingdependencytreeReadingstateinformation...DoneSomepackagescouldnotbeinstalled.Thismaymeanthatyouhaverequestedanimpossiblesituationorifyouareusingtheuns......
  • Mac安装Redis
    Mac安装Redis#安装Homebrew命令,Homebrew安装的软件会默认在/usr/local/Cellar/路径下#/bin/zsh-c"$(curl-fsSLhttps://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"#Homebrew命令安装redisbrewinstallredis启动Redis#方式一:使用brew帮助我们启动软件......
  • 6.Centos7 安装最新版本 Kubernetes + Docker
    在Centos7安装最新版本Kubernetes+Docker1.容器运行时说明:v1.24之前的Kubernetes版本直接集成了DockerEngine的一个组件,名为dockershim。自1.24版起,Dockershim已从Kubernetes项目中移除。需要在集群内每个节点上安装一个容器运行时以使Pod可以运行在上面......
  • ROS笔记5--动作通讯
    1、动作通讯简介机器人是一个复杂的智能系统,并不仅仅是键盘遥控运动、识别某个目标这么简单,我们需要实现的是送餐、送货、分拣等满足具体场景需求的机器人。在这些应用功能的实现中,另外一种ROS通信机制也会被常常用到——那就是动作。从这个名字上就可以很好理解这个概念的含义,......
  • 【云原生|K8s系列第1篇】:K8s的基础概念、组件架构及实战安装
    1、先从K8s不是什么讲起首先,K8s并不是一个传统意义上的PaaS平台即服务的工具,它充分给使用者提供了很多很多选择的空间。不限制支持的应用程序类型,K8s并不插手应用程序框架,也不限制支持的语言(如Java,Python,Ruby等),只要应用符合12因素即可。也就是说,只需要应用可以在......
  • PVE下面安装Windows2012R2虚拟机的VirtIO驱动程序
    从官网链接下载不同版本的进行测试安装https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-virtio/测试结果如下virtio-win-0.1.215-2/2022-01-1305:42正常安装virtio-win-0.1.217-2/2022-05-3104:41安装失败virtio-win-0.1.221-1/2022......
  • Ubuntu22.04安装MySQL8
    Ubuntu22.04安装MySQL8第一部分:安装mysql使用apt安装sudoaptupdatesudoaptinstall-ymysql-server安装完成之后自动结束,不需要输入密码。更新用户密码这里默认安装的是mysql8.0版本,因为i没有输入密码;所以无法使用mysql-uroot-p进入mysql,需要执行这个命令(一定要......
  • Ubuntu22.04安装PostgreSQL15
    Ubuntu22.04安装PostgreSQL15启用PostgreSQL包存储库sudosh-c'echo"debhttp://apt.postgresql.org/pub/repos/apt$(lsb_release-cs)-pgdgmain">/etc/apt/sources.list.d/pgdg.list'wget-qO-https://www.postgresql.org/media/keys/ACCC4CF8......
  • nvm安装配置
    nvm安装配置nvm是一个Node.js版本管理工具,它允许你在同一台机器上安装和切换不同的Node.js版本,而无需重新安装和配置,这使得开发人员可以轻松地测试和切换不同的Node.js版本。Windows安装下载链接:https://github.com/coreybutler/nvm-windows/releases下载想要版本nvm-setup.e......