Guest User

nav2_params.yaml

a guest
Apr 16th, 2024
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 31.16 KB | None | 0 0
  1. # GPS WPF CHANGES:
  2. # - amcl params where removed. They are not needed because global localization is provided
  3. # by an ekf node on robot_localization fusing gps data with local odometry sources
  4. # - static layer is removed from both costmaps, in this tutorial we assume there is no map
  5. # of the environment
  6. # - global costmap is set to be rolling to allow the robot to traverse big environment by
  7. # following successive relatively close waypoints that fit in a smaller rolling costmap
  8.  
  9. bt_navigator:
  10. ros__parameters:
  11. bt_loop_duration: 0.1 # Sets the BT loop duration to 100ms (10Hz), for example.
  12. global_frame: map
  13. robot_base_frame: base_link
  14. odom_topic: /odom
  15. bt_loop_duration: 10
  16. default_server_timeout: 20
  17. navigators: ["navigate_to_pose", "navigate_through_poses"]
  18. navigate_to_pose:
  19. plugin: "nav2_bt_navigator/NavigateToPoseNavigator"
  20. navigate_through_poses:
  21. plugin: "nav2_bt_navigator/NavigateThroughPosesNavigator"
  22. # 'default_nav_through_poses_bt_xml' and 'default_nav_to_pose_bt_xml' are use defaults:
  23. # nav2_bt_navigator/navigate_to_pose_w_replanning_and_recovery.xml
  24. # nav2_bt_navigator/navigate_through_poses_w_replanning_and_recovery.xml
  25. # They can be set here or via a RewrittenYaml remap from a parent launch file to Nav2.
  26. plugin_lib_names:
  27. - nav2_compute_path_to_pose_action_bt_node
  28. - nav2_compute_path_through_poses_action_bt_node
  29. - nav2_smooth_path_action_bt_node
  30. - nav2_follow_path_action_bt_node
  31. # - nav2_spin_action_bt_node
  32. - nav2_wait_action_bt_node
  33. - nav2_assisted_teleop_action_bt_node
  34. - nav2_back_up_action_bt_node
  35. - nav2_drive_on_heading_bt_node
  36. - nav2_clear_costmap_service_bt_node
  37. - nav2_is_stuck_condition_bt_node
  38. - nav2_goal_reached_condition_bt_node
  39. - nav2_goal_updated_condition_bt_node
  40. - nav2_globally_updated_goal_condition_bt_node
  41. - nav2_is_path_valid_condition_bt_node
  42. - nav2_are_error_codes_active_condition_bt_node
  43. - nav2_would_a_controller_recovery_help_condition_bt_node
  44. - nav2_would_a_planner_recovery_help_condition_bt_node
  45. - nav2_would_a_smoother_recovery_help_condition_bt_node
  46. - nav2_initial_pose_received_condition_bt_node
  47. - nav2_reinitialize_global_localization_service_bt_node
  48. - nav2_rate_controller_bt_node
  49. - nav2_distance_controller_bt_node
  50. - nav2_speed_controller_bt_node
  51. - nav2_truncate_path_action_bt_node
  52. - nav2_truncate_path_local_action_bt_node
  53. - nav2_goal_updater_node_bt_node
  54. - nav2_recovery_node_bt_node
  55. - nav2_pipeline_sequence_bt_node
  56. - nav2_round_robin_node_bt_node
  57. - nav2_transform_available_condition_bt_node
  58. - nav2_time_expired_condition_bt_node
  59. - nav2_path_expiring_timer_condition
  60. - nav2_distance_traveled_condition_bt_node
  61. - nav2_single_trigger_bt_node
  62. - nav2_goal_updated_controller_bt_node
  63. - nav2_is_battery_low_condition_bt_node
  64. - nav2_navigate_through_poses_action_bt_node
  65. - nav2_navigate_to_pose_action_bt_node
  66. - nav2_remove_passed_goals_action_bt_node
  67. - nav2_planner_selector_bt_node
  68. - nav2_controller_selector_bt_node
  69. - nav2_goal_checker_selector_bt_node
  70. - nav2_controller_cancel_bt_node
  71. - nav2_path_longer_on_approach_bt_node
  72. - nav2_wait_cancel_bt_node
  73. # - nav2_spin_cancel_bt_node
  74. - nav2_back_up_cancel_bt_node
  75. - nav2_assisted_teleop_cancel_bt_node
  76. - nav2_drive_on_heading_cancel_bt_node
  77. - nav2_is_battery_charging_condition_bt_node
  78. error_code_names:
  79. - compute_path_error_code
  80. - follow_path_error_code
  81.  
  82.  
  83.  
  84. # GPS WPF CHANGE: Remove static layer
  85. local_costmap:
  86. local_costmap:
  87. ros__parameters:
  88. update_frequency: 5.0 #20.0 #5.0
  89. publish_frequency: 2.0
  90. global_frame: odom
  91. robot_base_frame: base_link
  92. rolling_window: true
  93. width: 60
  94. height: 60
  95. #track_unknown_space: true
  96. resolution: 0.05
  97. #robot_radius: 5.0 #0.22
  98. footprint: "[[-4.8025, -1.739], [4.8025, -1.739], [4.8025, 1.739], [-4.8025, 1.739]]"
  99. plugins: ["inflation_layer", "voxel_layer"] # "range_sensor_layer"]
  100. inflation_layer:
  101. plugin: "nav2_costmap_2d::InflationLayer"
  102. cost_scaling_factor: 3.0
  103. inflation_radius: 2.0 #0.55
  104. voxel_layer:
  105. plugin: "nav2_costmap_2d::VoxelLayer"
  106. enabled: True
  107. publish_voxel_map: True
  108. origin_z: 2.0 #0.0
  109. z_resolution: 0.2 #0.05
  110. z_voxels: 16 #Only works with 16 not 32
  111. max_obstacle_height: 2.0
  112. mark_threshold: 0
  113. observation_sources: fused_scan #left_scan right_scan sick_scan_2D
  114. # sick_scan_2D:
  115. # topic: /sick_scan_2D
  116. # max_obstacle_height: 2.0
  117. # clearing: True
  118. # marking: True
  119. # data_type: "LaserScan"
  120. # raytrace_max_range: 50.0
  121. # raytrace_min_range: 0.0
  122. # obstacle_max_range: 50.0
  123. # obstacle_min_range: 1.0
  124. # left_scan:
  125. # topic: /left_scan
  126. # max_obstacle_height: 2.0
  127. # clearing: True
  128. # marking: True
  129. # data_type: "LaserScan"
  130. # raytrace_max_range: 50.0
  131. # raytrace_min_range: 0.0
  132. # obstacle_max_range: 50.0
  133. # obstacle_min_range: 1.0
  134. # right_scan:
  135. # topic: /right_scan
  136. # max_obstacle_height: 2.0
  137. # clearing: True
  138. # marking: True
  139. # data_type: "LaserScan"
  140. # raytrace_max_range: 50.0
  141. # raytrace_min_range: 0.0
  142. # obstacle_max_range: 50.0
  143. # obstacle_min_range: 1.0
  144. fused_scan:
  145. topic: /fused_scan
  146. max_obstacle_height: 2.0
  147. clearing: True
  148. marking: True
  149. data_type: "LaserScan"
  150. raytrace_max_range: 60.0
  151. raytrace_min_range: 0.0
  152. obstacle_max_range: 60.0
  153. obstacle_min_range: 1.0
  154. # range_sensor_layer: #IT delays too much to send data, issues with planner and control when integrated
  155. # plugin: "nav2_costmap_2d::RangeSensorLayer"
  156. # enabled: True
  157. # transform_tolerance: 0.3
  158. # clear_on_max_reading: true
  159. # topics: ["/ultrassonic/front_left"]
  160. # clear_threshold: 0.2
  161. # mark_threshold: 0.8
  162. # no_readings_timeout: 5.0
  163. # clear_after_reading: true
  164. # max_distance: 5.0
  165. # min_distance: 0.2
  166. # clear_on_max_reading: true
  167. # buffer_size: 10
  168. # observation_persistence: 2.0
  169. # inf_is_valid: false
  170. always_send_full_costmap: True
  171. # local_costmap_client:
  172. # ros__parameters:
  173. # use_sim_time: True
  174. # local_costmap_rclcpp_node:
  175. # ros__parameters:
  176. # use_sim_time: True
  177.  
  178. # GPS WPF CHANGE: Remove static layer
  179. # GPS WPF CHANGE: Set rolling global costmap with 50x50 size. See note below
  180. global_costmap:
  181. global_costmap:
  182. ros__parameters:
  183. #unknown_cost_value: 120 #255 #0# slightly less than 255 to be more explorative
  184. lethal_cost_threshold: 100
  185. update_frequency: 1.0
  186. publish_frequency: 1.0
  187. global_frame: map
  188. robot_base_frame: base_link
  189. #use_sim_time: True
  190. #robot_radius: 5.0 #0.22
  191. footprint: "[[-4.8025, -1.739], [4.8025, -1.739], [4.8025, 1.739], [-4.8025, 1.739]]"
  192. resolution: 0.05 #0.1 # Reduced by hald to produce more distant paths
  193. # When using GPS navigation you will potentially traverse huge environments which are not practical to
  194. # fit on a big static costmap. Thus it is recommended to use a rolling global costmap large enough to
  195. # contain each pair of successive waypoints. See: https://github.com/ros-planning/navigation2/issues/2174
  196. rolling_window: True
  197. width: 90
  198. height: 90
  199. track_unknown_space: true
  200. # no static map
  201. plugins: ["obstacle_layer", "inflation_layer"]
  202. #plugins: ["static_layer", "inflation_layer", "obstacle_layer"] # We won't use static map
  203. obstacle_layer:
  204. plugin: "nav2_costmap_2d::ObstacleLayer"
  205. enabled: True
  206. observation_sources: fused_scan #left_scan right_scan sick_scan_2D
  207. # left_scan:
  208. # topic: /left_scan
  209. # max_obstacle_height: 2.0
  210. # clearing: True
  211. # marking: True
  212. # data_type: "LaserScan"
  213. # raytrace_max_range: 50.0
  214. # raytrace_min_range: 0.0
  215. # obstacle_max_range: 25.0
  216. # obstacle_min_range: 0.0
  217. # # outdoors there will probably be more inf points
  218. # inf_is_valid: true
  219. # #OTHER SCAN SOURCE
  220. # right_scan:
  221. # topic: /right_scan
  222. # max_obstacle_height: 2.0
  223. # clearing: True
  224. # marking: True
  225. # data_type: "LaserScan"
  226. # raytrace_max_range: 50.0
  227. # raytrace_min_range: 0.0
  228. # obstacle_max_range: 25.0
  229. # obstacle_min_range: 1.0
  230. # # outdoors there will probably be more inf points
  231. # inf_is_valid: true
  232. fused_scan:
  233. topic: /fused_scan
  234. max_obstacle_height: 2.0
  235. clearing: True
  236. marking: True
  237. data_type: "LaserScan"
  238. raytrace_max_range: 90.0
  239. raytrace_min_range: 0.0
  240. obstacle_max_range: 90.0
  241. obstacle_min_range: 1.0
  242. # sick_scan_2D:
  243. # topic: /sick_scan_2D
  244. # max_obstacle_height: 2.0
  245. # clearing: True
  246. # marking: True
  247. # data_type: "LaserScan"
  248. # raytrace_max_range: 50.0
  249. # raytrace_min_range: 0.0
  250. # obstacle_max_range: 50.0
  251. # obstacle_min_range: 1.0
  252. inflation_layer:
  253. plugin: "nav2_costmap_2d::InflationLayer"
  254. cost_scaling_factor: 3.0 #3.0
  255. inflation_radius: 2.0 #0.5 #0.55
  256. always_send_full_costmap: True
  257. # global_costmap_client:
  258. # ros__parameters:
  259. # use_sim_time: True
  260. # global_costmap_rclcpp_node:
  261. # ros__parameters:
  262. # use_sim_time: True
  263.  
  264. # The yaml_filename does not need to be specified since it going to be set by defaults in launch.
  265. # If you'd rather set it in the yaml, remove the default "map" value in the tb3_simulation_launch.py
  266. # file & provide full path to map below. If CLI map configuration or launch default is provided, that will be used.
  267.  
  268. # map_server:
  269. # ros__parameters:
  270. # use_sim_time: True
  271. # yaml_filename: "infinite_map.yaml"
  272.  
  273. map_saver:
  274. ros__parameters:
  275. #use_sim_time: True
  276. save_map_timeout: 5.0
  277. free_thresh_default: 0.25
  278. occupied_thresh_default: 0.65
  279. map_subscribe_transient_local: True
  280.  
  281. #GLOBAL PLANNER
  282. planner_server:
  283. ros__parameters:
  284. expected_planner_frequency: 20.0 # Expected frequency for the planner to run in Hz.
  285. #use_sim_time: True # If simulation time should be used.
  286. planner_plugins: ["GridBased"]
  287. GridBased:
  288. plugin: "nav2_smac_planner/SmacPlannerHybrid" # The plugin used for planning, here Hybrid-A*.
  289. downsample_costmap: true #false #switched to true to see if reach greater paths # Whether the costmap should be downsampled.
  290. transform_tolerance: 1.0 #0.3 # Increased over 3 times the time tolerance to calculate a path, otherwise just close waypoints will produce a path, since it take time to generate a path for large areas
  291. downsampling_factor: 1
  292. allow_unknown: true # If planning through unknown space is allowed.
  293. tolerance: 1.0 # Tolerance for planning in meters: Given the size of truck 1 meter is not so huge...
  294. max_iterations: 1000000 # Max iterations the planner can take before stopping.
  295. max_on_approach_iterations: 1000 # Iterations to try to find an exact solution once within goal tolerance.
  296. max_planning_time: 10.0 #30.0 #15.0 # Max planning time in seconds.# I have doubled the time to allow computate far waypoitns, wich require more time to produce a bigger path (greater lenght)
  297. motion_model_for_search: "DUBIN" # The motion model used for planning. "DUBIN" for non-holonomic robots without reverse gear, "REEDS_SHEPP" for those with.
  298. angle_quantization_bins: 72 # Number of bins for quantizing angles. More bins, the finer the search resolution.
  299. minimum_turning_radius: 11.6 # Minimum turning radius for the vehicle in meters. 11.6 official value given by manual
  300. reverse_penalty: 2.0 # Penalty for reversing. Higher values discourage reversing.
  301. change_penalty: 0.0 # Penalty for changing direction.
  302. non_straight_penalty: 1.2 # Penalty for non-straight motions. Encourages straighter paths.
  303. cost_penalty: 3.0 # Penalty for traversing high-cost cells. Higher values make the robot more cost-sensitive.
  304. retrospective_penalty: 0.03
  305. non_straight_penalty: 1.2
  306. lookup_table_size: 25.0 # Increased for complex environment handling
  307. cache_obstacle_heuristic: True # Caches the heuristic calculations for obstacle-laden areas to speed up planning.
  308. debug_visualizations: True # Enables debug visualizations in RViz.
  309. analytic_expansion_ratio: 3.5 # Multiplier for how often analytic expansions are attempted.
  310. analytic_expansion_max_length: 3.0 # Maximum allowed length for an analytic expansion.
  311. smooth_path: True
  312. # Each of these parameters allows for fine-tuning the planner's behavior to suit the specific needs of your application and the characteristics of the environment.
  313. # The analytic_expansion_ratio and analytic_expansion_max_length, for example, are particularly useful in complex or highly constrained environments where the standard grid-based search might struggle to find an optimal path.
  314. costmap:
  315. resolution: 0.05 # 0.05 # Smaller resolution captures more detail, useful for larger areas
  316. width: 90 #150
  317. height: 90 #150
  318. #radius: 0.22
  319. footprint: "[[-4.8025, -1.739], [4.8025, -1.739], [4.8025, 1.739], [-4.8025, 1.739]]"
  320.  
  321. #LOCAL PLANNER
  322. controller_server:
  323. ros__parameters:
  324. controller_frequency: 50.0 #20.0
  325. min_x_velocity_threshold: 0.01
  326. min_y_velocity_threshold: 0.5
  327. min_theta_velocity_threshold: 0.01
  328. failure_tolerance: 1.0 #0.3
  329. progress_checker_plugins: ["progress_checker"]
  330. #goal_checker_plugins: ["general_goal_checker"] # "precise_goal_checker"
  331. goal_checker_plugins: ["front_cabin_goal_checker"] # I have developed this one
  332. front_cabin_goal_checker:
  333. plugin: "nav2_bringup/FrontCabinGoalChecker"
  334. front_offset: 5.0 # Adjust as necessary
  335. xy_goal_tolerance: 0.5 # Meters
  336. yaw_goal_tolerance: 0.1 # Radians
  337.  
  338. controller_plugins: ["FollowPath"]
  339.  
  340. # Progress checker parameters
  341. progress_checker:
  342. plugin: "nav2_controller::SimpleProgressChecker"
  343. required_movement_radius: 2.0 # Tamanho minimo em metros que considera que o caminhão não esta progredindo senão andou isso.
  344. movement_time_allowance: 15.0
  345.  
  346. # Goal checker parameters
  347. #precise_goal_checker:
  348. # plugin: "nav2_controller::SimpleGoalChecker"
  349. # xy_goal_tolerance: 0.25
  350. # yaw_goal_tolerance: 0.25
  351. # stateful: True
  352.  
  353. # general_goal_checker:
  354. # stateful: True
  355. # plugin: "nav2_controller::SimpleGoalChecker"
  356. # xy_goal_tolerance: 1.0 #1.5 # meters wE CANNOT LET IT DEVIATE TO MUCH FROM CENTER OF PLANNED TRAJECTORY, IT MUST TRACK AND FOLLOW IT KEEPING ON CENTER
  357. # yaw_goal_tolerance: 0.2 # 0.25 rad = 14 degrees
  358.  
  359. FollowPath:
  360. plugin: "nav2_mppi_controller::MPPIController"
  361. # MPPI specific parameters
  362. time_steps: 112 #30 # Increasing this value consumer more computer resources, however is needed to increase time horizon and get more smooth possible paths, increaseing time-horizon
  363. model_dt: 0.02 # Adjust to match your control loop timing , frequency = 50, dt = 150 = 0.02
  364. #TIME HORIZON = model_dt * time_steps --> predicted horizon is about 2.24 seconds x 10 m/s (Transboard vel) = 22.4 meters < 50 meters of local costmap size (Ok is under the costmap size)
  365. batch_size: 1000 #1000 # Lowered to reduce computational load
  366. vx_std: 0.1 #0.2 # Adjust based on expected velocity deviations
  367. #vy_std: 0.2 # Set to 0 as lateral movement is not applicable
  368. wz_std: 0.5 # Adjust based on expected angular velocity deviations
  369. vx_max: 1.0 #8.5 # 5.0 # Set to your robot's max forward velocity= 8.5 m/s = 30 km/h (Transbord Operation)
  370. vx_min: -2.25 # Set to your robot's max reverse velocity if applicable, else set to 0
  371. vy_max: 0.0 # Set to 0 as lateral movement is not applicable
  372. wz_max: 2.0 # Set to your robot's max angular velocity
  373. iteration_count: 2 #5 # Adjust based on the desired quality of the solution vs. computational time
  374. temperature: 0.2 # Lowered to encourage less exploration in the control space, following the optimal path, avoiding unncessary exploitation and selection of suboptimal paths (offset, paralle routes), focusing on optimum path and smooth trajectories.
  375. gamma: 0.01 #0.015 # Adjust based on your system's response to control inputs. I have reduced from 0.015 to 0.01 to favor smoother trajectory following.
  376. motion_model: "Ackermann" # Changed to Ackermann to match your robot's model
  377. retry_attempt_limit: 5 # Sets the number of attempts to find a feasible trajectory before failure. Higher values increase resilience to transient navigation difficulties.
  378. reset_period: 1.0 # Time of inactivity required to reset the optimizer, helping recover from bad states. Relevant for maintaining consistent controller performance.
  379. regenerate_noises: false
  380. #TRAJECTORY VISUALIZATION
  381. visualize: true # Enable to visualize sampled trajectories in RViz. Useful for debugging and tuning, but may impact performance due to data volume.
  382. trajectory_step: 5 # Determines the step between visualized trajectories. A value of 5 means every 5th trajectory is visualized, reducing data volume for clarity.
  383. time_step: 3 # Sets the step between points on visualized trajectories. A value of 3 means every 3rd point is shown, balancing detail with visualization manageability.
  384. #PATH HANDLER PARAMS
  385. transform_tolerance: 0.3 # Sets the tolerance for data transformations in seconds. A value of 0.3 allows for a broader window to accommodate potential delays in receiving GPS data and other sensor inputs, ensuring effective synchronization of data from different sources. This is particularly important in off-road conditions where GPS signal delays or inconsistencies might occur, helping to maintain accurate and reliable navigation despite these challenges.
  386. prune_distance: 25.0 # Balanced foresight for smoother, efficient navigation # I am setting to be greater than twice of the truck size
  387. ## Distance ahead of the nearest path point to the truck to prune the path.
  388. # Determines the length of the path segment considered for current navigation decisions.
  389. # Increasing this distance allows for more foresighted planning, enabling smoother maneuvers and better anticipation of upcoming path changes.
  390. # Too high a value might overload the system with distant path details, while too low could lead to short-sighted navigation,
  391. # potentially missing out on efficient route adjustments or preparation for future obstacles and turns.
  392. max_robot_pose_search_dist: 25.0 # Enhanced path reacquisition range for large vehicle dynamics
  393. ## Max integrated distance ahead of robot pose to search for the nearest path point.
  394. # A higher value allows for a broader search area to reacquire the path after deviations,
  395. # especially useful in complex or looping paths. It ensures the truck can find its way back to the path efficiently,
  396. # enhancing navigation robustness in dynamic environments or after unexpected detours.
  397. # However, setting it too high may increase computational load without proportional benefits.
  398. enforce_path_inversion: false # Disables strict adherence to path inversions to promote smoother driving. Useful for avoiding unnecessary and potentially sharp direction changes that can disrupt passenger comfort. Set to true only if precise path following, including exact direction changes, is critical for operation.
  399. inversion_xy_tolerance: 0.2 # Adjusts how closely the truck needs to get to a path inversion point before considering it reached, in meters. A larger value smooths out navigation by reducing the need for precise alignment with path inversion points, minimizing abrupt steering adjustments. Ideal for ensuring passenger comfort by prioritizing smoother transitions over strict path fidelity.
  400. inversion_yaw_tolerance: 0.4 # Sets the angular tolerance for considering a path inversion point achieved, in radians. Increasing this tolerance allows for smoother turns by reducing the precision required in aligning with the path's intended direction changes. This helps in maintaining a comfortable ride by avoiding sharp or oscillatory steering behaviors.
  401.  
  402. AckermannConstraints:
  403. min_turning_r: 11.6 # Adjust to match your vehicle's minimum turning radius, 11.6 official value given by manual
  404.  
  405. critics: ["PathFollowCritic"] #, "GoalCritic", GoalAngleCritic]
  406. #critics: ["ObstaclesCritic", "GoalCritic", "PathAlignCritic", "PathFollowCritic", "GoalAngleCritic", "PathAngleCritic", "PreferForwardCritic", "TwirlingCritic"] #"CostCritic"
  407. # # Critics configuration (adjust weights and parameters based on your environment and requirements)
  408. PathFollowCritic:
  409. enabled: true
  410. cost_weight: 10.0 #7.2 # Prioritizes progression along the path, key for efficient navigation in variable off-road conditions.
  411. cost_power: 3 #2 # Quadratic cost scaling to deter deviations from the path, ensuring diligent path tracking.
  412. threshold_to_consider: 2.0 # Adjusted for the truck's dimensions, allowing path follow behavior up until closer proximity to the goal.
  413. offset_from_furthest: 4 # Optimized to keep the vehicle aligned with the path's most relevant segments, enhancing navigational accuracy.
  414.  
  415. # ObstaclesCritic:
  416. # enabled: true
  417. # critical_weight: 50.0 # Increases penalty for near-collision scenarios, crucial for a large off-road truck to maintain safe distances from obstacles.
  418. # repulsion_weight: 3.0 # Enhances general obstacle avoidance, providing a balance between safety and efficiency in dynamic environments.
  419. # cost_power: 2 # Quadratic scaling of obstacle costs, promoting safer routes by penalizing closer obstacles more heavily.
  420. # consider_footprint: true # Essential for accurate obstacle avoidance, considering the truck's entire physical footprint.
  421. # collision_cost: 250000.0 # Sets a high penalty for collisions, reflecting the greater impact of collisions for larger vehicles.
  422. # collision_margin_distance: 0.75 # A wider margin to severely penalize near-collision paths, suitable for the truck's size.
  423. # near_goal_distance: 1.0 # Allows smoother goal convergence by relaxing obstacle avoidance near the goal, accommodating the truck's navigation needs.
  424. # cost_scaling_factor: 5.0 # Consistent with the inflation layer, ensuring coherent obstacle cost scaling.
  425. # inflation_radius: 1.0 # A larger radius around obstacles, providing a safer navigation buffer for the truck.
  426. # inflation_layer_name: "" # Specify if using multiple inflation layers and a particular one is needed for obstacle inflation.
  427. # GoalAngleCritic:
  428. # enabled: true
  429. # cost_weight: 10.0
  430. # cost_power: 2
  431. # threshold_to_consider: 0.25 # # Tighter orientation alignment required
  432. # GoalCritic:
  433. # enabled: true
  434. # threshold_to_consider: 1.0 #2.0 # Increased to 2 meters to start considering goal distance cost from a greater distance, accommodating the truck's larger size and ensuring smoother transitions to goal-directed movement.
  435. # cost_power: 2 #2 # Set to 2 to apply a quadratic scaling of goal distance cost, encouraging more direct approaches as the truck gets closer to the goal.
  436. # cost_weight: 15.0 #7.0 # Increase to place a higher emphasis on moving directly towards the goal when in proximity, suitable for ensuring efficient navigation in off-road conditions.
  437. # # CostCritic: # For some reason using this set of parameters below avoid tuck start the gps following feature...
  438. # # enabled: true
  439. # # cost_weight: 4.0 # Higher weight prioritizes avoidance of high-cost areas, crucial for off-road navigation where obstacles can be unpredictable.
  440. # # cost_power: 2 # Quadratic scaling increases the penalty for nearing obstacles, encouraging safer routes.
  441. # # consider_footprint: true # Utilizes the full vehicle footprint for calculating costs, essential for accurately assessing the truck's interaction with obstacles.
  442. # # collision_cost: 1000000.0 # A very high cost for collisions emphasizes the importance of avoiding obstacles entirely.
  443. # # critical_cost: 500.0 # Increases the cost for being in the inflated space around obstacles, encouraging a safer distance from potential hazards.
  444. # # near_goal_distance: 1.0 # Expands the distance near the goal where obstacle costs are less emphasized, allowing for smoother goal convergence.
  445. # # inflation_layer_name: "" # Specify if using multiple inflation layers and a particular one is needed for cost calculations.
  446. # PathAlignCritic:
  447. # enabled: true
  448. # cost_weight: 6.0 #12.0 # Higher weight on path alignment to ensure efficient navigation along the planned global path in off-road terrain.
  449. # cost_power: 1 #2 # Quadratic cost scaling to more heavily penalize deviations from the path, promoting tighter adherence to the route.
  450. # threshold_to_consider: 1.0 # Increased distance for path alignment focus, accommodating the truck's size and the navigational challenges of off-road terrain.
  451. # offset_from_furthest: 10 # Adjusted to ensure path alignment is considered earlier, aiding in consistent path tracking in variable off-road conditions.
  452. # max_path_occupancy_ratio: 0.2 #0.1 # A slightly higher tolerance for path occupancy, allowing for dynamic obstacle negotiation without losing path alignment.
  453. # use_path_orientations: true # Enables consideration of path orientations, enhancing directional fidelity to the planned path, essential for complex off-road routes.
  454. # PathAngleCritic:
  455. # enabled: true
  456. # cost_weight: 3.6 # Enhances path angle alignment in complex off-road terrains, aiding in precise maneuvering and turns.
  457. # cost_power: 2 # Applies quadratic scaling to penalize significant deviations from the path's angle, promoting closer adherence.
  458. # threshold_to_consider: 1.0 # Allows for path angle adjustments from a greater distance, facilitating smoother approach and alignment.
  459. # offset_from_furthest: 10 # Ensures path angle considerations are applied sooner, enhancing the vehicle's ability to align with upcoming turns.
  460. # max_angle_to_furthest: 1.0 # Adopts a more lenient angle threshold for considering path alignment, accommodating the need for wider turns in off-road environments.
  461. # mode: 2 # Prioritizes following the path in the requested direction, essential for effective navigation in off-road settings with specific directional requirements.
  462. # PreferForwardCritic:
  463. # enabled: truel
  464. # cost_weight: 10.0 #6.0 # Enhances the preference for forward movement, crucial for a truck's navigation efficiency and safety in off-road environments.
  465. # cost_power: 2 # Implements quadratic cost scaling to more significantly penalize reversing, promoting a forward direction of travel.
  466. # threshold_to_consider: 1.0 # Ensures forward movement is prioritized until the truck is within a practical distance to the goal, suitable for the vehicle's larger turning requirements.
  467. # TwirlingCritic: #DISABLE IT AFTER REMOVING SPINNING FROM 'RECOVERY BEHAVIORS' since nonholomic robots do not SPIN!
  468. # enabled: true # Enabled to apply a penalty for twirling movements, with the aim of discouraging spinning.
  469. # cost_weight: 20.0 # High weight to significantly penalize spinning movements during path planning.
  470. # cost_power: 1 # Linear penalty to ensure consistent discouragement of unnecessary rotations.
  471.  
  472.  
  473.  
  474. smoother_server:
  475. ros__parameters:
  476. smoother_plugins: ["simple_smoother"]
  477. simple_smoother:
  478. plugin: "nav2_smoother::SimpleSmoother"
  479. tolerance: 1.0e-10
  480. max_its: 1000
  481. do_refinement: True
  482.  
  483. behavior_server:
  484. ros__parameters:
  485. local_costmap_topic: local_costmap/costmap_raw
  486. global_costmap_topic: global_costmap/costmap_raw
  487. local_footprint_topic: local_costmap/published_footprint
  488. global_footprint_topic: global_costmap/published_footprint
  489. cycle_frequency: 10.0
  490. behavior_plugins: ["backup", "drive_on_heading", "assisted_teleop", "wait"]
  491. #behavior_plugins: ["spin", "backup", "drive_on_heading", "assisted_teleop", "wait"]
  492. # spin:
  493. # plugin: "nav2_behaviors/Spin"
  494. backup:
  495. plugin: "nav2_behaviors/BackUp"
  496. drive_on_heading:
  497. plugin: "nav2_behaviors/DriveOnHeading"
  498. wait:
  499. plugin: "nav2_behaviors/Wait"
  500. assisted_teleop:
  501. plugin: "nav2_behaviors/AssistedTeleop"
  502. local_frame: odom
  503. global_frame: map
  504. robot_base_frame: base_link
  505. transform_tolerance: 0.1
  506. simulate_ahead_time: 2.0
  507. max_rotational_vel: 10.0 #1.0
  508. min_rotational_vel: 0.4
  509. rotational_acc_lim: 10.0 #3.2
  510.  
  511. waypoint_follower:
  512. ros__parameters:
  513. loop_rate: 20
  514. stop_on_failure: false
  515. waypoint_task_executor_plugin: "wait_at_waypoint"
  516. wait_at_waypoint:
  517. plugin: "nav2_waypoint_follower::WaitAtWaypoint"
  518. enabled: True
  519. waypoint_pause_duration: 200
  520.  
  521. velocity_smoother:
  522. ros__parameters:
  523. smoothing_frequency: 20.0 # This is the frequency at which the smoother operates. 20 Hz is a reasonable starting point.
  524. scale_velocities: False # Keeps scaling behavior off, which can be useful for debugging.
  525. feedback: "OPEN_LOOP" # Uses the open-loop smoothing method. This is suitable if closed-loop feedback isn't necessary.
  526. max_velocity: [8.33, 0.0, 0.72] # Max linear velocity set to ~8.33 m/s (~30 km/h), and angular velocity to ~0.72 rad/s.
  527. min_velocity: [-8.33, 0.0, -0.72] # Min linear velocity for reverse movement at the same max speed, and angular velocity for reverse turning.
  528. max_accel: [3.0, 0.0, 1.0] # Increases max linear and angular accelerations to 5.0 m/s² and 5.0 rad/s², respectively.
  529. max_decel: [-3.0, 0.0, -1.0] # Increases max linear and angular decelerations to -5.0 m/s² and -5.0 rad/s².
  530. odom_topic: "odom" # Confirms the odometry topic for velocity feedback, if used.
  531. odom_duration: 0.1 # Sets the duration to consider for odometry feedback.
  532. deadband_velocity: [0.0, 0.0, 0.0] # Sets the deadband for velocity to zero, ensuring no minimum threshold.
  533. velocity_timeout: 1.0 # Sets the timeout for velocity commands to 1 second.
  534.  
  535.  
Advertisement
Add Comment
Please, Sign In to add comment