Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compilation of exploration_planner and path_follower #6

Open
wants to merge 1 commit into
base: catkin
Choose a base branch
from

Conversation

spmaniato
Copy link

Addresses the issue mentioned in #5 and also a clang compiler warning that indeed looks like a bug (hector_path_follower.cpp L320)

Compilation after applying this patch has been tested under ROS Indigo on both Ubuntu 14.04.x and OS X El Capitan. I also ran the exploration functionality on Ubuntu. Looks good.

@@ -317,15 +317,15 @@ namespace pose_follower {
transformed_plan.clear();

try{
if (!global_plan.size() > 0)
if (!(global_plan.size() > 0))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was definitely a bug, even if in this special case the implicit conversion from the boolean expression !global_plan.size() to an integer (which is 0 or 1) leads to the same result when compared against 0 as the intended expression.

Even better:

if (global_plan.empty())
{
  // ...
}

@meyerj
Copy link
Member

meyerj commented Apr 18, 2016

Thank you very much! This patch looks good to me.
@skohlbr?

@spmaniato
Copy link
Author

Just a heads-up that I've updated the PR based on Johannes' feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants