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

Keep/Delete OpenCV dependency #11

Open
Arpafaucon opened this issue Mar 3, 2019 · 1 comment
Open

Keep/Delete OpenCV dependency #11

Arpafaucon opened this issue Mar 3, 2019 · 1 comment

Comments

@Arpafaucon
Copy link
Contributor

Arpafaucon commented Mar 3, 2019

Description

I was doing a full installation test to list dependencies for my project.
It seems that the full OPENCV library is required. However the library usage seem quite small.

find_package(OpenCV REQUIRED)

Current usage

It seems to be used for scaling some measures, but given the TODO message, I'm not sure something is happening.

if (_sdf->HasElement("covarianceImage")) {
    std::string image_name =
      _sdf->GetElement("covarianceImage")->Get<std::string>();
    covariance_image_ = cv::imread(image_name, CV_LOAD_IMAGE_GRAYSCALE);
    if (covariance_image_.data == NULL)
      gzerr << "loading covariance image " << image_name << " failed"
            << std::endl;
    else
      gzlog << "loading covariance image " << image_name << " successful"
            << std::endl;
  }
// ...
// This gets called by the world update start event.
void
GazeboOdometryPlugin::OnUpdate(const common::UpdateInfo& _info)
{
// ...
int x =
      static_cast<int>(std::floor(gazebo_pos_x / covariance_image_scale_)) +
      width / 2;
    int y =
      static_cast<int>(std::floor(gazebo_pos_y / covariance_image_scale_)) +
      height / 2;

    if (x >= 0 && x < width && y >= 0 && y < height) {
      uint8_t pixel_value = covariance_image_.at<uint8_t>(y, x);
      if (pixel_value == 0) {
        publish_odometry = false;
        // TODO: covariance scaling, according to the intensity values could be
        // implemented here.
      }
  }
// ...
}

Propositions

At least, this issue will remind you of this waiting TODO. 😄

  • If this is feature you actually use, would it be possible to define what opencv modules are required ?
  • If this is a left-over, would you consider removing the dependency to openCV2 ? This will become increasingly difficult to satisfy.
@wuwushrek
Copy link
Owner

hahaha yes OpenCV is no need here ! I had it because of some rotorS dependencies that I removed.
I'm going to remove it in the next commit/push., after solving some of the other issue you pointed.

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

No branches or pull requests

2 participants