Giter Site home page Giter Site logo

Comments (4)

Mordween avatar Mordween commented on September 17, 2024

Hi,

I use this to attach the body to the cable:

<body name="payload" pos="0 0.015 0.02">
      <geom type="sphere" size=".001 .001" density="100" rgba=".5 .2 .8 1" mass="0.01"/>
      <freejoint/>
    </body>

<composite type="cable" count="50 1 1" curve="s 0 0" offset="0 0 0" initial="ball" size="0.39 1 1">
    <joint kind="main" damping="0.01" armature="0.001"/>
    <geom type="capsule" size=".0005 .001 0.3" rgba=".8 .2 .1 1"/>
</composite>

<equality>
    <weld body1="payload" body2="B_last" active="true" anchor="0 0 0" torquescale="0"/>
</equality>

Your cable is defined with many small bodies, and if you want to refer to a specific one, you can use B_0 for the first segment, B_N for the Nth segment, or B_last for the last segment.

I hope this helps

from mujoco.

jessicatodd avatar jessicatodd commented on September 17, 2024

If you look the code I attached, I do use the equality constraint with B_last. The issue is that there is a gap between the position of the payload and the end of the cable, and if I lengthen the cable, it does not seem to reduce this gap (essentially the payload is suspended in free space below the end of the cable"

from mujoco.

quagla avatar quagla commented on September 17, 2024

If I understand it correctly, it's because constraints are soft in mujoco. You can use solref and solimp in the constraint parameters to make it stiffer.

https://mujoco.readthedocs.io/en/latest/XMLreference.html#equality

from mujoco.

Balint-H avatar Balint-H commented on September 17, 2024

I think this is because the connect constraint assumes it is satisfied in the starting position (and keeps any starting offset constant). Move the payload to the end of the cable in your xml, and it will get rid of the offset! (e.g. pos="0.2 0 0.2")

Beyond that, there will be some small stretching as well from soft constraints like Alessio described as well, which you can stiffen up if needed.

from mujoco.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.