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

How can I change the navfn::NavfnROS param unknown_allowed to false

asked 2015-03-19 09:18:10 -0500

luka-s gravatar image

Hello I'm trying to make the old frontier_exploration stack to work on a Turtlebot running indigo. The code uses a navfn::NavfnROS as a planner in order to check if a potential goal can be reached. This leads to the planner finding paths through small holes of unknown space between obstacles and claiming that the goal is reachable. This drives the move_base planner that actualy navigates to the goal, to recovery_spin like crazy, because it is usually trying to reach an unreachable goal. I figure that if I disallow unknown space to be used by the planner my problems would be solved. Given that the NavfnROS doesn't seem to have its own roslaunch file where i could just add a , how could this be done. Did i miss a way to add a to a launch file or is there another way around the problem (maybe a better way to check if the turtlebot can reach a goal?)

//initialization of NavfnROS planner
explore_costmap_ros = new costmap_2d::Costmap2DROS( std::string( "explore_costmap" ), tf_);
planner = new navfn::NavfnROS( std::string( "explore_planner" ), explore_costmap_ros );

//checking if goals are reachable
tf::Stamped<tf::Pose> robot_pose;
explore_costmap_ros->getRobotPose( robot_pose );
geometry_msgs::PoseStamped robot_pose_msg;
tf::poseStampedTFToMsg( robot_pose, robot_pose_msg );

std::vector<geometry_msgs::PoseStamped> plan;       
planner->computePotential( robot_pose_msg.pose.position );

for( int i = 0; i < goal_list.size(); i++ )
    if( planner->getPlanFromPotential( goal_pose, plan )    && !plan.empty() )

Thanks in advance for your answers.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-09-24 18:19:01 -0500

updated 2015-09-24 18:20:19 -0500

There is a parameter you set as a part of the obstacle layer defined in the cost map parameter files -

~<name>/track_unknown_space (bool, default: false)

    Specifies whether or not to track what space in the costmap is unknown, meaning that no observation about a cell has been seen from any sensor source.

Setting this to true, will make your robot move to\in unknown spaces. This is not exactly the safest thing to do (If the map doesn't update fast enough and the robot crashes into an obstacle that is in the unknown space) which is why the default value is false.

You can find it here - .

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2015-03-19 09:18:10 -0500

Seen: 499 times

Last updated: Sep 24 '15