ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A answers.ros.org
Ask Your Question
0

How to enable debug logging for the DWALocalPlanner and the SimpleScoredSamplingPlanner

asked 2022-03-08 05:54:28 -0600

petrik gravatar image

I'm testing simple navigation for my robot using Gazebo and RViz. Each time I set a 2D nav goal in RViz I get a log indicating that the local planner failed to find a path. This continues for a bit until it enters the rotate recovery behaviour and then immediately it finds a plan that works. Now I'm trying to find out why it doesn't work before the rotation but does after the rotation.

However the log doesn't tell me very much, so I'm wanting to increase the logging verbosity for the planner only. I've created a config file at /home/me/ros_ws/rosconsole.config to change the logging verbosity, with the following contents

log4j.logger.ros=INFO
log4j.logger.ros.dwa_local_planner=DEBUG

However that doesn't seem to do the trick.

My question is how can I figure out what the correct packages and type names are for the DWALocalPlanner(this one: https://github.com/ros-planning/navig...), the SimpleScoredSamplingPlanner (this one: https://github.com/ros-planning/navig...) and the different cost functions so that I can see what they are actually doing. The documentation just says that you need the correct names but not how to figure out from the source code what those names are. And the documentation for the DWA local planner doesn't mention log levels / package names etc. either.

And yes I'm aware of the rqt_gui but that doesn't show me the names for the specific types either.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2022-03-10 06:08:31 -0600

Silvis gravatar image

If you want to edit specific nodes logging verbosity level you also have to tell the node to use your rosconsole.config file if its not found in default path

rosconsole will load a config file from $ROS_ROOT/config/rosconsole.config when it initializes.

This can be done by pointing the env variable named ROSCONSOLE_CONFIG_FILE to your config path. For example:

<launch>

  ...
  <env name="ROSCONSOLE_CONFIG_FILE" value="$(find my_config_pkg)/rosconsole.conf"/>

  <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
      <rosparam file="$(find my_robot_name_2dnav)/costmap_common_params.yaml" command="load" ns="global_costmap" /> 
   </node>

  ...

</launch>

Read more at: http://wiki.ros.org/rosconsole

edit flag offensive delete link more

Comments

The documentation for rosconsole also states

rosconsole will load a config file from $ROS_ROOT/config/rosconsole.config when it initializes.

rosconsole also lets you define your own configuration file that will be used by log4cxx, defined by the 
ROSCONSOLE_CONFIG_FILE environment variable. Anything defined in this config file will override the
default config file.

And I have set the ROSCONSOLE_CONFIG_FILE environment variable to point to the file in the original post. My bad, I should have mentioned that.

Also I have tried the rqt gui with the logger settings but I can't find the settings for the DWALocalPlanner (not the DWAPlannerRos code).

petrik gravatar image petrik  ( 2022-03-10 21:53:58 -0600 )edit

Ok I think I figured it out. I was thinking that the missing log messages from the DWALocalPlanner were due to me not setting the log level correctly, however it looks like the problem (in my case) is that the planner doesn't generate any plans until a recovery rotate happens. After that it finds a viable path and uses it. So the missing log messages weren't actually missing, the code that generates the log messages was never hit.

petrik gravatar image petrik  ( 2022-03-17 02:11:00 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2022-03-08 05:54:28 -0600

Seen: 57 times

Last updated: Mar 08