{"id":31548472,"url":"https://github.com/rohanpsingh/mc_mujoco","last_synced_at":"2025-10-04T16:36:48.507Z","repository":{"id":37736821,"uuid":"405853092","full_name":"rohanpsingh/mc_mujoco","owner":"rohanpsingh","description":"MuJoCo interface for mc-rtc","archived":false,"fork":false,"pushed_at":"2025-09-30T10:26:19.000Z","size":4708,"stargazers_count":115,"open_issues_count":9,"forks_count":32,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-09-30T12:26:50.202Z","etag":null,"topics":["mc-rtc","mujoco","simulation"],"latest_commit_sha":null,"homepage":"https://arxiv.org/abs/2209.00274","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rohanpsingh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-09-13T06:08:06.000Z","updated_at":"2025-09-30T10:26:23.000Z","dependencies_parsed_at":"2023-02-10T07:30:44.418Z","dependency_job_id":"21ea6960-499d-4844-96fb-904c059a1967","html_url":"https://github.com/rohanpsingh/mc_mujoco","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rohanpsingh/mc_mujoco","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rohanpsingh%2Fmc_mujoco","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rohanpsingh%2Fmc_mujoco/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rohanpsingh%2Fmc_mujoco/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rohanpsingh%2Fmc_mujoco/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rohanpsingh","download_url":"https://codeload.github.com/rohanpsingh/mc_mujoco/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rohanpsingh%2Fmc_mujoco/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278343095,"owners_count":25971399,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mc-rtc","mujoco","simulation"],"created_at":"2025-10-04T16:36:18.284Z","updated_at":"2025-10-04T16:36:48.457Z","avatar_url":"https://github.com/rohanpsingh.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mujoco interface for mc-rtc\n\n![Screenshot from 2022-08-12 17-09-16](https://user-images.githubusercontent.com/16384313/188832982-1a1263e4-ce33-4dc7-804a-589d151670b3.png)\n\n## Usage\n\nFirst, install the required apt packages:\n\n```sh\n$ sudo apt install libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libglew-dev\n```\n\nThen, execute the following command to install mujoco (`$HOME/.mujoco/mujoco301`), and build `mc_mujoco`:\n\n```sh\n$ git clone --recursive git@github.com:rohanpsingh/mc_mujoco.git\n$ cd mc_mujoco\n$ mkdir build \u0026\u0026 cd build\n$ cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo\n$ make\n$ make install\n```\n\n\u003e If mujoco is already installed, you can add the following   option to specify the path :\\\n    ```\n      cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DMUJOCO_ROOT_DIR=$HOME/.mujoco/mujoco301\n    ```\n\nAdd the following line to your `~/.bashrc`:\n\n```\nexport LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${HOME}/.mujoco/mujoco301/lib:${HOME}/.mujoco/mujoco301/bin\n```\n\nThen, to run the interface:\n\n```sh\n$ mc_mujoco\n```\n\n---\n\n#### To load additional objects in the scene\n\nThere are several steps needed to be followed:\n\n- First, create your object's XML file under `mc_mujoco/robots`. For example, [longtable.xml](robots/longtable.xml)\n- Then, create a simple config file with the `xmlModelPath` attribute. For example, [longtable.in.yaml](robots/longtable.in.yaml)\n- Then, install your object by adding it to the end of `mc_mujoco/robots/CMakeLists.txt`. For example, add [setup_env_object(box object)](robots/CMakeLists.txt#L15)\n\nYour object is now created and installed. Next you want to tell `mc-mujoco` to load it and place it at the desired pose.\nFind `~/.config/mc_rtc/mc_mujoco/mc_mujoco.yaml` (create it manually if needed) and paste the following:\n\n```yaml\nobjects:\n  box1:\n    module: \"box\"\n    init_pos:\n      translation: [3.1, 0, 0.9]\n      rotation: [0, 0, 0]\n  box2:\n    module: \"box\"\n    init_pos:\n      translation: [3.7, 0.2, 0.9]\n      rotation: [0, 0, 0]\n```\n\n---\n\n#### To load MuJoCo plugins\n\nTo load [MuJoCo plugins](https://mujoco.readthedocs.io/en/latest/programming/extension.html#engine-plugins), specify the paths to the directories containing the plugin libraries in the `PluginPaths` entry in `~/.config/mc_rtc/mc_mujoco/mc_mujoco.yaml`.\n\n```yaml\nPluginPaths: [\"\u003cpath-to-plugins\u003e\"]\n```\n\n---\n\n#### GUI: Mouse Interaction\n\nAn object is selected by left-double-click. The user can then apply forces and torques on the selected object by holding `Ctrl` key and dragging the left-mouse-button for torques and right-mouse-button for forces.\n\n## Example\n\nA basic example of what you can do using this package is [here](https://github.com/rohanpsingh/grasp-fsm-sample-controller).\n\n## Datastore callbacks\n\nThe following callbacks are available for the controller when running inside `mc_mujoco`\n\n| Signature                                                                           | Description                                                                                                        |\n| ----------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |\n| `{robot}::SetPosW(const sva::PTransformd \u0026)`                                         | Set the position of the given `robot`. Also works with objects                                                     |\n| `{robot}::SetPDGains(const std::vector\u003cdouble\u003e \u0026 p, const std::vector\u003cdouble\u003e \u0026 d)` | Set the PD gains for the actuation of the given `robot`. `p` and `d` must follow the robot's reference joint order |\n| `{robot}::SetPDGainsByName(const std::string \u0026 jn, double p, double d)`             | Set the PD gains for a given joint `jn` in `robot`                                                                 |\n| `{robot}::GetPDGains(std::vector\u003cdouble\u003e \u0026 p, std::vector\u003cdouble\u003e \u0026 d)`             | Get the current PD gains for `robot` actuation                                                                     |\n| `{robot}::GetPDGainsByName(const std::string \u0026 jn, double \u0026 p, double \u0026 d)`         | Get the current PD gains for a given joint `jn` in `robot`                                                         |\n\n## Citation\n\n```\n@inproceedings{singh2023mc,\n  title={mc-mujoco: Simulating Articulated Robots with FSM Controllers in MuJoCo},\n  author={Singh, Rohan P and Gergondet, Pierre and Kanehiro, Fumio},\n  booktitle={2023 IEEE/SICE International Symposium on System Integration (SII)},\n  pages={1--5},\n  year={2023},\n  organization={IEEE}\n}\n```\n\n### Credits\n\nThis package includes code from:\n\n- [imgui v1.84.2](https://github.com/ocornut/imgui/)\n- [implot v0.11](https://github.com/epezent/implot)\n- [ImGuizmo](https://github.com/CedricGuillemet/ImGuizmo)\n- [pugixml v1.11.4](https://github.com/zeux/pugixml)\n- [Roboto font](https://github.com/googlefonts/roboto)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frohanpsingh%2Fmc_mujoco","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frohanpsingh%2Fmc_mujoco","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frohanpsingh%2Fmc_mujoco/lists"}