基于DQN的gym_gazebo运行代码演示

基于DQN的gym_gazebo运行代码演示

  • [x] Edit By Porter, 积水成渊,蛟龙生焉。

下载算法包

1
2
git clone https://github.com/ipa-bfb-sc/CSN-RL
cd ./CSN-RL

运行脚本

1
2
cd ~/文档/GitHub_Projects/CSN-RLqqq/DQN
python3 ./DQN_CirTurtleBot.py

## 终端效果

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
porter@porter-Aspire:~/文档/GitHub_Projects/CSN-RLqqq/DQN$ python3 ./DQN_C
DQN_CartPole.py DQN_CirTurtleBot.py
porter@porter-Aspire:~/文档/GitHub_Projects/CSN-RLqqq/DQN$ python3 ./DQN_CirTurtleBot.py
Using TensorFlow backend.
ROS_MASTER_URI=http://localhost:12935

GAZEBO_MASTER_URI=http://localhost:12936

Gazebo launched!
Unable to register with master node [http://localhost:12935]: master may not be running yet. Will keep trying.
... logging to /home/porter/.ros/log/9b695694-7000-11e9-a24a-f0761cd1b3e0/roslaunch-porter-Aspire-32299.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://porter-Aspire:36739/

SUMMARY
========

CSN_RL_DQN_run

export 端口环境添加

此时不会出gazebo,要查看实时的效果,运行如下命令

1
2
3
porter@porter-Aspire:~$ export ROS_MASTER_URI=http://localhost:12935
porter@porter-Aspire:~$ export GAZEBO_MASTER_URI=http://localhost:12936
porter@porter-Aspire:~$ gzclient

CSN_RL_DQN_export

如果不成功,执行

1
2
3
4
5
porter@porter-Aspire:~$ cd /home/porter/gym-gazebo/gym_gazebo/envs/installation/catkin_ws/devel
porter@porter-Aspire:~/gym-gazebo/gym_gazebo/envs/installation/catkin_ws/devel$ source setup.bash
porter@porter-Aspire:~$ export ROS_MASTER_URI=http://localhost:12935
porter@porter-Aspire:~$ export GAZEBO_MASTER_URI=http://localhost:12936
porter@porter-Aspire:~$ gzclient

运行GUI效果

CSN_RL_DQN_CirTurtleBot

文章目录
  1. 1. 基于DQN的gym_gazebo运行代码演示
  2. 2. 下载算法包
  3. 3. 运行脚本
  4. 4. export 端口环境添加
  5. 5. 运行GUI效果
|