Robotics StackExchange | Archived questions

configuring DWA navigation correctly

I am wrestling to get the DWA planner work (Noetic, Ros1)

Things that already work:

I am having configuration problems:

.1 The navigation does not obey the max velocities I define in: mycostmapcommonparams.yaml and the navigator generates twist messages with both x and y velocities although I have set holonomicrobot to false (differential robot cannot drive sidewise). What is the correct file and way to define these parameters so that DWA Planner gets it?

mybaselocalplannerparams.yaml:

TrajectoryPlannerROS:
  max_vel_x: 0.20
  min_vel_x: -0.20
  max_vel_y: 0.0
  min_vel_y: 0.0
  max_vel_theta: 0.4
  min_in_place_vel_theta: 0.4

  acc_lim_theta: 0.5
  acc_lim_x: 0.5
  acc_lim_y: 0.5

  holonomic_robot: false

mymovebase.launch:

    <launch>
       <master auto="start"/>
     <!-- Run the map server --> 
        <node name="map_server" pkg="map_server" type="map_server" args="$(find robot)/maps/mymap.pgm 0.1"/>

        <include file="$(find amcl)/examples/amcl_diff.launch" />    

       <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
         <rosparam file="$(find robot)/config/my_costmap_common_params.yaml" command="load" ns="global_costmap" /> 
         <rosparam file="$(find robot)/config/my_costmap_common_params.yaml" command="load" ns="local_costmap" />
         <rosparam file="$(find robot)/config/my_local_costmap_params.yaml" command="load" />
         <rosparam file="$(find robot)/config/my_global_costmap_params.yaml" command="load" /> 
         <rosparam file="$(find robot)/config/my_base_local_planner_params.yaml" command="load" />   

        <param name="base_local_planner" value="dwa_local_planner/DWAPlannerROS" />  
        <param name="controller_frequency" value="5.0" />
        <param name="controller_patience" value="15.0" />   
      </node>  
   <!-- from ROS call Rviz with config settings at the local file: -->
   <node name="rviz" pkg="rviz" type="rviz" args="-d $(find robot)/config/my_rviz.rviz" required="true" />
</launch>

.2: sometimes after a while in Rviz, RobotFootprint goes in error: "For frame [odom]: No transform to fixed frame[map]". Anything wrong or incomplete in my configuration? This error only happens sometimes. mycostmapcommon_params.yaml:

obstacle_range: 2.0
raytrace_range: 3.0
footprint: [[-0.3, -0.4], [-0.3, 0.36], [0.3, 0.36], [0.3, -0.4]]
#robot_radius: 0.35
inflation_radius: 0.2
observation_sources: laser_scan_sensor point_cloud_sensor
laser_scan_sensor: {sensor_frame: laser, data_type: LaserScan, topic: scan, marking: true, clearing: true}

Asked by RH56 on 2022-03-04 10:33:50 UTC

Comments

In my_base_local_planner_params.yaml try changing the first line to DWAPlannerROS instead of TrajectoryPlannerROS.

Asked by tryan on 2022-03-04 20:06:50 UTC

Thanks, Tryan. No, the footprint error still occurs now and then. But there is a difference: When I put my max higher than 0.1, it gives 0.1m/s velocities in x, but when I put my max lower than 0.1, Rviz won't make a path. So it looks like the planner is now influenced by my_base_local_planner_params.yaml, which was not the case before. Other strange thing is that I receive alternately zero velocities and 0.1m/s velocities, so that the robot shocks forward. Could there be any timing problem I need to reconfigure somewhere?

Asked by RH56 on 2022-03-05 09:46:53 UTC

You now have your local planner parameters in the right namespace (DWAPlannerROS), where move_base can find them. The alternating velocities can happen if there are more than one publisher on the /cmd_vel topic. One way to check is rotopic info /cmd_vel.

Asked by tryan on 2022-03-05 12:27:06 UTC

I had already left out my joystick launch to avoid such conflict, but here is the result: rostopic info /cmd_vel reacts with only: publishers * /move_base, which is OK (I guess), as the navigation stack is supposed to publish. When I do: rostopic echo /cmd_vel, nothing happens until I make a path in Rviz. Then zero-speed messages alternated with 0.1m/s-speed messages pass by. After a while, Robot Footprint goes in error and then it stops.

Asked by RH56 on 2022-03-07 14:32:49 UTC

Yes, move_base should be the only node publishing to /cmd_vel. The alternating speeds may be a result of tuning, but it seems odd. What is the environment like?

The transform error between odom and map is likely a problem with localization. Just to confirm, AMCL is the only localization/SLAM software you have running, right? If so, does it fail just before navigation does, or does your robot continue to localize effectively after throwing that error?

Asked by tryan on 2022-03-07 15:05:56 UTC

Hi, Tryan. I think I just discovered the core of the problem. When I do a rostopic echo /scan, I see my rplidar producing correct data for a few minutes and then it suddenly stops. That very moment also the mentioned footprint error comes up in Rviz. When I run my rplidar alone (without the navigation stack) the same happens, the message stream just stops after a while. So it looks there is some weird sync problem between my Rplidar_A3 and ROS. Furthermore, when I run with Rviz and I look at "LaserScan", sometimes in a very short flash an error comes up: "Transform, sender unknown". I am going to redefine my problem in a new question, because it looks like my navigation stack is configured correctly and that the problem lies somewhere in the lidar-Ros communication.

Asked by RH56 on 2022-03-09 04:18:28 UTC

That does sound like the source of the map->odom transform issue, and making it a separate question seems appropriate. I'm glad you're getting things figured out! To close this question, you can summarize your findings in an answer, or I can do it if you prefer.

Asked by tryan on 2022-03-10 09:40:01 UTC

Hi, Tryan, after having solved some problems on the laser, there is one main issue remaining which I described in https://answers.ros.org/question/397671/laser-pattern-turning-along-with-robot-in-rviz/ Once this problem is solved, I expect the robot to navigate correctly.

Asked by RH56 on 2022-03-17 06:53:10 UTC

Answers