ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

ros2 navigation planner with boats

asked 2022-12-18 03:31:02 -0500

nvrace gravatar image

updated 2022-12-19 10:02:42 -0500

Hi guys, I am developing a navigation system for unmanned ships on ros2 Galactic but I am stuck on nav2. When I tried various planners and controllers, I found that it is very difficult for me to keep a ship without side thrusters on the path, because the lateral drift of the ship cannot be eliminated. And the global planner always plans a new path with the ship's drift. I have seen in nav1 in ros1 that the global planner keeps the first planned route instead of nav2 in ros2 constantly planning a new path. Is it possible to do this but still has obstacle avoidance in ros2 with nav2?

Global Planner :SMAC Hybrid , Local planner:Teb_local_planner

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2022-12-19 06:39:47 -0500

ChuiV gravatar image

First off, I'm still learning nav2, and I've never used it for a boat before. But..

I don't know which local planner you're using, But if you happen to be using DWB, you should be able to tune the PathAlign.scale and PathDist.scale parameters to allow it to turn into the path more. At least as far as I understand it.

To stop it from re-planning a global path, you can make a new behavior tree that would look something like

<root main_tree_to_execute="MainTree">
  <BehaviorTree ID="MainTree">
  <PipelineSequence name="NavigateWithReplanning">
    <RateController hz="0.00000001">
      <ComputePathToPose goal="{goal}" path="{path}" planner_id="GridBased"/>
    <FollowPath path="{path}"  controller_id="FollowPath"/>


The hack is here is to change the Rate controller to something real small, such that this would only replan once every 3.17 years. If you wanted to be more elegant with it, you could make a new "Decorator" plugin to replace the RateController with something to only run it once. (The SingleTrigger decorator may do this already... but I've never used it.) To use it, either change the bt_navigator default_nav_to_pose_bt_xml param to point to your new behavior tree, or set this path in your navigate to pose action goal request.

edit flag offensive delete link more


Hello, thanks for your tips. I am currently using SMAC Hybrid as the Global Planner and Teb_local_planner as the Local planner. I will try the DWB you mentioned. Unfortunately, the Rate controller in the behavior tree will also affect the update rate of the Local Planner, which I once tried

nvrace gravatar image nvrace  ( 2022-12-19 10:01:35 -0500 )edit

Question Tools


Asked: 2022-12-18 03:31:02 -0500

Seen: 145 times

Last updated: Dec 19 '22