ubuntu18.04安装跳过 ,虚拟机和双系统都可以
虚拟机:在虚拟机中安装Ubuntu 18.04 - 简书 (jianshu.com)
双系统:(13条消息) Windows 10 安装ubuntu 18.04 双系统(超详细教程)_Ycitus的博客-CSDN博客_win10安装ubuntu双系统
wget http://fishros.com/install -O fishros && . fishros
wget http://fishros.com/install -O fishros && . fishros
https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-2021.11-Linux-x86_64.sh
bash Anaconda3-2021.11-Linux-x86_64.sh
git clone https://github.com/Crawford-fang/turtlebot3_DQN.git
cd turtlebot3_DQN
conda env create -f py2.yaml
mkdir -p ws/src
cd ws/src
git clone https://github.com/ROBOTIS-GIT/turtlebot3.git
git clone https://github.com/ROBOTIS-GIT/turtlebot3_simulations.git
git clone https://github.com/ROBOTIS-GIT/turtlebot3_msgs.git
cd ..
roscd turtlebot3_description/urdf/
gedit turtlebot3_burger.gazebo.xacro
#如果想可视化激光雷达,把下面改成true
<xacro:arg name="laser_visual" default="false"/>
#把激光雷达数据改成24
<scan>
<horizontal>
<samples>24</samples> # The number of sample. Modify it to 24
<resolution>1</resolution>
<min_angle>0.0</min_angle>
<max_angle>6.28319</max_angle>
</horizontal>
</scan>
cd ws
rosdep install --from-paths src --ignore-src -r -y
catkin_make
source devel/setup.bash
N_STATES = 28 N_ACTIONS = 5
效果:
PPO:
https://www.bilibili.com/video/BV1zq4y1g7aM/
DQN:
https://www.bilibili.com/video/BV1BP4y1G7b1/
启动仿真环境: roslaunch turtlebot3_gazebo turtlebot3_stage_2.launch 在vscore启动DQN2.py
代码使用的是绝对路径,修改一下路径即可。
加载训练模型开关;true为加载训练好的模型,false是不加载模型进行训练;
self.loal_model=false
‘Exception in thread /hero/local_planner/action_server/result:
Traceback (most recent call last):
File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
self.run()
File "/usr/lib/python3.8/threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "/opt/ros/noetic/lib/python3/dist-packages/rospy/impl/tcpros_pubsub.py", line 185, in robust_connect_subscriber
conn.receive_loop(receive_cb)
File "/opt/ros/noetic/lib/python3/dist-packages/rospy/impl/tcpros_base.py", line 846, in receive_loop
self.close()
File "/opt/ros/noetic/lib/python3/dist-packages/rospy/impl/tcpros_base.py", line 858, in close
self.socket.close()
AttributeError: 'NoneType' object has no attribute 'close'’
‘sudo gedit /opt/ros/melodic/lib/python2.7/dist-packages/rospy/impl/tcpros_base.py’