Open mgiglia92 opened 2 years ago
Okay so I finally found the equality/ connect attribute. Playing around with it now.
@mgiglia92 Did you have any luck with the equality/connect
attribute?
I have a very similar problem (only using a rack and pinion) and I am currently trying to understand which value I need to insert for the anchor
. Specifically relative to what coordinate system the anchor has to be (body1, world or body2).
If it has to be in world coordinates it would not help for this specific problem.
In your example it is simple though, because the is no physical connection between the bodies you can simply force the joints to have an opposite value and get the desired effect, by placing this inside the mujoco
tag:
<equality>
<joint joint1="turn0" joint2="turn1" polycoef="0 -1 0 0 0"></joint>
</equality>
However in my case this does not work, because I want to have a physical solid bar in between the steering wheels, that needs to be fixed using joints on both ends (+both ends need to be stationary).
@mgiglia92 Did you have any luck with the [
equality/connect
](https://mujoco.readthedocs.io/en/latest
Hi @FrankenApps,
I did end up getting a solution. I simply used the joint option. And like you said I just used the polycoef option and set it to be -1 of the other joint.
<joint joint1="turn0" joint2="turn1" polycoef="0 -1 0 0 0"/>
I did also try using the following, but ended up opting for the simpler option, mostly because I was okay with the non-ackerman steering.
<!-- <connect body1="linkage" body2="upright0" anchor="{body_x - upright_edge_length} {-1*(body_y + upright_spacing)} 0" active="true"/> -->
<!-- <connect body1="linkage" body2="upright1" anchor="{body_x - upright_edge_length} {(body_y + upright_spacing)} 0" active="true"/> -->
As far as positions, I was using the global positions (which I believe are only considered global for when the model is generated and moves properly as the bodies move.) This analysis is probably incorrect though as I am very new to mujoco. I used variables to control the size and positions of the primitives which helped a lot.
Sorry I don't have a great answer to this. What's the reason you can't use global positions to set the anchors?
Just to add to this, I believe the main issue I was having with the equality/connect was the "softness" of the anchor, which was mentioned in another post I made somewhere, I'll try and find it. But this softness comes from the solimp value (and another i can't remember the name of). I think the default values for these make the anchor "soft".
Hello, I can't seem to find the answer to this between the legacy forum and the new github discussion but hopefully it's an easy one.
I'm modelling a simple 4-wheeled car in Mujoco using the shape primitives available in Mujoco. I took the body_interaction.py example and edited it to make my car. Everything is going well as far as creating the frame, uprights and wheels and orienting them properly. I'm stuck on this next crucial part though.
Typically an ideal steering system is the "ackerman" steering, which is essentially just a 4 bar linkage that controls the orientation of the two front wheels. I'm not sure how I can connect a new "box" type body with two hinge joints on the ends that connect to the bodies named "upright0" and "upright1" such that they rotate together. Note also that the upright0 and upright1 bodies are children of the "robot" body which is just the frame of the vehicle.
Actuating the linkage is another problem, but I think I can figure out how to solve that one once I'm able to constrain the motion of the two bodies by this linkage.
Sorry if this is a repeat question!
Here is the edited body_interaction.py