在turtlebot3,pytorch上使用DQN,DDPG,PPO,SAC算法,在gazebo上实现仿真。Use DQN, DDPG, PPO, SAC algorithm on turtlebot3, pytorch on turtlebot3, pytorch, and realize simulation on gazebo. Use DQN, DDPG, PPO, SAC algorithm to realize simulation on gazebo.
Hi,大佬
@Crawford-fang
非常感谢大佬可以公开自己的开源代码,我对于深度强化学习训练机器人非常感兴趣,我下载了您的代码,但是运行出现错误,如下: /home/he/miniconda3/envs/rostorch/bin/python3.7 /home/he/turtlebot_ws/src/ROS_pytorch_RL/DQN/DQN2.py Traceback (most recent call last): File "/home/he/turtlebot_ws/src/ROS_pytorch_RL/DQN/DQN2.py", line 147, in <module> dqn = DQN() # 令dqn=DQN类 File "/home/he/turtlebot_ws/src/ROS_pytorch_RL/DQN/DQN2.py", line 78, in __init__ checkpoint = torch.load("/home/ffd/QDN/model/" + str(self.load_ep) + "a.pt") File "/home/he/miniconda3/envs/rostorch/lib/python3.7/site-packages/torch/serialization.py", line 594, in load with _open_file_like(f, 'rb') as opened_file: File "/home/he/miniconda3/envs/rostorch/lib/python3.7/site-packages/torch/serialization.py", line 230, in _open_file_like return _open_file(name_or_buffer, mode) File "/home/he/miniconda3/envs/rostorch/lib/python3.7/site-packages/torch/serialization.py", line 211, in __init__ super(_open_file, self).__init__(open(name, mode)) FileNotFoundError: [Errno 2] No such file or directory: '/home/ffd/QDN/model/780a.pt'
状态信息处理:
for i in range(len(scan.ranges)):
if scan.ranges[i] == float('Inf'):
scan_range.append(3.5)
elif np.isnan(scan.ranges[i]):
scan_range.append(0) #
else:
scan_range.append(scan.ranges[i])
scan.ranges里面除了具体数值不会出现‘Inf’只会出现‘nan’值,经过分析‘nan’的意思应该是这个激光距离为无效(也就是无限远)。您的意思应该是‘nan’值表示激光距离为零,但好像不是这样的。