Strange Behaviour in the Dijkstra’s algorithm

Hi!
I have a question on the second lesson of the “Path planning basics” course on Dijkstra’s algorithm.
I have just completed the exercises of this unit and, running the code, I found a strange behaviour on the Dijkstra’s algorithm. I show this screenshot to better understand what it is:

I checked also the solution, and the solution gives me the same behaviour.
Why does the search stop even if there are still available cells? Is there a bug in the solution code?
Thanks in advance

Hello @Simo97,

I tried to reproduce the issue that you are experiencing but I couldn’t. This is what I did:

1.- started the Path Planning course and opened Unit 2: Dijkstra’s algorithm
2.- waited until the terminals and the simulation are shown
3.- executed cd ~/catkin_ws; catkin_make; source devel/setup.bash
4.- Launched roslaunch unit2 unit2_solution.launch
5.- Rviz showed up in the graphical tools window and I used the 2D Nav Goal tool from the toolbar to put the goal there where you image is showing the goal.

It worked as intended, I also made a video:

pp_u2_rviz_solution

As a first suggestion I recommend that you launch the course again from a blank state, preferably after not having used it for a period of time (1 hour or so to allow the previous session to completly shut-down). Then try the above steps again. If this does not work, my second suggestion is that you paste here the output from the terminal where you launch the launch file. This might give us hints on what is happening. Additionally I would like to confirm with you that the provided solution was not modified. To do so please execute these commands:

cd ~/catkin_ws/src/path_planning_course
git diff unit2/scripts/unit2_solution.py

Normally you should not get any output.

I look forward to hearing from you.

Roberto

Hi Roberto!
Thank you for your response. I tried all your suggestions (the solution is not modified), but it does not work.
This is the result on the terminal after launch and after choosing a goal behind the upper wall (first figure):

… logging to /home/user/.ros/log/e84ba958-24c4-11ee-b27a-0242c0a88006/roslaunch-1_xterm-2042.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://1_xterm:34959/

SUMMARY

PARAMETERS

  • /move_base/DWAPlannerROS/acc_lim_theta: 2.0
  • /move_base/DWAPlannerROS/acc_lim_x: 1.0
  • /move_base/DWAPlannerROS/acc_lim_y: 0.0
  • /move_base/DWAPlannerROS/forward_point_distance: 0.325
  • /move_base/DWAPlannerROS/global_frame_id: odom
  • /move_base/DWAPlannerROS/goal_distance_bias: 24.0
  • /move_base/DWAPlannerROS/max_scaling_factor: 0.2
  • /move_base/DWAPlannerROS/max_vel_theta: 5.0
  • /move_base/DWAPlannerROS/max_vel_trans: 0.5
  • /move_base/DWAPlannerROS/max_vel_x: 0.5
  • /move_base/DWAPlannerROS/max_vel_y: 0.0
  • /move_base/DWAPlannerROS/min_vel_theta: 0.4
  • /move_base/DWAPlannerROS/min_vel_trans: 0.1
  • /move_base/DWAPlannerROS/min_vel_x: 0.0
  • /move_base/DWAPlannerROS/min_vel_y: 0.0
  • /move_base/DWAPlannerROS/occdist_scale: 0.5
  • /move_base/DWAPlannerROS/oscillation_reset_dist: 0.05
  • /move_base/DWAPlannerROS/path_distance_bias: 64.0
  • /move_base/DWAPlannerROS/publish_cost_grid_pc: True
  • /move_base/DWAPlannerROS/publish_traj_pc: True
  • /move_base/DWAPlannerROS/scaling_speed: 0.25
  • /move_base/DWAPlannerROS/sim_time: 1.0
  • /move_base/DWAPlannerROS/stop_time_buffer: 0.2
  • /move_base/DWAPlannerROS/theta_stopped_vel: 0.4
  • /move_base/DWAPlannerROS/trans_stopped_vel: 0.1
  • /move_base/DWAPlannerROS/vtheta_samples: 20
  • /move_base/DWAPlannerROS/vx_samples: 6
  • /move_base/DWAPlannerROS/vy_samples: 1
  • /move_base/DWAPlannerROS/xy_goal_tolerance: 0.15
  • /move_base/DWAPlannerROS/yaw_goal_tolerance: 0.3
  • /move_base/GlobalPlanner/allow_unknown: True
  • /move_base/GlobalPlanner/cost_factor: 3.0
  • /move_base/GlobalPlanner/default_tolerance: 0.0
  • /move_base/GlobalPlanner/lethal_cost: 253
  • /move_base/GlobalPlanner/neutral_cost: 50
  • /move_base/GlobalPlanner/old_navfn_behavior: False
  • /move_base/GlobalPlanner/planner_costmap_publish_frequency: 0.0
  • /move_base/GlobalPlanner/planner_window_x: 0.0
  • /move_base/GlobalPlanner/planner_window_y: 0.0
  • /move_base/GlobalPlanner/publish_potential: True
  • /move_base/GlobalPlanner/publish_scale: 100
  • /move_base/GlobalPlanner/use_dijkstra: True
  • /move_base/GlobalPlanner/use_grid_path: False
  • /move_base/GlobalPlanner/use_quadratic: True
  • /move_base/NavfnROS/allow_unknown: False
  • /move_base/NavfnROS/default_tolerance: 0.0
  • /move_base/NavfnROS/planner_window_x: 0.0
  • /move_base/NavfnROS/planner_window_y: 0.0
  • /move_base/NavfnROS/visualize_potential: False
  • /move_base/base_global_planner: srv_client_plugin…
  • /move_base/base_local_planner: dwa_local_planner…
  • /move_base/controller_frequency: 5.0
  • /move_base/controller_patience: 3.0
  • /move_base/global_costmap/global_frame: map
  • /move_base/global_costmap/inflation_layer/cost_scaling_factor: 5.0
  • /move_base/global_costmap/inflation_layer/enabled: True
  • /move_base/global_costmap/inflation_layer/inflation_radius: 0.4
  • /move_base/global_costmap/max_obstacle_height: 0.6
  • /move_base/global_costmap/obstacle_layer/combination_method: 1
  • /move_base/global_costmap/obstacle_layer/enabled: True
  • /move_base/global_costmap/obstacle_layer/mark_threshold: 0
  • /move_base/global_costmap/obstacle_layer/max_obstacle_height: 0.6
  • /move_base/global_costmap/obstacle_layer/observation_sources: scan
  • /move_base/global_costmap/obstacle_layer/obstacle_range: 5.5
  • /move_base/global_costmap/obstacle_layer/origin_z: 0.0
  • /move_base/global_costmap/obstacle_layer/publish_voxel_map: False
  • /move_base/global_costmap/obstacle_layer/raytrace_range: 6.0
  • /move_base/global_costmap/obstacle_layer/scan/clearing: True
  • /move_base/global_costmap/obstacle_layer/scan/data_type: LaserScan
  • /move_base/global_costmap/obstacle_layer/scan/inf_is_valid: True
  • /move_base/global_costmap/obstacle_layer/scan/marking: True
  • /move_base/global_costmap/obstacle_layer/scan/topic: kobuki/laser/scan
  • /move_base/global_costmap/obstacle_layer/track_unknown_space: True
  • /move_base/global_costmap/obstacle_layer/unknown_threshold: 15
  • /move_base/global_costmap/obstacle_layer/z_resolution: 0.2
  • /move_base/global_costmap/obstacle_layer/z_voxels: 10
  • /move_base/global_costmap/plugins: [{‘name’: 'static…
  • /move_base/global_costmap/publish_frequency: 0.2
  • /move_base/global_costmap/robot_base_frame: base_footprint
  • /move_base/global_costmap/robot_radius: 0.15
  • /move_base/global_costmap/static_layer/enabled: True
  • /move_base/global_costmap/transform_tolerance: 0.5
  • /move_base/global_costmap/update_frequency: 0.2
  • /move_base/local_costmap/global_frame: odom
  • /move_base/local_costmap/height: 4.0
  • /move_base/local_costmap/inflation_layer/cost_scaling_factor: 10.0
  • /move_base/local_costmap/inflation_layer/enabled: True
  • /move_base/local_costmap/inflation_layer/inflation_radius: 0.0
  • /move_base/local_costmap/inflation_layer/robot_radius: 0.15
  • /move_base/local_costmap/inflation_radius: 0.0
  • /move_base/local_costmap/max_obstacle_height: 0.6
  • /move_base/local_costmap/obstacle_layer/combination_method: 1
  • /move_base/local_costmap/obstacle_layer/enabled: True
  • /move_base/local_costmap/obstacle_layer/mark_threshold: 0
  • /move_base/local_costmap/obstacle_layer/max_obstacle_height: 0.6
  • /move_base/local_costmap/obstacle_layer/observation_sources: scan
  • /move_base/local_costmap/obstacle_layer/obstacle_range: 5.5
  • /move_base/local_costmap/obstacle_layer/origin_z: 0.0
  • /move_base/local_costmap/obstacle_layer/publish_voxel_map: False
  • /move_base/local_costmap/obstacle_layer/raytrace_range: 6.0
  • /move_base/local_costmap/obstacle_layer/scan/clearing: True
  • /move_base/local_costmap/obstacle_layer/scan/data_type: LaserScan
  • /move_base/local_costmap/obstacle_layer/scan/inf_is_valid: True
  • /move_base/local_costmap/obstacle_layer/scan/marking: True
  • /move_base/local_costmap/obstacle_layer/scan/topic: kobuki/laser/scan
  • /move_base/local_costmap/obstacle_layer/track_unknown_space: True
  • /move_base/local_costmap/obstacle_layer/unknown_threshold: 15
  • /move_base/local_costmap/obstacle_layer/z_resolution: 0.2
  • /move_base/local_costmap/obstacle_layer/z_voxels: 10
  • /move_base/local_costmap/plugins: [{‘name’: 'obstac…
  • /move_base/local_costmap/publish_frequency: 2.0
  • /move_base/local_costmap/resolution: 0.1
  • /move_base/local_costmap/robot_base_frame: base_footprint
  • /move_base/local_costmap/robot_radius: 0.15
  • /move_base/local_costmap/rolling_window: True
  • /move_base/local_costmap/static_layer/enabled: True
  • /move_base/local_costmap/transform_tolerance: 0.5
  • /move_base/local_costmap/update_frequency: 5.0
  • /move_base/local_costmap/width: 4.0
  • /move_base/max_planning_retries: 0
  • /move_base/oscillation_distance: 0.2
  • /move_base/oscillation_timeout: 0.0
  • /move_base/planner_frequency: 0.0
  • /move_base/planner_patience: 5.0
  • /move_base/recovery_behavior_enabled: False
  • /move_base/shutdown_costmaps: False
  • /rosdistro: noetic
  • /rosversion: 1.15.9

NODES
/
dijkstra_exercise (unit2/unit2_solution_server.py)
map_server (map_server/map_server)
move_base (move_base/move_base)
rviz (rviz/rviz)

ROS_MASTER_URI=http://1_simulation:11311

process[map_server-1]: started with pid [2050]
process[move_base-2]: started with pid [2051]
process[rviz-3]: started with pid [2052]
process[dijkstra_exercise-4]: started with pid [2053]
[ WARN] [1689614344.350677099, 237.420000000]: Timed out waiting for transform from base_footprint to map to become available before running costmap, tf error: Could not find a connection between ‘map’ and ‘base_footprint’ because they are not part of the same tree.Tf has two or more unconnected trees… canTransform returned after 237.42 timeout was 0.1.
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to ‘/tmp/runtime-user’
[ INFO] [1689614344.414549466, 237.451000000]: global_costmap: Using plugin “static_layer”
[ INFO] [1689614344.847064750, 237.669000000]: Requesting the map…
[ INFO] [1689614345.052371547, 237.771000000]: Resizing costmap to 74 X 74 at 0.200000 m/pix
[ INFO] [1689614345.250028388, 237.871000000]: Received a 74 X 74 map at 0.200000 m/pix
[ INFO] [1689614345.253577662, 237.873000000]: global_costmap: Using plugin “inflation_layer”
[ INFO] [1689614345.305483411, 237.899000000]: local_costmap: Using plugin “obstacle_layer”
[ INFO] [1689614345.312173486, 237.902000000]: Subscribed to Topics: scan
[ INFO] [1689614345.346798386, 237.919000000]: local_costmap: Using plugin “inflation_layer”
[ INFO] [1689614345.539584244, 238.013000000]: Created local_planner dwa_local_planner/DWAPlannerROS
[ INFO] [1689614345.544632140, 238.015000000]: Sim period is set to 0.20
[ INFO] [1689614355.566511652, 242.993000000]: Recovery behavior will clear layer ‘obstacles’
[ INFO] [1689614355.578054298, 242.999000000]: Recovery behavior will clear layer ‘obstacles’
[ INFO] [1689614355.641558900, 243.031000000]: odom received!
[INFO] [1689614360.518309, 245.452000]: Dijkstra: Done with initialization
[INFO] [1689614376.861268, 252.724000]: Dijkstra: Done traversing nodes in open_list
[WARN] [1689614376.864949, 252.732000]: Dijkstra: No path found!
[WARN] [1689614376.866677, 252.732000]: No path returned by Dijkstra’s shortes path algorithm
[ERROR] [1689614377.075749554, 252.844000000]: Aborting because a valid plan could not be found. Even after executing all recovery behaviors
^C[dijkstra_exercise-4] killing on exit
[move_base-2] killing on exit
[rviz-3] killing on exit
[map_server-1] killing on exit
shutting down processing monitor…
… shutting down processing monitor complete
done

Hello @Simo97,

thank you very much for providing further details.

Upon further investigation I discovered that the two latest commits introduced an error in the function that searches for neighbors. I have reverted those 2 commits in your course instance, tested it and it should be working for you now.

Looking forward to hearing from you,

Cheers,

Roberto

PS: For any other future students I added 2 additional commits that reverts the latest changes so they should not be affected by this bug.

Hi @rzegers,
thank you for your support!

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.