├── msg
└── PointArray.msg
├── others
├── rosgraph.png
└── record.sh
├── param
├── dwa
│ ├── local_costmap_params.yaml
│ ├── global_costmap_params.yaml
│ ├── costmap_common_params.yaml
│ └── local_planner_params.yaml
├── teb
│ ├── global_costmap_params.yaml
│ ├── local_costmap_params.yaml
│ ├── costmap_common_params.yaml
│ ├── costmap_converter_params.yaml
│ └── local_planner_params.yaml
├── tdle.lua
└── rviz_config
│ └── single.rviz
├── .gitignore
├── launch
├── tdle_real.launch
├── include
│ ├── basic_exploration.launch
│ ├── robot.launch
│ ├── move_base_real.launch
│ └── move_base_sim.launch
└── tdle_sim.launch
├── include
└── tdle
│ ├── data_recorder_node.h
│ ├── fpoint_detector_node.h
│ ├── fpoint_selection_node.h
│ ├── common_func.h
│ ├── fpoint_filter_node.h
│ └── subregion_arrangement_node.h
├── package.xml
├── CMakeLists.txt
├── src
├── data_recorder_node.cpp
├── common_func.cpp
├── fpoint_detector_node.cpp
├── fpoint_filter_node.cpp
├── fpoint_selection_node.cpp
└── subregion_arrangement_node.cpp
└── README.md
/msg/PointArray.msg:
--------------------------------------------------------------------------------
1 | # An array of points
2 |
3 | geometry_msgs/Point[] points
--------------------------------------------------------------------------------
/others/rosgraph.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SeanZsya/tdle/HEAD/others/rosgraph.png
--------------------------------------------------------------------------------
/others/record.sh:
--------------------------------------------------------------------------------
1 | rosbag record -o ~/ /map /centroids /grid_marker /subregion_marker /trajectory_node_list /move_base/NavfnROS/plan /global_shapes /local_shapes
--------------------------------------------------------------------------------
/param/dwa/local_costmap_params.yaml:
--------------------------------------------------------------------------------
1 | local_costmap:
2 |
3 | global_frame: map
4 | robot_base_frame: base_link
5 | update_frequency: 3.0
6 | publish_frequency: 3.0
7 | static_map: false
8 | rolling_window: true
9 |
10 | width: 1.5
11 | height: 1.5
12 | resolution: 0.01
13 |
--------------------------------------------------------------------------------
/param/dwa/global_costmap_params.yaml:
--------------------------------------------------------------------------------
1 | global_costmap:
2 |
3 | global_frame: map
4 | robot_base_frame: base_link
5 | update_frequency: 3.0
6 | publish_frequency: 1.0
7 | transform_tolerance: 5
8 | static_map: true
9 | rolling_window: true
10 |
11 | width: 100.0
12 | height: 100.0
13 | resolution: 0.05
14 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Prerequisites
2 | *.d
3 |
4 | # Compiled Object files
5 | *.slo
6 | *.lo
7 | *.o
8 | *.obj
9 |
10 | # Precompiled Headers
11 | *.gch
12 | *.pch
13 |
14 | # Compiled Dynamic libraries
15 | *.so
16 | *.dylib
17 | *.dll
18 |
19 | # Fortran module files
20 | *.mod
21 | *.smod
22 |
23 | # Compiled Static libraries
24 | *.lai
25 | *.la
26 | *.a
27 | *.lib
28 |
29 | # Executables
30 | *.exe
31 | *.out
32 | *.app
33 |
34 | .vscode/
--------------------------------------------------------------------------------
/param/teb/global_costmap_params.yaml:
--------------------------------------------------------------------------------
1 | global_costmap:
2 | global_frame: map
3 | robot_base_frame: base_link
4 | update_frequency: 1.0
5 | publish_frequency: 0.5
6 | static_map: true
7 |
8 | transform_tolerance: 0.5
9 | plugins:
10 | - {name: static_layer, type: "costmap_2d::StaticLayer"}
11 | - {name: obstacle_layer, type: "costmap_2d::VoxelLayer"}
12 | - {name: inflation_layer, type: "costmap_2d::InflationLayer"}
--------------------------------------------------------------------------------
/param/teb/local_costmap_params.yaml:
--------------------------------------------------------------------------------
1 | local_costmap:
2 | global_frame: map
3 | robot_base_frame: base_link
4 | update_frequency: 5.0
5 | publish_frequency: 2.0
6 | static_map: false
7 | rolling_window: true
8 | width: 5.5
9 | height: 5.5
10 | resolution: 0.1
11 | transform_tolerance: 0.5
12 |
13 | plugins:
14 | - {name: static_layer, type: "costmap_2d::StaticLayer"}
15 | - {name: obstacle_layer, type: "costmap_2d::ObstacleLayer"}
16 |
--------------------------------------------------------------------------------
/launch/tdle_real.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/include/tdle/data_recorder_node.h:
--------------------------------------------------------------------------------
1 | #ifndef DATA_RECORDER_NODE_H
2 | #define DATA_RECORDER_NODE_H
3 | #include
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include
10 | #include
11 | #include
12 | #include
13 | #include
14 | #include
15 | #include
16 | #include
17 | #include
18 | #include
19 | #include
20 | #include
21 |
22 |
23 | #endif
--------------------------------------------------------------------------------
/include/tdle/fpoint_detector_node.h:
--------------------------------------------------------------------------------
1 | #ifndef FPOINT_DETECTOR_NODE_H
2 | #define FPOINT_DETECTOR_NODE_H
3 | #include
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include
10 | #include
11 | #include
12 | #include
13 | #include
14 | #include
15 | #include
16 | #include
17 | #include
18 | #include
19 | #include
20 | #include
21 |
22 |
23 | #endif
--------------------------------------------------------------------------------
/param/dwa/costmap_common_params.yaml:
--------------------------------------------------------------------------------
1 | # #This file contains common configuration options for the two costmaps used in the navigation stack for more details on the parameters in this file, and a full list of the parameters used by the costmaps, please see http://www.ros.org/wiki/costmap_2d
2 |
3 | # lethal_cost_threshold: 100
4 |
5 | obstacle_range: 3.0
6 | raytrace_range: 3.5
7 |
8 | footprint: [[-0.205, -0.155], [-0.205, 0.155], [0.077, 0.155], [0.077, -0.155]]
9 | #robot_radius: 0.17
10 |
11 | inflation_radius: 0.6 #0.6
12 | cost_scaling_factor: 4.0 #4.0
13 |
14 | map_type: costmap
15 | observation_sources: scan
16 | scan: {sensor_frame: base_scan, data_type: LaserScan, topic: scan, marking: true, clearing: true}
17 |
--------------------------------------------------------------------------------
/include/tdle/fpoint_selection_node.h:
--------------------------------------------------------------------------------
1 | #ifndef FPOINT_SELECTION_NODE_H
2 | #define FPOINT_SELECTION_NODE_H
3 | #include
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include
10 | #include
11 | #include
12 | #include
13 | #include
14 | #include
15 | #include
16 | #include
17 | #include
18 | #include
19 | #include
20 | #include
21 | #include
22 |
23 |
24 | enum EXP_STATE { NORMAL, STUCKED, FINISHED };
25 |
26 |
27 | #endif
--------------------------------------------------------------------------------
/launch/include/basic_exploration.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/launch/include/robot.launch:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
10 |
11 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/param/teb/costmap_common_params.yaml:
--------------------------------------------------------------------------------
1 |
2 | #---standard pioneer footprint---
3 | #---(in meters)---
4 | robot_radius: 0.17
5 | footprint_padding: 0.00
6 |
7 | transform_tolerance: 0.2
8 | map_type: costmap
9 |
10 | always_send_full_costmap: true
11 |
12 | obstacle_layer:
13 | enabled: true
14 | obstacle_range: 3.0
15 | raytrace_range: 4.0
16 | inflation_radius: 0.2
17 | track_unknown_space: true
18 | combination_method: 1
19 |
20 | observation_sources: laser_scan_sensor
21 | laser_scan_sensor: {data_type: LaserScan, topic: scan, marking: true, clearing: true}
22 |
23 |
24 | inflation_layer:
25 | enabled: true
26 | cost_scaling_factor: 10.0 # exponential rate at which the obstacle cost drops off (default: 10)
27 | inflation_radius: 0.5 # max. distance from an obstacle at which costs are incurred for planning paths.
28 |
29 | static_layer:
30 | enabled: true
31 | map_topic: "/map"
32 |
--------------------------------------------------------------------------------
/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | tdle
4 | 1.0.0
5 | A ROS package for exploration with 2d lidar.
6 |
7 | Sean Zhao
8 | Sean Zhao
9 |
10 | MIT
11 | https://github.com/SeanZsya/tdle
12 |
13 |
14 | catkin
15 |
16 | geometry_msgs
17 | nav_msgs
18 | roscpp
19 | std_msgs
20 | visualization_msgs
21 | message_generation
22 |
23 | geometry_msgs
24 | nav_msgs
25 | roscpp
26 | std_msgs
27 | visualization_msgs
28 | message_runtime
29 |
30 | gazebo_ros
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/include/tdle/common_func.h:
--------------------------------------------------------------------------------
1 | #ifndef COMMON_FUNC_H
2 | #define COMMON_FUNC_H
3 | #include
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include
10 | #include
11 | #include
12 | #include
13 | #include
14 | #include
15 | #include
16 | #include
17 | #include
18 | #include
19 | #include
20 |
21 | using namespace std;
22 |
23 | float euclideanDistance( vector , vector );
24 |
25 | float sign(float );
26 |
27 | vector Nearest(vector >,vector );
28 |
29 | vector Steer( vector, vector, float );
30 |
31 | int gridValue(nav_msgs::OccupancyGrid &,vector);
32 |
33 | int ObstacleFree(vector , vector & , nav_msgs::OccupancyGrid);
34 |
35 | void visMarkerInit(visualization_msgs::Marker &marker, string ID, int type, int action, float scale, float r, float g, float b, float a);
36 |
37 | void visMarkerSet (visualization_msgs::Marker &marker, vector &point);
38 |
39 |
40 | #endif
--------------------------------------------------------------------------------
/include/tdle/fpoint_filter_node.h:
--------------------------------------------------------------------------------
1 | #ifndef FPOINT_FILTER_NODE_H
2 | #define FPOINT_FILTER_NODE_H
3 |
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include
10 | #include
11 | #include
12 | #include
13 | #include
14 | #include
15 | #include
16 | #include
17 | #include
18 | #include
19 | #include
20 | #include
21 |
22 | using namespace std;
23 |
24 | void mapCallBack(const nav_msgs::OccupancyGrid::ConstPtr& msg);
25 |
26 | void costmapCallBack(const nav_msgs::OccupancyGrid::ConstPtr& msg);
27 |
28 | void fpointCallBack(const geometry_msgs::PointStamped& msg);
29 |
30 | vector disFilter(geometry_msgs::Point point, vector& fpoints);
31 |
32 | vector meanshiftFilter(geometry_msgs::Point point, vector &fpoints, float kernel_bandwidth, float convergence_threshold);
33 |
34 | tdle::PointArray delPrevious(vector& filtered_points, visualization_msgs::Marker& fpoint_vis) ;
35 |
36 |
37 |
38 | #endif
--------------------------------------------------------------------------------
/launch/tdle_sim.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/param/dwa/local_planner_params.yaml:
--------------------------------------------------------------------------------
1 | DWAPlannerROS:
2 | # Robot Configuration Parameters
3 | max_vel_x: 1
4 | min_vel_x: -1
5 |
6 | max_vel_y: 0.0
7 | min_vel_y: 0.0
8 |
9 | max_vel_theta: 3.0 #max_rot_vel is deprecated
10 | min_vel_theta: -3.0
11 |
12 | #平移速度
13 | max_vel_trans: 1
14 | min_vel_trans: -1
15 |
16 | acc_lim_x: 4.5
17 | acc_lim_y: 0.0
18 | acc_lim_th: 2.0
19 |
20 |
21 |
22 | # Goal Tolerance Parametes
23 | xy_goal_tolerance: 0.10
24 | yaw_goal_tolerance: 1.6 #1.0
25 | latch_xy_goal_tolerance: false
26 | #If goal tolerance is latched, if the robot ever reaches the goal xy location it will simply rotate in place, even if it ends up outside the goal tolerance while it is doing so.
27 |
28 |
29 |
30 | # Forward Simulation Parameters
31 | sim_time: 1.2 #1.2
32 | vx_samples: 20
33 | sim_granularity: 0.025
34 | #The step size, in meters, to take between points on a given trajectory
35 | vy_samples: 0
36 | vth_samples: 40
37 | controller_frequency: 10.0
38 |
39 | # Trajectory Scoring Parameters
40 | path_distance_bias: 32.0
41 | goal_distance_bias: 24.0
42 | occdist_scale: 0.05 #0.2
43 | #The weighting for how much the controller should attempt to avoid obstacles
44 | forward_point_distance: 0.325
45 | stop_time_buffer: 0.2
46 | scaling_speed: 0.25
47 | max_scaling_factor: 0.2
48 |
49 | # Oscillation Prevention Parameters
50 | oscillation_reset_dist: 0.05
51 |
52 | # Debugging
53 | publish_traj_pc : true
54 | publish_cost_grid_pc: true
55 |
--------------------------------------------------------------------------------
/param/teb/costmap_converter_params.yaml:
--------------------------------------------------------------------------------
1 | ###########################################################################################
2 | ## NOTE: Costmap conversion is experimental. Its purpose is to combine many point ##
3 | ## obstales into clusters, computed in a separate thread in order to improve the overall ##
4 | ## efficiency of local planning. However, the implemented conversion algorithms are in a ##
5 | ## very early stage of development. Contributions are welcome! ##
6 | ###########################################################################################
7 |
8 | TebLocalPlannerROS:
9 |
10 | ## Costmap converter plugin
11 | #costmap_converter_plugin: "costmap_converter::CostmapToPolygonsDBSMCCH"
12 | costmap_converter_plugin: "costmap_converter::CostmapToLinesDBSRANSAC"
13 | #costmap_converter_plugin: "costmap_converter::CostmapToLinesDBSMCCH"
14 | #costmap_converter_plugin: "costmap_converter::CostmapToPolygonsDBSConcaveHull"
15 | costmap_converter_spin_thread: True
16 | costmap_converter_rate: 5
17 |
18 |
19 | ## Configure plugins (namespace move_base/costmap_to_lines or move_base/costmap_to_polygons)
20 | ## costmap_converter/CostmapToLinesDBSRANSAC, costmap_converter/CostmapToLinesDBSMCCH, costmap_converter/CostmapToPolygonsDBSMCCH
21 | costmap_converter/CostmapToLinesDBSRANSAC:
22 | cluster_max_distance: 0.4
23 | cluster_min_pts: 2
24 | ransac_inlier_distance: 0.15
25 | ransac_min_inliers: 10
26 | ransac_no_iterations: 1500
27 | ransac_remainig_outliers: 3
28 | ransac_convert_outlier_pts: True
29 | ransac_filter_remaining_outlier_pts: False
30 | convex_hull_min_pt_separation: 0.1
31 |
32 |
--------------------------------------------------------------------------------
/include/tdle/subregion_arrangement_node.h:
--------------------------------------------------------------------------------
1 | #ifndef SUBREGION_ARRANGEMENT_NODE_H
2 | #define SUBREGION_ARRANGEMENT_NODE_H
3 |
4 | #include