-
Notifications
You must be signed in to change notification settings - Fork 672
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
PyMJCF Attachment frame extra body breaks compilation of freejoint object attachments #407
Comments
|
Thanks for the quick response. Is your long-term solution development watchable on GitHub? |
I can expand on @yuvaltassa's answer. This isn't really a limitation of The API was designed under the assumption that the caller adds DoF as required, and that objects should not define its own relationship with the world (in this case, it shouldn't be bringing in its own free joint). The idea being that it allows the user to decide whether the prop should be a free object, a hinged object, a fixed object, or whatever. |
No, unfortunately. |
I've been trying to implement this. My current solution is to edit the So far I found some conversion functions such as |
Update |
Description:
Attaching one PyMJCF model (the "source") to another (the "destination") adds the content of the source's worldbody into a newly generated body element in the destination worldbody. So if we want to add a robot whose model name is "robot1" to some scene, then all the contents of its worldbody will be inside a body named "robot1/" and all its children's names will be "robot1/{original_name}". The issue is that if "robot1" has a freejoint in its root body (the one direct child of worldbody), the resulting merged model cannot be loaded with MuJoCo because the freejoint element is now inside the base element which is inside the newly generated body "robot1/".
Error Message:
Error: free joint can only be used on top level
Reproduce:
A simple example to recreate the error message using the MuJoCo menagerie. This works with any free-moving robot (has a freejoint in the base). In the "scene.xml" file, we comment the
<include/>
line to avoid loading the robot this way, and only attach it with MJCFSuggested Solution:
My preferred solution would be to add an argument in the
attach
method that will exclude the outer "wrapper" body. We can still avoid name ambiguity by renaming the source model's components as before ("robot1/base", "robot1/wrist", etc).The text was updated successfully, but these errors were encountered: