Trouble with Positioning in Modeling

Discussion in 'Modeling' started by cyril, Dec 6, 2018.

  1. Hello again,

    I'm trying to model the following image where the first cylinder (left) is the base, J1 being the hinge joint that limits the movement of the second cylinder to 0-90º along the dotted red line (perpendicular to the first cylinder) and J2 being the joint that rotates the second cylinder along the axis passing by it in a parallel fashion. I can't seem to get it right, especially when it comes to positioning the first hinge.

    Here's what I have so far but it doesn't seem like the hinge movement is working:

    <body childclass="robot0:Test" name="robot0:cylinder1">
    <geom mesh="robot0:cylinder1" name="robot0:cylinder1" material="robot0:arm_mat" class="robot0:blue"></geom>
    <body name="robot0:r_J1">
    <geom mesh="robot0:r_J1" name="robot0:r_J1" material="robot0:link_mat" class="robot0:metal"></geom>
    <joint type="hinge" axis="0 0 1" pos="1 1 1" limited="true" range="0 1.5708"/>

    <body name="robot0:r_J1'">
    <geom mesh="robot0:r_J1'" name="robot0:r_J1'" material="robot0:link_mat" class="robot0:metal"></geom>
    <body name="robot0:r_J2">
    <geom mesh="robot0:r_J2" name="robot0:r_J2" material="robot0:rotator_mat" class="robot0:white"></geom>
    <body name="robot0:cylinder2">
    <geom mesh="robot0:cylinder2" name="robot0:cylinder2" material="robot0:arm_mat" class="robot0:blue"></geom>

    Is there a specific GUI I can use to model joints instead of using the XML to do so? Would it be possible to get an example of this setup I could learn from?

    Attached Files:

  2. I think I may have figured it out but won't be able to try my solution for a while due to finals. Will post solution here when done.

    EDIT: Is there a way of ignoring collisions on a mesh? Or does that mean I should identify it as something other than a body (even if I want to attach a joint to it later on)?
    Last edited: Dec 7, 2018
  3. You can exclude all contacts between two bodies using the exclude mechanism of the mujoco xml.
    Alternatively you can use predefined collisions only (option -> predefined), which allows you to precisely specify the geometries you want to enable contacts for.
    cyril likes this.
  4. Thanks! It seems that when excluding contacts, this prevents/disables a joint? In my case two objects with a hinge joint stop swinging as soon as the exclude collision mechanism is enabled
  5. That certainly shouldn't be the case. I can have a look if you provide a standalone mujoco xml file.
  6. I've included the STLs and the XML files. Running robotdemo.xml should get you started. shared.xml has the exclude mechanism. robot.xml has the construction of the robot. Also, how do I set the joint exactly in the middle of my joint's mesh? Setting it via the pos argument of the hinge mechanism seems inexact and a bit finicky (unless I'm doing it wrong). Thank you for your help btw

    Attached Files:

  7. Well the gravity vector in parallel with your rev-joint axis. There are no forces that would make the joint moving. I verified that if you apply a force manually, the joint does move. Btw your rotation axis is misplaced slightly.
    cyril likes this.
  8. Thank you! Yeah still trying to figure out the coordinate system in MuJoCo. I wish there was some type of GUI - it'd be much quick to prototype robots in
  9. There is (simulate.cpp). Precompiled within the zip folders provided.
    cyril likes this.
  10. Ah I couldn't find it earlier as it seemed OpenAI's SpinningUp had moved the folder around. Found it and I'm using it - and it's a lot better this way.

    One last question: would you mind giving me a hint as to how to reproduce a joint similar to the ball joint but limited to only rotating around its axis - so kind of like an owl rotating its head 360 if it couldn't look up, down, etc just straight ahead while it heads spins on its axis. I've tried using a hinge joint as shown below, but it seems like the joint can't be contained the in the body, so the mesh just twirls around the joint. The ball joint is 3 degrees of freedom when I only need one. This is the disaster I've come up with (screenshot). The joint is supposed to be 'in' the blue body so it can rotate along the x axis but that doesn't work as it just swings around

    Attached Files:

  11. [​IMG]

    You mean like this?

    Sounds like you should try to adjust the pos element of the joint until its in line with your body.
  12. HAHAHA that made me laugh out loud - but more like turning it’s head to look behind it. But I’ve tried moving the joint in there but the mesh seems to move away from it - guess I’ll spend more time with it, thank you again for all your help