Robotics StackExchange | Archived questions

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

Hello I'm trying to make the old frontierexploration 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 movebase 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() )
                ROS_INFO("FOUND_GOAL");
}   

Thanks in advance for your answers.

Asked by luka-s on 2015-03-19 09:18:10 UTC

Comments

Answers

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 - http://wiki.ros.org/costmap_2d/hydro/obstacles.

Asked by Sidd on 2015-09-24 18:19:01 UTC

Comments