Advertisement
Guest User

path_planner_configuration

a guest
Sep 21st, 2023
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.00 KB | None | 0 0
  1. #AMCL IS NOT NEEDED FOR OUTDOOR GPS BASED NAVIGATION!
  2.  
  3. # amcl:
  4. # ros__parameters:
  5. # use_sim_time: True
  6. # alpha1: 0.2
  7. # alpha2: 0.2
  8. # alpha3: 0.2
  9. # alpha4: 0.2
  10. # alpha5: 0.2
  11. # base_frame_id: "base_footprint"
  12. # beam_skip_distance: 0.5
  13. # beam_skip_error_threshold: 0.9
  14. # beam_skip_threshold: 0.3
  15. # do_beamskip: false
  16. # global_frame_id: "map"
  17. # lambda_short: 0.1
  18. # laser_likelihood_max_dist: 2.0
  19. # laser_max_range: 100.0
  20. # laser_min_range: -1.0
  21. # laser_model_type: "likelihood_field"
  22. # max_beams: 60
  23. # max_particles: 10000 #2000
  24. # min_particles: 2000 #500
  25. # odom_frame_id: "odom"
  26. # pf_err: 0.05
  27. # pf_z: 0.99
  28. # recovery_alpha_fast: 0.0
  29. # recovery_alpha_slow: 0.0
  30. # resample_interval: 1
  31. # robot_model_type: "omnidirectional" #"differential" #
  32. # save_pose_rate: 0.5
  33. # sigma_hit: 0.2
  34. # tf_broadcast: true
  35. # transform_tolerance: 1.0
  36. # update_min_a: 0.2
  37. # update_min_d: 0.25
  38. # z_hit: 0.5
  39. # z_max: 0.05
  40. # z_rand: 0.5
  41. # z_short: 0.05
  42. # scan_topic: fused_scan #left_scan #kinect_sensor/scan
  43.  
  44. # amcl_map_client:
  45. # ros__parameters:
  46. # use_sim_time: True
  47.  
  48. # amcl_rclcpp_node:
  49. # ros__parameters:
  50. # use_sim_time: True
  51. bt_navigator:
  52. ros__parameters:
  53. use_sim_time: True
  54. global_frame: map
  55. robot_base_frame: base_link
  56. odom_topic: /odom
  57. bt_loop_duration: 10
  58. default_server_timeout: 20
  59. enable_groot_monitoring: True
  60. groot_zmq_publisher_port: 1666
  61. groot_zmq_server_port: 1667
  62. # 'default_nav_through_poses_bt_xml' and 'default_nav_to_pose_bt_xml' are use defaults:
  63. # nav2_bt_navigator/navigate_to_pose_w_replanning_and_recovery.xml
  64. # nav2_bt_navigator/navigate_through_poses_w_replanning_and_recovery.xml
  65. # They can be set here or via a RewrittenYaml remap from a parent launch file to Nav2.
  66. plugin_lib_names:
  67. - nav2_compute_path_to_pose_action_bt_node
  68. - nav2_compute_path_through_poses_action_bt_node
  69. - nav2_follow_path_action_bt_node
  70. - nav2_back_up_action_bt_node
  71. - nav2_spin_action_bt_node
  72. - nav2_wait_action_bt_node
  73. - nav2_clear_costmap_service_bt_node
  74. - nav2_is_stuck_condition_bt_node
  75. - nav2_goal_reached_condition_bt_node
  76. - nav2_goal_updated_condition_bt_node
  77. - nav2_initial_pose_received_condition_bt_node
  78. - nav2_reinitialize_global_localization_service_bt_node
  79. - nav2_rate_controller_bt_node
  80. - nav2_distance_controller_bt_node
  81. - nav2_speed_controller_bt_node
  82. - nav2_truncate_path_action_bt_node
  83. - nav2_goal_updater_node_bt_node
  84. - nav2_recovery_node_bt_node
  85. - nav2_pipeline_sequence_bt_node
  86. - nav2_round_robin_node_bt_node
  87. - nav2_transform_available_condition_bt_node
  88. - nav2_time_expired_condition_bt_node
  89. - nav2_distance_traveled_condition_bt_node
  90. - nav2_single_trigger_bt_node
  91. - nav2_is_battery_low_condition_bt_node
  92. - nav2_navigate_through_poses_action_bt_node
  93. - nav2_navigate_to_pose_action_bt_node
  94. - nav2_remove_passed_goals_action_bt_node
  95. - nav2_planner_selector_bt_node
  96. - nav2_controller_selector_bt_node
  97. - nav2_goal_checker_selector_bt_node
  98.  
  99. bt_navigator_rclcpp_node:
  100. ros__parameters:
  101. use_sim_time: True
  102.  
  103. controller_server:
  104. ros__parameters:
  105. use_sim_time: True
  106. controller_frequency: 20.0
  107. min_x_velocity_threshold: 0.01 #0.001
  108. min_y_velocity_threshold: 0.5
  109. min_theta_velocity_threshold: 0.01 #0.001
  110. failure_tolerance: 1.0 #0.3
  111. progress_checker_plugin: "progress_checker"
  112. goal_checker_plugins: ["general_goal_checker"] # "precise_goal_checker"
  113. controller_plugins: ["FollowPath"]
  114.  
  115. # Progress checker parameters
  116. progress_checker:
  117. plugin: "nav2_controller::SimpleProgressChecker"
  118. required_movement_radius: 0.5 #1.0 #0.5
  119. movement_time_allowance: 10.0
  120. # Goal checker parameters
  121. # precise_goal_checker:
  122. # plugin: "nav2_controller::SimpleGoalChecker"
  123. # xy_goal_tolerance: 1.0
  124. # yaw_goal_tolerance: 1.0
  125. # stateful: True
  126. general_goal_checker:
  127. stateful: True
  128. plugin: "nav2_controller::SimpleGoalChecker"
  129. xy_goal_tolerance: 3.0 #0.25
  130. yaw_goal_tolerance: 25.0 #0.25
  131. # DWB parameters
  132. FollowPath:
  133. plugin: "dwb_core::DWBLocalPlanner"
  134. debug_trajectory_details: True
  135. min_vel_x: 0.0
  136. min_vel_y: 0.0
  137. max_vel_x: 15.0
  138. max_vel_y: 0.0
  139. max_vel_theta: 10.0
  140. min_speed_xy: 0.0
  141. max_speed_xy: 26.0
  142. min_speed_theta: 0.0
  143. # Add high threshold velocity for turtlebot 3 issue.
  144. # https://github.com/ROBOTIS-GIT/turtlebot3_simulations/issues/75
  145. acc_lim_x: 25.0
  146. acc_lim_y: 0.0
  147. acc_lim_theta: 25.0
  148. decel_lim_x: -25.0
  149. decel_lim_y: 0.0
  150. decel_lim_theta: -25.0
  151. vx_samples: 20
  152. vy_samples: 5
  153. vtheta_samples: 20
  154. sim_time: 1.7
  155. linear_granularity: 0.05 #0.05 # Distance between consecutive points in the path. Lower values increase resolution but also computational cost.
  156. angular_granularity: 0.25 #0.025 # Minimum change in orientation between path points. Smaller values lead to smoother turns but higher computational expense
  157. transform_tolerance: 0.2
  158. xy_goal_tolerance: 2.0 #0.25
  159. trans_stopped_velocity: 0.25
  160. short_circuit_trajectory_evaluation: True
  161. stateful: True
  162. critics: ["RotateToGoal", "Oscillation", "BaseObstacle", "GoalAlign", "PathAlign", "PathDist", "GoalDist"]
  163. BaseObstacle.scale: 0.02
  164. PathAlign.scale: 32.0
  165. PathAlign.forward_point_distance: 0.1
  166. GoalAlign.scale: 24.0
  167. GoalAlign.forward_point_distance: 0.1
  168. PathDist.scale: 32.0
  169. GoalDist.scale: 24.0
  170. RotateToGoal.scale: 32.0
  171. RotateToGoal.slowing_factor: 5.0
  172. RotateToGoal.lookahead_time: -1.0
  173.  
  174. controller_server_rclcpp_node:
  175. ros__parameters:
  176. use_sim_time: True
  177.  
  178. local_costmap:
  179. local_costmap:
  180. ros__parameters:
  181. #Added below to enable slam
  182. unknown_cost_value: 255
  183. lethal_cost_threshold: 100
  184. update_frequency: 5.0
  185. publish_frequency: 2.0
  186. global_frame: odom
  187. robot_base_frame: base_link
  188. use_sim_time: True
  189. rolling_window: true
  190. width: 50
  191. height: 50
  192. resolution: 0.2
  193. #robot_radius: 0.22
  194. footprint: "[[-4.8025, -1.739], [4.8025, -1.739], [4.8025, 1.739], [-4.8025, 1.739]]"
  195. plugins: ["voxel_layer", "inflation_layer"]
  196. inflation_layer:
  197. plugin: "nav2_costmap_2d::InflationLayer"
  198. cost_scaling_factor: 1.0 #3.0
  199. inflation_radius: 0.5 #2.0 #0.55
  200. voxel_layer:
  201. plugin: "nav2_costmap_2d::VoxelLayer"
  202. enabled: True
  203. publish_voxel_map: True
  204. origin_z: 2.0
  205. z_resolution: 0.2
  206. z_voxels: 32
  207. max_obstacle_height: 2.0 #2.0 # 3.5 m is > 3.041 meters (max truck height)
  208. min_obstacle_height: 0.0 # IGNORING GROUND AS OBSTACLE AND SMALL THING UNDER 0.5 Meters.
  209. mark_threshold: 0
  210. observation_sources: fused_scan #outside_truck_scan #real_kinect_sensor/scan
  211. # outside_truck_scan:
  212. # topic: /outside_truck_scan #/real_kinect_sensor/scan
  213. # max_obstacle_height: 2.0
  214. # clearing: True
  215. # marking: True
  216. # data_type: "LaserScan"
  217. # raytrace_max_range: 50.0 # Half of maximum lidar data range
  218. # raytrace_min_range: 0.0 #Lidar is detecting the cabin itself as obstacle and populating costmap around the robot set param >0.0
  219. # obstacle_max_range: 50.0 # Half of maximum lidar data range
  220. # obstacle_min_range: 0.5
  221. fused_scan:
  222. topic: /fused_scan #/real_kinect_sensor/scan
  223. max_obstacle_height: 2.0
  224. clearing: True
  225. marking: True
  226. data_type: "LaserScan"
  227. raytrace_max_range: 50.0 # Half of maximum lidar data range
  228. raytrace_min_range: 0.0 #Lidar is detecting the cabin itself as obstacle and populating costmap around the robot set param >0.0
  229. obstacle_max_range: 50.0 # Half of maximum lidar data range
  230. obstacle_min_range: 1.0 # > 0.0 avoid that lidar detect truck as obstacle #Lidar is detecting the cabin itself as obstacle and populating costmap around the robot set param >0.0
  231. # right_scan:
  232. # topic: /right_scan
  233. # max_obstacle_height: 2.0
  234. # clearing: True
  235. # marking: True
  236. # data_type: "LaserScan"
  237. # raytrace_max_range: 50.0 # Half of maximum lidar data range
  238. # raytrace_min_range: 0.0
  239. # obstacle_max_range: 50.0 # Half of maximum lidar data range
  240. # obstacle_min_range: 0.0
  241. static_layer:
  242. map_subscribe_transient_local: True
  243. always_send_full_costmap: True
  244. local_costmap_client:
  245. ros__parameters:
  246. use_sim_time: True
  247. local_costmap_rclcpp_node:
  248. ros__parameters:
  249. use_sim_time: True
  250.  
  251. global_costmap:
  252. global_costmap:
  253. ros__parameters:
  254. unknown_cost_value: 255 # slightly less than 255 to be more explorative
  255. lethal_cost_threshold: 100
  256. #Added above to improve slam exploration
  257. update_frequency: 1.0
  258. publish_frequency: 1.0
  259. global_frame: map
  260. robot_base_frame: base_link
  261. use_sim_time: True
  262. footprint: "[[-4.8025, -1.739], [4.8025, -1.739], [4.8025, 1.739], [-4.8025, 1.739]]"
  263. #robot_radius: 0.22
  264. resolution: 0.2
  265. track_unknown_space: true
  266. plugins: ["static_layer", "obstacle_layer", "inflation_layer"]
  267. obstacle_layer:
  268. plugin: "nav2_costmap_2d::ObstacleLayer"
  269. enabled: True
  270. observation_sources: fused_scan #outside_truck_scan #left_scan real_kinect_sensor/scan
  271. outside_truck_scan:
  272. topic: /fused_scan
  273. max_obstacle_height: 2.0
  274. clearing: True
  275. marking: True
  276. data_type: "LaserScan"
  277. raytrace_max_range: 100.0
  278. raytrace_min_range: 0.0
  279. obstacle_max_range: 25.0
  280. obstacle_min_range: 1.0
  281. # fused_scan:
  282. # topic: /fused_scan
  283. # max_obstacle_height: 2.0
  284. # clearing: True
  285. # marking: True
  286. # data_type: "LaserScan"
  287. # raytrace_max_range: 100.0
  288. # raytrace_min_range: 0.0
  289. # obstacle_max_range: 25.0
  290. # obstacle_min_range: 1.0
  291. static_layer:
  292. plugin: "nav2_costmap_2d::StaticLayer"
  293. map_subscribe_transient_local: True
  294. inflation_layer:
  295. plugin: "nav2_costmap_2d::InflationLayer"
  296. cost_scaling_factor: 1.0 #3.0
  297. inflation_radius: 0.5 #2.0 #0.55
  298. always_send_full_costmap: True
  299. global_costmap_client:
  300. ros__parameters:
  301. use_sim_time: True
  302. global_costmap_rclcpp_node:
  303. ros__parameters:
  304. use_sim_time: True
  305.  
  306. map_server:
  307. ros__parameters:
  308. use_sim_time: True
  309. yaml_filename: "infinite_map.yaml"
  310.  
  311. map_saver:
  312. ros__parameters:
  313. use_sim_time: True
  314. save_map_timeout: 5.0
  315. free_thresh_default: 0.25
  316. occupied_thresh_default: 0.65
  317. map_subscribe_transient_local: True
  318.  
  319. planner_server:
  320. ros__parameters:
  321. expected_planner_frequency: 20.0
  322. use_sim_time: True
  323. planner_plugins: ["GridBased"]
  324.  
  325. GridBased:
  326. plugin: "nav2_smac_planner/SmacPlannerHybrid" #"nav2_smac_planner/SmacPlannerLattice"
  327. downsample_costmap: false
  328. downsampling_factor: 1
  329. tolerance: 1.0 #0.5 #0.25 # Adjust based on how much error you can tolerate in the planned path
  330. allow_unknown: true
  331. cost_scaling_factor: 0.9
  332. neutral_cost: 50
  333. max_iterations: 1000000
  334. max_on_approach_iterations: 1000
  335. max_planning_time: 10.0 # If you find planning takes too long, you might want to lower this
  336. motion_model_for_search: "DUBIN" #"REEDS_SHEPP"
  337. angle_quantization_bins: 72
  338. analytic_expansion_ratio: 3.5
  339. analytic_expansion_max_length: 3.0
  340. #The parameter below creates a curve shape of the end of planner forcing a curved
  341. minimum_turning_radius: 0.00001 # Adjust based on your robot's actual turning radius
  342. reverse_penalty: 2.0
  343. change_penalty: 0.0
  344. non_straight_penalty: 1.2
  345. cost_penalty: 2.0
  346. retrospective_penalty: 0.015
  347. lookup_table_size: 20.0
  348. cache_obstacle_heuristic: false
  349. smooth_path: True # If your robot can handle sharp turns, you might not need path smoothing
  350. costmap:
  351. resolution: 0.75 #0.2
  352. #width: 25 #150
  353. #height: 25 #150
  354. #radius: 0.22
  355. footprint: "[[-4.8025, -1.739], [4.8025, -1.739], [4.8025, 1.739], [-4.8025, 1.739]]"
  356.  
  357.  
  358. smoother:
  359. max_iterations: 2000 #1000
  360. w_smooth: 1.0 #0.5 # 0.3 # Adjust based on how much smoothing you want (higher value means more smoothing)
  361. w_data: 1.0 #0.5 #0.2 # Adjust based on how closely you want the smoothed path to adhere to the original path
  362. tolerance: 1.0e-10
  363. do_refinement: true
  364. refinement_num: 10 #2
  365.  
  366. planner_server_rclcpp_node:
  367. ros__parameters:
  368. use_sim_time: True
  369.  
  370. recoveries_server:
  371. ros__parameters:
  372. costmap_topic: local_costmap/costmap_raw
  373. footprint_topic: local_costmap/published_footprint
  374. cycle_frequency: 10.0
  375. recovery_plugins: ["spin", "backup", "wait"]
  376. spin:
  377. plugin: "nav2_recoveries/Spin"
  378. backup:
  379. plugin: "nav2_recoveries/BackUp"
  380. wait:
  381. plugin: "nav2_recoveries/Wait"
  382. global_frame: odom
  383. robot_base_frame: base_link
  384. transform_timeout: 0.1
  385. use_sim_time: true
  386. simulate_ahead_time: 2.0
  387. max_rotational_vel: 1.0
  388. min_rotational_vel: 0.4
  389. rotational_acc_lim: 3.2
  390.  
  391. robot_state_publisher:
  392. ros__parameters:
  393. use_sim_time: True
  394.  
  395. waypoint_follower:
  396. ros__parameters:
  397. loop_rate: 20
  398. stop_on_failure: false
  399. waypoint_task_executor_plugin: "wait_at_waypoint"
  400. wait_at_waypoint:
  401. plugin: "nav2_waypoint_follower::WaitAtWaypoint"
  402. enabled: True
  403. waypoint_pause_duration: 200
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement