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

kit_tray tape interfere with Aruco detection? #352

Closed
AravindaDP opened this issue May 24, 2024 · 6 comments · Fixed by #353
Closed

kit_tray tape interfere with Aruco detection? #352

AravindaDP opened this issue May 24, 2024 · 6 comments · Fixed by #353

Comments

@AravindaDP
Copy link

AravindaDP commented May 24, 2024

Apologies for reporting this late. I thought I had reported this earlier but just now realized I have missed it.

We are using cv2.aruco.ArucoDetector with default cv2.aruco.DetectorParameters and noticed that sometimes cv2.aruco.ArucoDetector.detectMarkers(cv_image) fails to detect tray markers (cv_image is constructed using CvBridge.imgmsg_to_cv2(img_msg, desired_encoding="mono8"))

When we made the tape material less darker by setting ambient and diffuse values as below at https://github.com/usnistgov/ARIAC/blob/ariac2024/ariac_gazebo/models/kit_tray/model.sdf#L39 it started working consistently. (perhaps it could be little bit more darker but we are happy with these values)

      <visual name="tape">
        <geometry>
          <mesh>
            <uri>model://kit_tray/meshes/tape.stl</uri>
          </mesh>
        </geometry>
        <material>
          <ambient>0.4 0.4 0.4 1.0</ambient>
          <diffuse>0.4 0.4 0.4 1.0</diffuse>
        </material>
      </visual>

I'm not sure it's too late to ask such a change. But appreciate if it could be considered. (Alternatively we would welcome if it can be solved by applying non-default parameters in cv2.aruco detecters as well as a last resort.)

Approx additional troubleshooting time occurred due to the issue during competition : ~0.5 days

@dan9thsense
Copy link

Can you explain the change that was made? Our tray detection has been working OK and if you change the sdf now, we have to restart a lot of testing with very little time before finals deadline. What happens if this change makes our model no longer reliably work?

@jaybrecht
Copy link
Collaborator

The color of the tape was change to be gray instead of black. If this causes an issue with your system please let me know and we will figure out a solution.

kit tray with gray tape

@dan9thsense
Copy link

dan9thsense commented May 28, 2024 via email

@jaybrecht
Copy link
Collaborator

No, I just merged that PR this morning. The branch 2024.5.0-staging currently has all new changes that will be included in the 5.0 release.

@saahu27
Copy link
Collaborator

saahu27 commented May 29, 2024

The detection using cv2.aruco.ArucoDetector can sometimes fail if you pass in the entire image of the kittray. You can alternatives mask the image with hardcoded pixel coordinates to crop out only the aruco tag and pass that image to opencv aruco detector. This is a better option to detect the Aruco tags.

@AravindaDP
Copy link
Author

Yes, Currently we are testing that approach using the assumption that kit trays are at predesignated coordinates for this year competition. We also noticed that while original color values for kit tray tape material infact wasn't pure black (but still dark enough to confuse ArucoDetector) so color threshold based filtering also should be possible.

So since now deadline is pushed back if other teams have objections to changing kit tray tape color we would be able to adopt one of above alternatives.

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 a pull request may close this issue.

4 participants