Skip to content

Commit

Permalink
Introducing dynamic obstacle support (rst-tu-dortmund#54)
Browse files Browse the repository at this point in the history
* teb_local_planner uses getObstacles() instead of getPolygons()

* Added script for publishing dynamic obstacles

* teb_local_planner::Obstacle centroidVelocity is set using costmap_converter, custom_obstacle_msgs or the test_optim_node

* Option 2 implemented: Dynamic obstacle evasion based on sum of dt

* Made EdgeDynamicObstacle a UnaryEdge

* Temporary commit for testing purposes

* Added check for safety

* Added methods for calculating the spatiotemporal distance between obstacles and robot to obstacles.h and robot_footprint_model.h

* Footprints of robot and obstacle are now considered for distance estimation during optimization

* Updated ROS_ASSERTs for EdgeDynamicObstacle

* Added buffer zone around predicted locations of dynamic obstacles: New parameters dynamic_obstacle_inflation_dist, weight_dynamic_obstacle_inflation

* Static obstacle edges are not added for dynamic obstacles anymore

* Visualization for predicted positions of dynamic point obstacles added. TODO: Line/Polygon

* Enabled homotopy class planning in the test_optim_node

* Outsourced GraphSearch from HomotopyClassPlanner to own class.

* Predicted obstacles are no longer visualized

* simple_exploration in rqt_reconfigure working again

* Added dynamic_reconfigure switch 'include_dynamic_obstacles'

* Revert "Removed TebConfig dependency in TebVisualization"

This reverts commit c33f6b8.

* Added function to access predicted positions of dynamic obstacles

* Changed frame information in publish_dynamic_obstacle

* Added dynamic_reconfigure option for visualization with time as z-axis (currently only for point obstacles)

* Added equivalence relation for 3d homotopy class planning based on Ampere's law (Bhattacharya, 2011)

* Added time information from the teb to the calculation of the 3d H-Signature

* Obstacles far away from the trajectory are ignored in trajectory planning

* Bugfix: Correct timediff is used for H-signature calculation

* Temporary TEBs are constructed, timediffs of these are used to calculate the H-Signature and evaluate, whether they constitute a new Equivalence class

* Changed some parameters

* Better initialization of a teb with less than min_samples vertices

* Fix: Homotopy classes are not altered during optimization anymore due to too few poses between start and goal

* TEBs are only added to the trajectory container, if they constitute a new equivalence class

* Looping trajectories are deleted from the set of candidates

* Added dynamic obstacles to test_optim_node

* (Commented) option to save the Hessian

* Remove moving dynamic obstacle from test_optim_node

* FeedbackMsg includes a ObstacleMsg instead of a polygon

* ObstacleMsg removed from package since it is now part of the costmap_converter package.

* trajectory resize (autoResize) updated: the new version inserts and removes poses until convergence

* h-signature implementations moved to a separate header.

* trajectory initialization now uses a max_vel_x parameter instead of the desired time difference in order to give the optimizer a better warm start. Old methods are marked as deprecated.

* default config updated: dynamic obstacles deactivated. 3d homotopy class planning is now always active if dynamic obstacles are activated

* inplace rotations removed from trajectory initialization to improve convergence speed of the optimizer

* Homotopy graph instantiation moved to initialize method.

Simple graph exploration must now be turned on prior to node start.
Related parameters removed from dynamic reconfigure.
This commit fixes the 'freezed' sampling of waypoints in the graph.

* obstacle msg type adapted to new format in costmap_converter. Own obstacle message type reverted for backward compatibility with custom obstacles.

* Added Subscribers for obstacle velocities to the test_optim_node

(cherry picked from commit a50584c9261bd703b8f328933cf72deac53e5106)

* the robot's odom topic is now passed to the costmap_converter via class method

* teb_local_planner::ObstacleMsg removed in favor of costmap_converter::ObstacleArrayMsg. This also requires custom obstacle publishers to update to the new format

* replaced remaining teb_local_planner/ObstacleMsg with costmap_converter/ObstacleArrayMsg

* code cleanup concerning prediction of obstacles

* custom weight added to dynamic obstacle edges

* the equivalence class can now be accessed via public api (read-only)

* the "new" trajectory resizing method is only activated now, if "include_dynamic_obstacles" is set to true.

We introduced the non-fast mode with the support of dynamic obstacles
(which leads to better results in terms of x-y-t homotopy planning).
However, we have not tested this mode intensively yet, so we keep
the legacy fast mode as default until we finish our tests.
  • Loading branch information
croesmann authored Sep 21, 2017
1 parent 01fb062 commit 61bd030
Show file tree
Hide file tree
Showing 32 changed files with 2,196 additions and 1,125 deletions.
23 changes: 23 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
build-kinetic:
variables:
ROSDISTRO: "kinetic"
CATKIN_WS: "/root/catkin_ws"
stage: build
image: osrf/ros:$ROSDISTRO-desktop-full
before_script:
- apt-get -qq update
- apt-get -qq install git-core python-catkin-tools curl
- mkdir -p $CATKIN_WS/src
- cp -a . $CATKIN_WS/src/
- cd $CATKIN_WS
- rosdep update
- rosdep install -y --from-paths src --ignore-src --rosdistro $ROSDISTRO --as-root=apt:false
script:
- source /ros_entrypoint.sh
- cd $CATKIN_WS
- catkin build -i -s --no-status
only:
- kinetic-devel
tags:
- ubuntu
- docker
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ endif()
## Generate messages in the 'msg' folder
add_message_files(
FILES
ObstacleMsg.msg
TrajectoryPointMsg.msg
TrajectoryMsg.msg
FeedbackMsg.msg
Expand All @@ -122,7 +121,7 @@ add_message_files(
## Generate added messages and services with any dependencies listed here
generate_messages(
DEPENDENCIES
geometry_msgs std_msgs
geometry_msgs std_msgs costmap_converter
)

#add dynamic reconfigure api
Expand Down Expand Up @@ -187,6 +186,7 @@ add_library(teb_local_planner
src/teb_config.cpp
src/homotopy_class_planner.cpp
src/teb_local_planner_ros.cpp
src/graph_search.cpp
)

# Dynamic reconfigure: make sure configure headers are built before any node using them
Expand Down
27 changes: 17 additions & 10 deletions cfg/TebLocalPlannerReconfigure.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,14 @@ gen.add("inflation_dist", double_t, 0,
"Buffer zone around obstacles with non-zero penalty costs (should be larger than min_obstacle_dist in order to take effect)",
0.6, 0, 15)

gen.add("dynamic_obstacle_inflation_dist", double_t, 0,
"Buffer zone around predicted locations of dynamic obstacles with non-zero penalty costs (should be larger than min_obstacle_dist in order to take effect)",
0.6, 0, 15)

gen.add("include_dynamic_obstacles", bool_t, 0,
"Specify whether the movement of dynamic obstacles should be predicted by a constant velocity model (this also changes the homotopy class search). If false, all obstacles are considered to be static.",
False)

gen.add("include_costmap_obstacles", bool_t, 0,
"Specify whether the obstacles in the costmap should be taken into account directly (this is necessary if no seperate clustering and detection is implemented)",
True)
Expand Down Expand Up @@ -229,7 +237,11 @@ gen.add("weight_inflation", double_t, 0,

gen.add("weight_dynamic_obstacle", double_t, 0,
"Optimization weight for satisfying a minimum seperation from dynamic obstacles",
10, 0, 1000)
50, 0, 1000)

gen.add("weight_dynamic_obstacle_inflation", double_t, 0,
"Optimization weight for the inflation penalty of dynamic obstacles (should be small)",
0.1, 0, 10)

gen.add("weight_viapoint", double_t, 0,
"Optimization weight for minimizing the distance to via-points",
Expand All @@ -247,10 +259,6 @@ gen.add("enable_multithreading", bool_t, 0,
"Activate multiple threading for planning multiple trajectories in parallel",
True)

gen.add("simple_exploration", bool_t, 0,
"If true, the homotopies are explored usign a simple left-right approach (pass each obstacle on the left or right side) for path generation, otherwise sample possible roadmaps randomly in a specified region between start and goal",
False)

gen.add("max_number_classes", int_t, 0,
"Specify the maximum number of allowed alternative homotopy classes (limits computational effort)",
5, 1, 100)
Expand Down Expand Up @@ -296,10 +304,6 @@ gen.add("h_signature_threshold", double_t, 0,
"Two h-signuteres are assumed to be equal, if both the difference of real parts and complex parts are below the specified threshold",
0.1, 0, 1)

gen.add("obstacle_keypoint_offset", double_t, 0,
"If simple_exploration is turned on, this parameter determines the distance on the left and right side of the obstacle at which a new keypoint will be cretead (in addition to min_obstacle_dist)",
0.1, 0, 5)

gen.add("obstacle_heading_threshold", double_t, 0,
"Specify the value of the normalized scalar product between obstacle heading and goal heading in order to take them (obstacles) into account for exploration)",
0.45, 0, 1)
Expand All @@ -311,7 +315,10 @@ gen.add("viapoints_all_candidates", bool_t, 0,
gen.add("visualize_hc_graph", bool_t, 0,
"Visualize the graph that is created for exploring new homotopy classes",
False)


gen.add("visualize_with_time_as_z_axis_scale", double_t, 0,
"If this value is bigger than 0, the trajectory and obstacles are visualized in 3d using the time as the z-axis scaled by this value. Most useful for dynamic obstacles.",
0, 0, 1)
# Recovery

gen.add("shrink_horizon_backup", bool_t, 0,
Expand Down
47 changes: 32 additions & 15 deletions cfg/rviz_test_optim.rviz
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Panels:
Expanded:
- /Global Options1
Splitter Ratio: 0.5
Tree Height: 535
Tree Height: 562
- Class: rviz/Selection
Name: Selection
- Class: rviz/Tool Properties
Expand All @@ -15,7 +15,7 @@ Panels:
- /2D Nav Goal1
- /Publish Point1
Name: Tool Properties
Splitter Ratio: 0.588679
Splitter Ratio: 0.588679016
- Class: rviz/Views
Expanded:
- /Current View1
Expand All @@ -35,7 +35,7 @@ Visualization Manager:
Color: 160; 160; 164
Enabled: true
Line Style:
Line Width: 0.03
Line Width: 0.0299999993
Value: Lines
Name: Grid
Normal Cell Count: 0
Expand All @@ -47,13 +47,13 @@ Visualization Manager:
Plane Cell Count: 10
Reference Frame: <Fixed Frame>
Value: true
- Alpha: 0.1
Cell Size: 0.1
- Alpha: 0.100000001
Cell Size: 0.100000001
Class: rviz/Grid
Color: 160; 160; 164
Enabled: true
Line Style:
Line Width: 0.03
Line Width: 0.0299999993
Value: Lines
Name: Fine Grid
Normal Cell Count: 0
Expand All @@ -70,30 +70,45 @@ Visualization Manager:
Class: rviz/Path
Color: 25; 255; 0
Enabled: true
Head Diameter: 0.300000012
Head Length: 0.200000003
Length: 0.300000012
Line Style: Lines
Line Width: 0.03
Line Width: 0.0299999993
Name: Path
Offset:
X: 0
Y: 0
Z: 0
Pose Style: None
Radius: 0.0299999993
Shaft Diameter: 0.100000001
Shaft Length: 0.100000001
Topic: /test_optim_node/local_plan
Unreliable: false
Value: true
- Arrow Length: 0.3
- Alpha: 1
Arrow Length: 0.300000012
Axes Length: 0.300000012
Axes Radius: 0.00999999978
Class: rviz/PoseArray
Color: 255; 25; 0
Enabled: true
Head Length: 0.0700000003
Head Radius: 0.0299999993
Name: PoseArray
Shaft Length: 0.230000004
Shaft Radius: 0.00999999978
Shape: Arrow (Flat)
Topic: /test_optim_node/teb_poses
Unreliable: false
Value: true
- Class: rviz/Marker
Enabled: true
Marker Topic: /test_optim_node/teb_markers
Name: Marker
Namespaces:
PointObstacles: true
TebContainer: true
ViaPoints: true
Queue Size: 100
Value: true
- Class: rviz/InteractiveMarkers
Expand Down Expand Up @@ -131,28 +146,30 @@ Visualization Manager:
Class: rviz/Orbit
Distance: 7.77247
Enable Stereo Rendering:
Stereo Eye Separation: 0.06
Stereo Eye Separation: 0.0599999987
Stereo Focal Distance: 1
Swap Stereo Eyes: false
Value: false
Focal Point:
X: 0
Y: 0
Z: 0
Focal Shape Fixed Size: true
Focal Shape Size: 0.0500000007
Name: Current View
Near Clip Distance: 0.01
Pitch: 1.5698
Near Clip Distance: 0.00999999978
Pitch: 1.56979632
Target Frame: <Fixed Frame>
Value: Orbit (rviz)
Yaw: 1.57543
Yaw: 4.71043873
Saved: ~
Window Geometry:
Displays:
collapsed: false
Height: 846
Hide Left Dock: false
Hide Right Dock: true
QMainWindow State: 000000ff00000000fd00000004000000000000013c000002a9fc0200000008fb0000001200530065006c0065006300740069006f006e00000001e10000009b0000006700fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c0061007900730100000043000002a9000000e300fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261000000010000010f000002c4fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a005600690065007700730000000028000002c4000000b300fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e100000197000000030000054a0000003efc0100000002fb0000000800540069006d006501000000000000054a0000023a00fffffffb0000000800540069006d0065010000000000000450000000000000000000000408000002a900000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000
QMainWindow State: 000000ff00000000fd00000004000000000000016a000002c4fc0200000008fb0000001200530065006c0065006300740069006f006e00000001e10000009b0000006400fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c0061007900730100000028000002c4000000dd00fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261000000010000010f000002c4fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a005600690065007700730000000028000002c4000000b000fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e100000197000000030000054a0000003efc0100000002fb0000000800540069006d006501000000000000054a0000030000fffffffb0000000800540069006d00650100000000000004500000000000000000000003da000002c400000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000
Selection:
collapsed: false
Time:
Expand Down
Loading

0 comments on commit 61bd030

Please sign in to comment.