0
$\begingroup$

Rosanswers logo

When running the navigation with dwa_local_planner, and give the first goal as an in place rotation, the robot won't move (except for recovery behaviors), and gives the below output. But, if you give a translation goal first, it moves normally, and from then on, it can rotate in place without a problem.

[ERROR] [...]: Footprint spec is empty, maybe missing call to setFootprint?
[ WARN] [...]: Invalid Trajectory 0.000000, 0.000000, -0.401014, cost: -9.000000
[ WARN] [...]: Rotation cmd in collision
[ INFO] [...]: Error when rotating.

I think the error actually comes from line 80 in obstacle_cost_function.cpp at base_local_planner, something about the footprint is not properly initialized:

double ObstacleCostFunction::scoreTrajectory(Trajectory &traj) {
...
if (footprint_spec_.size() == 0) {
  // Bug, should never happen
  ROS_ERROR("Footprint spec is empty, maybe missing call to setFootprint?");
  return -9;
}
...

All this is easy to reproduce running, for example, turtlebot simulator and navigation amcl demo:

$ roslaunch turtlebot_gazebo turtlebot_world.launch
$ roslaunch turtlebot_gazebo amcl_demo.launch
$ roslaunch turtlebot_rviz_launchers view_navigation.launch

EDIT: The local costmap config used in the example above is the one from turtlebot packages, which can be found here: local_costmap_params.yaml

EDIT2: I use ROS Indigo on Ubuntu 14.04.2, but i've also tried with Hydro on 12.04. And yes, I have all installed via apt-get


Originally posted by fherrero on ROS Answers with karma: 738 on 2015-03-11

Post score: 3


Original comments

Comment by paulbovbel on 2015-03-12:
Can you add your local costmap config please

Comment by paulbovbel on 2015-03-12:
Please add information about which version of ROS. You installed navigation through apt-get?

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

To me, it looks like a bug. The footprint of the robot is set on the ObstacleCostFunction whenever DWAPlanner::findBestPath is called (line 298 in https://github.com/ros-planning/navigation/blob/indigo-devel/dwa_local_planner/src/dwa_planner.cpp). This call will not be made when the robot is already at the goal location when the goal is given. The LatchedStopRotateController then calls DWAPlanner::checkTrajectory to check for a valid rotation command and this checks the ObstacleCostFunction which needs the footprint, but it wasn't set before. To fix this issue, the footprint has to be set before the call to DWAPlanner::checkTrajectory is made.

I do have the same problem right now, which is why I looked into the sources to find the issue. But other than that, I have no idea about this package or why the footprint isn't set earlier (the cost map, which should know the footprint, is known in the constructor of DWAPlanner and even given to the ObstacleCostFunction upon construction, but the footprint is not extracted). I guess we should create a bugreport...

Edit: finally I did just that: https://github.com/ros-planning/navigation/issues/327


Originally posted by Peter P. with karma: 56 on 2015-03-26

This answer was ACCEPTED on the original site

Post score: 4


Original comments

Comment by Swan Baigne on 2015-05-18:
Can you detail what you did to make it work ? i have the same problem as you, and i don't know where and what changes i should make.

Comment by Peter P. on 2015-05-18:
Actually, I did not make it work, sorry that it sounded like that. I just figured out why this error occurs and created a ticket, hoping that it would be resolved by the project authors/maintainers.

Comment by Swan Baigne on 2015-05-18:
i feared so. The link you gave is quite detailed, except i have not found the dwa_planner.cpp anywhere in my computer, so i have no may to make the mentioned modifications Looks like we will have to wait for maintener's answers

Comment by Peter P. on 2015-05-18:
You can find the file at https://github.com/ros-planning/navigation/blob/indigo-devel/dwa_local_planner/src/dwa_planner.cpp. In order to change it, you have to clone the GIT repository into your workspace and build it yourself (and make sure that ROS uses that one over the installed package).

Comment by mitch on 2016-05-06:
I noticed that my path never includes an initial in-place rotation. I think that it would frequently make sense for the robot to rotate before starting its translational move. Could the problem you're asking about cause the absence of an initial in-place rotation? Or is this just my parameters?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.