[Ask] How to use mjSpec functions (How to attach and detach a xml model in simulation ?) #2228
Replies: 2 comments 13 replies
-
Hi the functions that you need are The function See an example of how to use Remember to not load the model directly as in your example above, instead do:
|
Beta Was this translation helpful? Give feedback.
-
@quagla I just uploaded python test code (I'll believe that python version is ok then c++ version will be ok, too.) Test conditions
My test code is attached below Problem: Please check my attached code and I'm thank you if you will provide me a solution for this problem. |
Beta Was this translation helpful? Give feedback.
-
Intro
Hi!
I want to attach or detach a xml (ex. Gripper tool) in run-time.
I've tried to apply mjSpec functions, but I can't understand about mjSpec functions and failed.
I tried to refer "user_api_test.cc file: ex. TEST_F(MujocoTest, RecompileAttach) {
However, although MuJoCo is very nice library, but sometime I've suffered a lot because I don't know how to use it and the Document is not kind to me.
Anyway, I'm really appreciated it if someone teach me how to attach or detach a gripper xml model in run time.
Thanks.
My setup
MuJoCo, C, Windows
Using simulate.cc source code.
My question
I want to know how to attach or detach a xml model in run time.
In addition, Maybe due to thread synchronize problem (using simulate source code), sometimes segfault, somtimes (for test) sphere is attached. However, it is not rigidly attached. When I run the simulation, the attached sphere is flied away. (?? why it is not attached rigidly ??) How to attach it rigidly ?? mjSpec functions are very difficult to me :) please someone save me.
When I tested below code : the result is segmentation fault as follows.
PhysicsLoop : specGripper: 0x7f3230e77ff0
xmlSpec: 0x7f3230005ad0
bodyFlange: 0x7f323006e8c8
attachmentFrame: 0x7f3230e868b0
Segmentation fault
Minimal model and/or code that explain my question
If you encountered the issue in a complex model, please simplify it as much as possible (while still reproducing the issue).
Model:
minimal XML
Code:
Confirmations
Beta Was this translation helpful? Give feedback.
All reactions