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 anymal robot preview in MeshCat (Tree.js) #134

Closed
wants to merge 1 commit into from

Conversation

jcarpent
Copy link
Member

@jcarpent jcarpent commented Aug 7, 2022

No description provided.

@cmastalli
Copy link
Collaborator

cmastalli commented Aug 8, 2022

I checked that this works in Meshcat; however, I am unable to do so in GV and RVIZ (PC with apple chip).
Have you checked how the robot displays in GV and RVIZ?
If so, can you share pictures?

It seems the mesh was not compatible with Tree.js.
MeshLab has been used to fix the issue.
@nim65s
Copy link
Member

nim65s commented Aug 30, 2022

in gepetto-viewer, before:
before
after:
after

@nim65s
Copy link
Member

nim65s commented Aug 30, 2022

I rebased to avoid the conflict

@jcarpent
Copy link
Member Author

So it works @nim65s ?

@cmastalli
Copy link
Collaborator

in gepetto-viewer, before:
before
after:
after

It has lower quality, could be possible to add back the missed colours?

@nim65s
Copy link
Member

nim65s commented Aug 30, 2022

what ? the real robot really has those violet stuff ? It looks like an artifact that @jcarpent version is fixing for me. Here is another "before" view:
front

@cmastalli
Copy link
Collaborator

cmastalli commented Aug 30, 2022

what ? the real robot really has those violet stuff ? It looks like an artifact that @jcarpent version is fixing for me. Here is another "before" view:
front

Sorry I am not sure what you meant. Instead I meant, the colours in the motors and fan are gray. Furthermore, there are plates or covers that are blue.

However, answering your questions. Yes, the ANYmal robot looks pretty much that the original picture. These texture were added by ANYbotics.

@jcarpent
Copy link
Member Author

jcarpent commented Sep 1, 2022

Honestly, I don't know how to recover from this issue.
The main purpose on my side is to have robots which can be displayed in the viewers associated to Pinocchio.

The current anymal robot cannot be displayed in Meshcat. The fix that we suggest here fixes this issue, yet with some minor degradation.
As gepetto-viewer is no more deeply maintained, I would suggest using MeshCat as the main interface, as it is also multiplatform, unlike GV.

Could we then merge this PR and open a pending issue concerning the fix for retrieving the blue colors?

@cmastalli
Copy link
Collaborator

Honestly, I don't know how to recover from this issue. The main purpose on my side is to have robots which can be displayed in the viewers associated to Pinocchio.

The current anymal robot cannot be displayed in Meshcat. The fix that we suggest here fixes this issue, yet with some minor degradation. As gepetto-viewer is no more deeply maintained, I would suggest using MeshCat as the main interface, as it is also multiplatform, unlike GV.

Could we then merge this PR and open a pending issue concerning the fix for retrieving the blue colors?

We use this model in Rviz as well, and for many of us, we wish to still have good quality videos, e.g.,
https://youtu.be/mlrTdiOA1hM

Generally, I don't believe it is a good development strategy to degrade others, for the sake of having extra features. Additionally, it is not clear (at least for me) why we need to do this here, instead of solving the issue in Tree.js. Clarity of this aspect might help us to evaluate the proposition of a PR.

Avoiding long-to-release solutions (that could be the case in extending Tree.js) is always desirable. If you tell me that this this is case, then I suggest an alternative solution that doesn't compromise people interested in using other visualisation tools. The alternative solution is to have two DAE files while keeping the current one as default. Then, third party software (e.g., Pinocchio) can develop internally (in Pinocchio) a logic that choose the desired DAE.

All these are patches over patches, but it could be faster to release.

I understand your frustration in having this merge, however, I am trying to play the role of devil's advocate :)

@jcarpent
Copy link
Member Author

jcarpent commented Sep 1, 2022

Additionally, it is not clear (at least for me) why we need to do this here, instead of solving the issue in Tree.js

Do you know how to do that? Are you willing to do that?

@cmastalli
Copy link
Collaborator

Additionally, it is not clear (at least for me) why we need to do this here, instead of solving the issue in Tree.js

Do you know how to do that? Are you willing to do that?

No, I don't.

@nim65s
Copy link
Member

nim65s commented Sep 1, 2022

If none of us has the time to get a version of this mesh that works well enough everwhere, we can duplicate it, and let the user choose.

But I'll try to get a more clear look at this Tomorrow, and open issues on Tree.js and/or the original anymal repo if needed.

@wxmerkt
Copy link
Contributor

wxmerkt commented Sep 2, 2022

Can we use obj for MeshCat?

@jcarpent
Copy link
Member Author

jcarpent commented Sep 2, 2022

yes

@wxmerkt
Copy link
Contributor

wxmerkt commented Dec 8, 2022

I am looking into a fix for this. I have a workaround that detects and "fixes" broken DAEs on the fly rather than omitting them from Meshcat/THREE.js. It requires some more testing before upstreaming

@wxmerkt
Copy link
Contributor

wxmerkt commented Dec 14, 2022

I've got a workaround that allows loading the current mesh in the repository in Meshcat, see upstream PR: meshcat-dev/meshcat#139

Using this, we get the following:

image

Let's see if the upstream PR gets merged.

And with some extra changes to meshcat-python that I am working on we could get texture support:

image

Alternatively, I have a new mesh that bakes in the colours and displays correctly but it's significantly larger so I won't commit it.

@cmastalli
Copy link
Collaborator

I'll close this PR. Feel free to re-open if required, @jcarpent!

@cmastalli cmastalli closed this Oct 23, 2024
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.

4 participants