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

proximity: Don't warn when parsing meshes with mtl files #14974

Merged
merged 1 commit into from
May 3, 2021

Conversation

jwnimmer-tri
Copy link
Collaborator

@jwnimmer-tri jwnimmer-tri commented Apr 29, 2021

When reusing a visual mesh for collision purposes, we would get warning logspam while skipping the mtl files. This was a regression as of #14656.

See also slack discussion.


This change is Reviewable

@jwnimmer-tri jwnimmer-tri marked this pull request as ready for review April 29, 2021 19:40
@jwnimmer-tri
Copy link
Collaborator Author

+@DamrongGuoy for feature review, please.

Copy link
Contributor

@DamrongGuoy DamrongGuoy left a comment

Choose a reason for hiding this comment

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

:lgtm: with minor questions.

Reviewed 3 of 4 files at r1, 1 of 1 files at r2.
Reviewable status: 3 unresolved discussions, needs platform reviewer assigned, needs at least two assigned reviewers (waiting on @jwnimmer-tri)


geometry/proximity/obj_to_surface_mesh.h, line 3 at r2 (raw file):

#pragma once

#include <istream>

Should we add #include <functional> for std::function?


geometry/proximity/obj_to_surface_mesh.h, line 33 at r2 (raw file):

    const std::string& filename,
    double scale = 1.0,
    std::function<void(std::string_view)> on_warning = {});

Clang format gave this to me:

SurfaceMesh<double> ReadObjToSurfaceMesh(
    const std::string& filename, double scale = 1.0,
    std::function<void(std::string_view)> on_warning = {});

I'm fine either way. I like one parameter per line, as in the original code, too.


geometry/proximity/obj_to_surface_mesh.cc, line 140 at r2 (raw file):

    } else {
      drake::log()->warn(warn);
    }

Just a note that my kcov test did not cover this block of code. However, I won't take it as a defect because it's about handling warning. In fact, I saw that the change in the unit test checked that there is no warning, which is the main purpose of this PR.

image.png

I followed this link to use kcov in drake.

@DamrongGuoy
Copy link
Contributor

The links to two CI jobs were broken (HTTP ERROR 404 Not Found), so I suppose it's infrastructure flake and will rerun them now.
image.png

@drake-jenkins-bot linux-bionic-clang-bazel-experimental-leak-sanitizer please
@drake-jenkins-bot linux-bionic-gcc-bazel-experimental-debug please

Copy link
Collaborator Author

@jwnimmer-tri jwnimmer-tri left a comment

Choose a reason for hiding this comment

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

Reviewable status: 1 unresolved discussion, needs platform reviewer assigned, needs at least two assigned reviewers (waiting on @DamrongGuoy)


geometry/proximity/obj_to_surface_mesh.h, line 3 at r2 (raw file):

Previously, DamrongGuoy (Damrong Guoy) wrote…

Should we add #include <functional> for std::function?

Done.


geometry/proximity/obj_to_surface_mesh.h, line 33 at r2 (raw file):

Previously, DamrongGuoy (Damrong Guoy) wrote…

Clang format gave this to me:

SurfaceMesh<double> ReadObjToSurfaceMesh(
    const std::string& filename, double scale = 1.0,
    std::function<void(std::string_view)> on_warning = {});

I'm fine either way. I like one parameter per line, as in the original code, too.

(... and that's why I don't use clang-format.)


geometry/proximity/obj_to_surface_mesh.cc, line 140 at r2 (raw file):

Previously, DamrongGuoy (Damrong Guoy) wrote…

Just a note that my kcov test did not cover this block of code. However, I won't take it as a defect because it's about handling warning. In fact, I saw that the change in the unit test checked that there is no warning, which is the main purpose of this PR.

image.png

I followed this link to use kcov in drake.

An interesting conundrum! Fixing the mtl bug causes the warning code to be unused. I've added more test cases now.

Copy link
Contributor

@DamrongGuoy DamrongGuoy left a comment

Choose a reason for hiding this comment

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

Reviewed 4 of 4 files at r3.
Reviewable status: needs platform reviewer assigned, needs at least two assigned reviewers (waiting on @jwnimmer-tri)

@jamiesnape
Copy link
Contributor

An interesting conundrum! Fixing the mtl bug causes the warning code to be unused. I've added more test cases now.

Fred Brooks once said to me (slightly tongue in cheek) that fixing bugs was a bad idea, you just replace one bug with potentially another (or worse, more than one bug).

@jwnimmer-tri
Copy link
Collaborator Author

+@SeanCurtis-TRI for platform review per schedule on Monday, please.

@jwnimmer-tri jwnimmer-tri added component: geometry proximity Contact, distance, signed distance queries and related properties unused team: manipulation type: bug labels May 3, 2021
Copy link
Contributor

@SeanCurtis-TRI SeanCurtis-TRI left a comment

Choose a reason for hiding this comment

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

:LGTM:

Reviewed 3 of 4 files at r3.
Reviewable status: :shipit: complete! all discussions resolved, LGTM from assignees SeanCurtis-TRI(platform),DamrongGuoy (waiting on @jwnimmer-tri)

@SeanCurtis-TRI SeanCurtis-TRI merged commit cc31cf3 into RobotLocomotion:master May 3, 2021
@jwnimmer-tri jwnimmer-tri deleted the mtl-base-dir branch May 6, 2021 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: geometry proximity Contact, distance, signed distance queries and related properties priority: medium type: bug unused team: manipulation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants