Skip to content

Conversation

@lorycontixd
Copy link

No description provided.

@lorycontixd
Copy link
Author

Implementation doubts for the future:

  • mujocoSimulator.load_model is functional when loading a single model, and a floor inclination is passed each time. In case of multiple models, either convert the function to load_models or separate floor definition from model definition.

@lorycontixd lorycontixd changed the title Implement a way to generate an inclined plane Implement floor inclination and various properties Oct 10, 2024
- Generalised urdf_path input for robotModel class to pass either string or a pathlib object
- [To review] Added save_xml flag on robotModel.get_mujoco_model to save the modified xml file
@lorycontixd
Copy link
Author

⚠️ The robotModel class does not work well with temporary files, even if the file still exists on the machine.
It's good practise then to pass a path to a physical file.

The issue is most likely raised from this line in Adam when used on a temporary file.

@lorycontixd
Copy link
Author

@CarlottaSartore Adding you as a reviewer for starting the merging process.

@lorycontixd
Copy link
Author

Current usage of floor definition:

mujoco_instance = MujocoSimulator()
mujoco_instance.load_model(
    robot_model_init,
    s=[-0.55, 0],
    xyz_rpy=np.asarray([0, 0, initial_height, 0.5, 0, 0]),
    floor_opts={
        "friction" : 0.5,
        "inclination_deg" : [0., 10., 0.]
    },
)

Currently accepted floor_opts keys are:

  • friction: friction coefficient of the floor ($0 \lt \mu \lt 1$) (default: 0.6)
  • inclination: euler angles for the inclination of the plane (in degrees) (default: [0, 0, 0])

If an invalid key is passed, an exception is raised.
If a key is not passed, default values are used.

@lorycontixd lorycontixd self-assigned this Oct 10, 2024
… with associated default values taken from mujoco
@lorycontixd
Copy link
Author

Current usage of floor definition:

mujoco_instance = MujocoSimulator()
mujoco_instance.load_model(
    robot_model_init,
    s=[-0.55, 0],
    xyz_rpy=np.asarray([0, 0, initial_height, 0.5, 0, 0]),
    floor_opts={
        "friction" : 0.5,
        "inclination_deg" : [0., 10., 0.]
    },
)

Currently accepted floor_opts keys are:

* friction: friction coefficient of the floor (
    0
    <
    μ
    <
    1
  ) (default: 0.6)

* inclination: euler angles for the inclination of the plane (in degrees) (default: [0, 0, 0])

If an invalid key is passed, an exception is raised. If a key is not passed, default values are used.


ℹ️ Now separated into mujoco's 3 different types of contact frictions:

mujoco_instance = MujocoSimulator()
    mujoco_instance.load_model(
        robot_model,
        s=[-0.55, 0],
        xyz_rpy=np.asarray([0, 0, initial_height, 0.5, 0, 0]),
        floor_opts={
            "sliding_friction" : 1.,
            "torsional_friction" : 0.01,
            "rolling_friction" : 0.0001,
            "inclination_deg" : [0, 10.0, 0]
        },
    )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant