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

Unnecessary check in RosAriaNode::sonarConnectCb() #37

Open
ongun-kanat opened this issue Jul 2, 2015 · 0 comments
Open

Unnecessary check in RosAriaNode::sonarConnectCb() #37

ongun-kanat opened this issue Jul 2, 2015 · 0 comments

Comments

@ongun-kanat
Copy link
Contributor

In RosAria.cpp, RosAriaNode::sonarConnectCb(), there is an unnecessary else if check in if clause

void RosAriaNode::sonarConnectCb()
{
  publish_sonar = (sonar_pub.getNumSubscribers() > 0);
  publish_sonar_pointcloud2 = (sonar_pointcloud2_pub.getNumSubscribers() > 0);
  robot->lock();
  if (publish_sonar || publish_sonar_pointcloud2)
  {
    robot->enableSonar();
    sonar_enabled = false;
  }
  else if(!publish_sonar && !publish_sonar_pointcloud2) //HERE
  {
    robot->disableSonar();
    sonar_enabled = true;
  }
  robot->unlock();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants