Skip to content

Commit 3562280

Browse files
committed
added code base
1 parent 87477c1 commit 3562280

File tree

151 files changed

+12007
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

151 files changed

+12007
-2
lines changed

CMakeLists.txt

+197
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
cmake_minimum_required(VERSION 2.8.3)
2+
project(reinforcement_learning_navigation)
3+
4+
## Add support for C++11, supported in ROS Kinetic and newer
5+
# add_definitions(-std=c++11)
6+
7+
## Find catkin macros and libraries
8+
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
9+
## is used, also find other catkin packages
10+
find_package(catkin REQUIRED COMPONENTS
11+
12+
)
13+
14+
## System dependencies are found with CMake's conventions
15+
# find_package(Boost REQUIRED COMPONENTS system)
16+
17+
18+
## Uncomment this if the package has a setup.py. This macro ensures
19+
## modules and global scripts declared therein get installed
20+
## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
21+
# catkin_python_setup()
22+
23+
################################################
24+
## Declare ROS messages, services and actions ##
25+
################################################
26+
27+
## To declare and build messages, services or actions from within this
28+
## package, follow these steps:
29+
## * Let MSG_DEP_SET be the set of packages whose message types you use in
30+
## your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...).
31+
## * In the file package.xml:
32+
## * add a build_depend tag for "message_generation"
33+
## * add a build_depend and a run_depend tag for each package in MSG_DEP_SET
34+
## * If MSG_DEP_SET isn't empty the following dependency has been pulled in
35+
## but can be declared for certainty nonetheless:
36+
## * add a run_depend tag for "message_runtime"
37+
## * In this file (CMakeLists.txt):
38+
## * add "message_generation" and every package in MSG_DEP_SET to
39+
## find_package(catkin REQUIRED COMPONENTS ...)
40+
## * add "message_runtime" and every package in MSG_DEP_SET to
41+
## catkin_package(CATKIN_DEPENDS ...)
42+
## * uncomment the add_*_files sections below as needed
43+
## and list every .msg/.srv/.action file to be processed
44+
## * uncomment the generate_messages entry below
45+
## * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...)
46+
47+
## Generate messages in the 'msg' folder
48+
# add_message_files(
49+
# FILES
50+
# Message1.msg
51+
# Message2.msg
52+
# )
53+
54+
## Generate services in the 'srv' folder
55+
# add_service_files(
56+
# FILES
57+
# Service1.srv
58+
# Service2.srv
59+
# )
60+
61+
## Generate actions in the 'action' folder
62+
# add_action_files(
63+
# FILES
64+
# Action1.action
65+
# Action2.action
66+
# )
67+
68+
## Generate added messages and services with any dependencies listed here
69+
# generate_messages(
70+
# DEPENDENCIES
71+
# std_msgs # Or other packages containing msgs
72+
# )
73+
74+
################################################
75+
## Declare ROS dynamic reconfigure parameters ##
76+
################################################
77+
78+
## To declare and build dynamic reconfigure parameters within this
79+
## package, follow these steps:
80+
## * In the file package.xml:
81+
## * add a build_depend and a run_depend tag for "dynamic_reconfigure"
82+
## * In this file (CMakeLists.txt):
83+
## * add "dynamic_reconfigure" to
84+
## find_package(catkin REQUIRED COMPONENTS ...)
85+
## * uncomment the "generate_dynamic_reconfigure_options" section below
86+
## and list every .cfg file to be processed
87+
88+
## Generate dynamic reconfigure parameters in the 'cfg' folder
89+
# generate_dynamic_reconfigure_options(
90+
# cfg/DynReconf1.cfg
91+
# cfg/DynReconf2.cfg
92+
# )
93+
94+
###################################
95+
## catkin specific configuration ##
96+
###################################
97+
## The catkin_package macro generates cmake config files for your package
98+
## Declare things to be passed to dependent projects
99+
## INCLUDE_DIRS: uncomment this if you package contains header files
100+
## LIBRARIES: libraries you create in this project that dependent projects also need
101+
## CATKIN_DEPENDS: catkin_packages dependent projects also need
102+
## DEPENDS: system dependencies of this project that dependent projects also need
103+
catkin_package(
104+
# INCLUDE_DIRS include
105+
# LIBRARIES reinforcement_learning_navigation
106+
# CATKIN_DEPENDS ridgeback_gazebo ridgeback_navigation
107+
# DEPENDS system_lib
108+
)
109+
110+
###########
111+
## Build ##
112+
###########
113+
114+
## Specify additional locations of header files
115+
## Your package locations should be listed before other locations
116+
# include_directories(include)
117+
include_directories(
118+
${catkin_INCLUDE_DIRS}
119+
)
120+
121+
## Declare a C++ library
122+
# add_library(${PROJECT_NAME}
123+
# src/${PROJECT_NAME}/reinfocement_learning_navigation.cpp
124+
# )
125+
126+
## Add cmake target dependencies of the library
127+
## as an example, code may need to be generated before libraries
128+
## either from message generation or dynamic reconfigure
129+
# add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
130+
131+
## Declare a C++ executable
132+
## With catkin_make all packages are built within a single CMake context
133+
## The recommended prefix ensures that target names across packages don't collide
134+
# add_executable(${PROJECT_NAME}_node src/reinforcement_learning_navigaation_node.cpp)
135+
136+
## Rename C++ executable without prefix
137+
## The above recommended prefix causes long target names, the following renames the
138+
## target back to the shorter version for ease of user use
139+
## e.g. "rosrun someones_pkg node" instead of "rosrun someones_pkg someones_pkg_node"
140+
# set_target_properties(${PROJECT_NAME}_node PROPERTIES OUTPUT_NAME node PREFIX "")
141+
142+
## Add cmake target dependencies of the executable
143+
## same as for the library above
144+
# add_dependencies(${PROJECT_NAME}_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
145+
146+
## Specify libraries to link a library or executable target against
147+
# target_link_libraries(${PROJECT_NAME}_node
148+
# ${catkin_LIBRARIES}
149+
# )
150+
151+
#############
152+
## Install ##
153+
#############
154+
155+
# all install targets should use catkin DESTINATION variables
156+
# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html
157+
158+
## Mark executable scripts (Python etc.) for installation
159+
## in contrast to setup.py, you can choose the destination
160+
# install(PROGRAMS
161+
# scripts/my_python_script
162+
# DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
163+
# )
164+
165+
## Mark executables and/or libraries for installation
166+
# install(TARGETS ${PROJECT_NAME} ${PROJECT_NAME}_node
167+
# ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
168+
# LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
169+
# RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
170+
# )
171+
172+
## Mark cpp header files for installation
173+
# install(DIRECTORY include/${PROJECT_NAME}/
174+
# DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
175+
# FILES_MATCHING PATTERN "*.h"
176+
# PATTERN ".svn" EXCLUDE
177+
# )
178+
179+
## Mark other files for installation (e.g. launch and bag files, etc.)
180+
# install(FILES
181+
# # myfile1
182+
# # myfile2
183+
# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
184+
# )
185+
186+
#############
187+
## Testing ##
188+
#############
189+
190+
## Add gtest based cpp test target and link libraries
191+
# catkin_add_gtest(${PROJECT_NAME}-test test/test_reinfocement_learning_navigation.cpp)
192+
# if(TARGET ${PROJECT_NAME}-test)
193+
# target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME})
194+
# endif()
195+
196+
## Add folders to be run by python nosetests
197+
# catkin_add_nosetests(test)

README.md

+35-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,35 @@
1-
## Reinforced Imitation Open Source Repo
2-
Stay tuned! We are currently preparing our code for open-sourcing.
1+
Reinforced Imitation
2+
====================
3+
4+
This repository contains the tensorflow implementation for training a reinforcement learning based map-less navigation model, as described in the paper:\
5+
[Reinforced Imitation: Sample Efficient Deep Reinforcement Learning for Map-less Navigation by Leveraging Prior Demonstrations](https://arxiv.org/abs/1805.07095)
6+
7+
# Requirements
8+
1. Ubuntu
9+
2. Python 2.7
10+
3. [ROS Indigo](http://wiki.ros.org/indigo) or [ROS Kinetic](http://wiki.ros.org/kinetic)
11+
4. Stage-ros simulator, with `add_pose_sub` enabled. Can be found in this [branch](https://github.com/ros-simulation/stage_ros/tree/add_pose_sub) of the repository.
12+
13+
# Training the Model
14+
1. First run the stage simulator:
15+
`roslaunch reinforcement_learning_navigation stage_sim.launch`
16+
2. In a separate terminal, run the training code:
17+
`rosrun reinforcement_learning_navigation train_cpo.py --output_name $experiment_name$`\
18+
In order to use pre-trained weights from imitation learning, add the arguments `--jump_start 1 --model_init $path_to_policy_weights$`
19+
20+
# Citation
21+
If you use our code in your research, please cite our paper.
22+
```
23+
@ARTICLE{pfeiffer2018ral,
24+
author={M. Pfeiffer and S. Shukla and M. Turchetta and C. Cadena Lerma and A. Krause and R. Siegwart and J. Nieto},
25+
journal={IEEE Robotics and Automation Letters},
26+
title={{Reinforced Imitation: Sample Efficient Deep Reinforcement Learning for Map-less Navigation by Leveraging Prior Demonstrations}},
27+
year={2018},
28+
volume={3},
29+
number={4},
30+
pages={4423-4430}
31+
}
32+
```
33+
34+
# References
35+
Our training model uses Constrained Policy Optimization : \[[Paper](https://arxiv.org/abs/1705.10528)\] \[[Code](https://github.com/jachiam/cpo)\]

README.md~

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<<<<<<< HEAD
2+
## Reinforce Imitation Open Source Repo
3+
=======
4+
## Reinforced Imitation Open Source Repo
5+
>>>>>>> origin/fix/name
6+
Stay tuned! We are currently preparing our code for open-sourcing.
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
model_checkpoint_path: "final"
2+
all_model_checkpoint_paths: "snap-40000"
3+
all_model_checkpoint_paths: "snap-80000"
4+
all_model_checkpoint_paths: "final"
Binary file not shown.
Binary file not shown.
919 Bytes
Binary file not shown.
101 KB
Binary file not shown.

initial_weights/simple_model/graph.pb

74.1 KB
Binary file not shown.

initial_weights/simple_model/model.pb

1.41 MB
Binary file not shown.
Binary file not shown.
919 Bytes
Binary file not shown.
101 KB
Binary file not shown.
Binary file not shown.
919 Bytes
Binary file not shown.
101 KB
Binary file not shown.
Binary file not shown.

launch/stage_sim.launch

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
<!--
2+
Turtlebot navigation simulation:
3+
- stage
4+
- map_server
5+
- move_base
6+
- static map
7+
- amcl
8+
- rviz view
9+
-->
10+
<launch>
11+
<arg name="base" default="$(optenv TURTLEBOT_BASE kobuki)"/> <!-- create, rhoomba -->
12+
<arg name="stacks" default="$(optenv TURTLEBOT_STACKS hexagons)"/> <!-- circles, hexagons -->
13+
<arg name="3d_sensor" default="$(optenv TURTLEBOT_3D_SENSOR kinect)"/> <!-- kinect, asus_xtion_pro -->
14+
15+
<!-- Name of the map to use (without path nor extension) and initial position -->
16+
<arg name="map_file" default="$(find reinforcement_learning_navigation)/maps/train_env.yaml "/> <!-- robopark_plan -->
17+
<arg name="world_file" default="$(find reinforcement_learning_navigation)/maps/stage/train_env.world"/>
18+
<arg name="initial_pose_x" default="0.0"/>
19+
<arg name="initial_pose_y" default="0.0"/>
20+
<arg name="initial_pose_a" default="0.0"/>
21+
22+
<param name="/use_sim_time" value="true"/>
23+
<!-- ******************** Stage ******************** -->
24+
<!--
25+
Publishes transforms:
26+
/base_link -> /base_laser
27+
/base_footprint -> /base_link (identity)
28+
/odom -> base_footprint
29+
Publishes topics:
30+
/odom : odometry data from the simulated odometry
31+
/base_scan : laser data from the simulated laser
32+
/base_pose_ground_truth : the ground truth pose
33+
Parameters:
34+
base_watchdog_timeout : time (s) after receiving the last command on cmd_vel before stopping the robot
35+
Args:
36+
-g : run in headless mode.
37+
-->
38+
<node pkg="stage_ros" type="stageros" name="stageros" args="-g $(arg world_file)" respawn="true">
39+
<param name="base_watchdog_timeout" value="0.2"/>
40+
<remap from="odom" to="odom"/>
41+
<remap from="base_pose_ground_truth" to="base_pose_ground_truth"/>
42+
<!--remap from="cmd_vel" to="mobile_base/commands/velocity"/-->
43+
<!--remap from="base_scan" to="scan"/-->
44+
<!--remap from="base_scan_0" to="front/scan"/-->
45+
<!--remap from="base_scan_1" to="rear/scan"/-->
46+
</node>
47+
48+
49+
<!-- ***************** Robot Model ***************** -->
50+
<include file="$(find turtlebot_bringup)/launch/includes/robot.launch.xml">
51+
<arg name="base" value="$(arg base)" />
52+
<arg name="stacks" value="$(arg stacks)" />
53+
<arg name="3d_sensor" value="$(arg 3d_sensor)" />
54+
</include>
55+
<node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher">
56+
<param name="use_gui" value="false"/>
57+
</node>
58+
59+
<!-- Command Velocity multiplexer -->
60+
<node pkg="nodelet" type="nodelet" name="mobile_base_nodelet_manager" args="manager"/>
61+
<node pkg="nodelet" type="nodelet" name="cmd_vel_mux" args="load yocs_cmd_vel_mux/CmdVelMuxNodelet mobile_base_nodelet_manager">
62+
<param name="yaml_cfg_file" value="$(find turtlebot_bringup)/param/mux.yaml"/>
63+
<remap from="cmd_vel_mux/output" to="mobile_base/commands/velocity"/>
64+
</node>
65+
66+
<!-- ************** Navigation *************** -->
67+
<!--include file="$(find turtlebot_navigation)/launch/includes/move_base.launch.xml"/-->
68+
69+
<!-- ****** Maps ***** -->
70+
<!--node name="map_server" pkg="map_server" type="map_server" args="$(arg map_file)"-->
71+
<!--param name="frame_id" value="/map"/-->
72+
<!--/node-->
73+
74+
<!--include file="$(find turtlebot_navigation)/launch/includes/amcl/amcl.launch.xml"-->
75+
<!--arg name="scan_topic" value="scan"/-->
76+
<!--arg name="use_map_topic" value="true"/-->
77+
<!--arg name="initial_pose_x" value="$(arg initial_pose_x)"/-->
78+
<!--arg name="initial_pose_y" value="$(arg initial_pose_y)"/-->
79+
<!--arg name="initial_pose_a" value="$(arg initial_pose_a)"/-->
80+
<!--/include-->
81+
82+
<!-- **************** Visualisation **************** -->
83+
<!--node name="rviz" pkg="rviz" type="rviz" args="-d $(find turtlebot_stage)/rviz/robot_navigation.rviz"/-->
84+
</launch>

0 commit comments

Comments
 (0)