├── .gitignore ├── .vscode ├── launch.json └── settings.json ├── Assets ├── Bomb.cs ├── Bomb.cs.meta ├── ML-Agents.meta ├── ML-Agents │ ├── Editor.meta │ ├── Editor │ │ ├── AgentEditor.cs │ │ ├── AgentEditor.cs.meta │ │ ├── BrainEditor.cs │ │ ├── BrainEditor.cs.meta │ │ ├── MLAgentsEditModeTest.cs │ │ ├── MLAgentsEditModeTest.cs.meta │ │ ├── ResetParameterDrawer.cs │ │ └── ResetParameterDrawer.cs.meta │ ├── Scripts.meta │ └── Scripts │ │ ├── Academy.cs │ │ ├── Academy.cs.meta │ │ ├── Agent.cs │ │ ├── Agent.cs.meta │ │ ├── BCTeacherHelper.cs │ │ ├── BCTeacherHelper.cs.meta │ │ ├── Brain.cs │ │ ├── Brain.cs.meta │ │ ├── Communicator.cs │ │ ├── Communicator.cs.meta │ │ ├── CoreBrain.cs │ │ ├── CoreBrain.cs.meta │ │ ├── CoreBrainExternal.cs │ │ ├── CoreBrainExternal.cs.meta │ │ ├── CoreBrainHeuristic.cs │ │ ├── CoreBrainHeuristic.cs.meta │ │ ├── CoreBrainInternal.cs │ │ ├── CoreBrainInternal.cs.meta │ │ ├── CoreBrainPlayer.cs │ │ ├── CoreBrainPlayer.cs.meta │ │ ├── Decision.cs │ │ ├── Decision.cs.meta │ │ ├── ExternalCommunicator.cs │ │ ├── ExternalCommunicator.cs.meta │ │ ├── Monitor.cs │ │ ├── Monitor.cs.meta │ │ ├── ResetParameters.cs │ │ ├── ResetParameters.cs.meta │ │ ├── UnityAgentsException.cs │ │ └── UnityAgentsException.cs.meta ├── MLA-MujocoUnity.meta ├── MLA-MujocoUnity │ ├── Models.meta │ ├── Models │ │ ├── humanoid113_AbnormalGaitA-10m.bytes │ │ ├── humanoid113_AbnormalGaitA-10m.bytes.meta │ │ ├── humanoid113_AbnormalGaitA-1m.bytes │ │ ├── humanoid113_AbnormalGaitA-1m.bytes.meta │ │ ├── humanoid113_AbnormalGaitA-3m.bytes │ │ ├── humanoid113_AbnormalGaitA-3m.bytes.meta │ │ ├── humanoid124_wip-1m.bytes │ │ └── humanoid124_wip-1m.bytes.meta │ ├── Prefabs.meta │ ├── Prefabs │ │ ├── MLA-MujocoSpawner.prefab │ │ └── MLA-MujocoSpawner.prefab.meta │ ├── Scenes.meta │ ├── Scenes │ │ ├── hopper.unity │ │ ├── hopper.unity.meta │ │ ├── humanoid.unity │ │ ├── humanoid.unity.meta │ │ ├── walker.unity │ │ └── walker.unity.meta │ ├── Scripts.meta │ └── Scripts │ │ ├── GameManager.cs │ │ ├── GameManager.cs.meta │ │ ├── MujocoAcademy.cs │ │ ├── MujocoAcademy.cs.meta │ │ ├── MujocoAgent.cs │ │ ├── MujocoAgent.cs.meta │ │ ├── SendOnCollisionTrigger.cs │ │ └── SendOnCollisionTrigger.cs.meta ├── MujocoUnity.meta ├── MujocoUnity │ ├── Materials.meta │ ├── Materials │ │ ├── MujocoMat.mat │ │ └── MujocoMat.mat.meta │ ├── New Terrain.asset │ ├── New Terrain.asset.meta │ ├── PhysicsMaterials.meta │ ├── PhysicsMaterials │ │ ├── Actor.physicMaterial │ │ ├── Actor.physicMaterial.meta │ │ ├── Ground.physicMaterial │ │ └── Ground.physicMaterial.meta │ ├── Prefabs.meta │ ├── Prefabs │ │ ├── MujocoSpawner.prefab │ │ └── MujocoSpawner.prefab.meta │ ├── Resources.meta │ ├── Resources │ │ ├── MujocoXml.meta │ │ └── MujocoXml │ │ │ ├── common.meta │ │ │ ├── common │ │ │ ├── materials.xml │ │ │ ├── materials.xml.meta │ │ │ ├── skybox.xml │ │ │ ├── skybox.xml.meta │ │ │ ├── visual.xml │ │ │ └── visual.xml.meta │ │ │ ├── debug1.xml │ │ │ ├── debug1.xml.meta │ │ │ ├── debug2.xml │ │ │ ├── debug2.xml.meta │ │ │ ├── debugAnt.xml │ │ │ ├── debugAnt.xml.meta │ │ │ ├── dm_acrobot.xml │ │ │ ├── dm_acrobot.xml.meta │ │ │ ├── dm_ball_in_cup.xml │ │ │ ├── dm_ball_in_cup.xml.meta │ │ │ ├── dm_cartpole.xml │ │ │ ├── dm_cartpole.xml.meta │ │ │ ├── dm_cheetah.xml │ │ │ ├── dm_cheetah.xml.meta │ │ │ ├── dm_finger.xml │ │ │ ├── dm_finger.xml.meta │ │ │ ├── dm_fish.xml │ │ │ ├── dm_fish.xml.meta │ │ │ ├── dm_hopper.xml │ │ │ ├── dm_hopper.xml.meta │ │ │ ├── dm_humanoid.xml │ │ │ ├── dm_humanoid.xml.meta │ │ │ ├── dm_humanoid_CMU.xml │ │ │ ├── dm_humanoid_CMU.xml.meta │ │ │ ├── dm_lqr.xml │ │ │ ├── dm_lqr.xml.meta │ │ │ ├── dm_manipulator.xml │ │ │ ├── dm_manipulator.xml.meta │ │ │ ├── dm_pendulum.xml │ │ │ ├── dm_pendulum.xml.meta │ │ │ ├── dm_point_mass.xml │ │ │ ├── dm_point_mass.xml.meta │ │ │ ├── dm_reacher.xml │ │ │ ├── dm_reacher.xml.meta │ │ │ ├── dm_stacker.xml │ │ │ ├── dm_stacker.xml.meta │ │ │ ├── dm_swimmer.xml │ │ │ ├── dm_swimmer.xml.meta │ │ │ ├── dm_walker.xml │ │ │ ├── dm_walker.xml.meta │ │ │ ├── oai_ant.xml │ │ │ ├── oai_ant.xml.meta │ │ │ ├── oai_half_cheetah.xml │ │ │ ├── oai_half_cheetah.xml.meta │ │ │ ├── oai_hopper.xml │ │ │ ├── oai_hopper.xml.meta │ │ │ ├── oai_humanoid.xml │ │ │ ├── oai_humanoid.xml.meta │ │ │ ├── oai_humanoidstandup.xml │ │ │ ├── oai_humanoidstandup.xml.meta │ │ │ ├── oai_inverted_double_pendulum.xml │ │ │ ├── oai_inverted_double_pendulum.xml.meta │ │ │ ├── oai_inverted_pendulum.xml │ │ │ ├── oai_inverted_pendulum.xml.meta │ │ │ ├── oai_point.xml │ │ │ ├── oai_point.xml.meta │ │ │ ├── oai_reacher.xml │ │ │ ├── oai_reacher.xml.meta │ │ │ ├── oai_swimmer.xml │ │ │ ├── oai_swimmer.xml.meta │ │ │ ├── oai_walker2d.xml │ │ │ ├── oai_walker2d.xml.meta │ │ │ ├── unity_dm_walker.xml │ │ │ ├── unity_dm_walker.xml.meta │ │ │ ├── unity_oai_ant.xml │ │ │ ├── unity_oai_ant.xml.meta │ │ │ ├── unity_oai_hopper.xml │ │ │ ├── unity_oai_hopper.xml.meta │ │ │ ├── unity_oai_humanoid.xml │ │ │ ├── unity_oai_humanoid.xml.meta │ │ │ ├── unity_oai_walker2d.xml │ │ │ └── unity_oai_walker2d.xml.meta │ ├── Scenes.meta │ ├── Scenes │ │ ├── Sample.unity │ │ └── Sample.unity.meta │ ├── Scripts.meta │ ├── Scripts │ │ ├── JointTest.cs │ │ ├── JointTest.cs.meta │ │ ├── MujocoController.cs │ │ ├── MujocoController.cs.meta │ │ ├── MujocoHelper.cs │ │ ├── MujocoHelper.cs.meta │ │ ├── MujocoJoint.cs │ │ ├── MujocoJoint.cs.meta │ │ ├── MujocoSensor.cs │ │ ├── MujocoSensor.cs.meta │ │ ├── MujocoSpawner.cs │ │ ├── MujocoSpawner.cs.meta │ │ ├── ParseMujoco.cs │ │ ├── ParseMujoco.cs.meta │ │ ├── PrimitiveHelper.cs │ │ ├── PrimitiveHelper.cs.meta │ │ ├── ProceduralCapsule.cs │ │ ├── ProceduralCapsule.cs.meta │ │ ├── SensorBehavior.cs │ │ └── SensorBehavior.cs.meta │ ├── Textures.meta │ └── Textures │ │ ├── grid1.jpg │ │ ├── grid1.jpg.meta │ │ ├── grid2.jpg │ │ ├── grid2.jpg.meta │ │ ├── grid3.jpg │ │ ├── grid3.jpg.meta │ │ ├── grid4.jpg │ │ ├── grid4.jpg.meta │ │ ├── grid6.jpg │ │ └── grid6.jpg.meta ├── Plugins.meta ├── Plugins │ ├── Android.meta │ ├── Android │ │ ├── Java.Interop.dll │ │ ├── Java.Interop.dll.meta │ │ ├── Mono.Android.dll │ │ ├── Mono.Android.dll.meta │ │ ├── System.Collections.Concurrent.dll │ │ ├── System.Collections.Concurrent.dll.meta │ │ ├── System.Collections.dll │ │ ├── System.Collections.dll.meta │ │ ├── System.Diagnostics.Debug.dll │ │ ├── System.Diagnostics.Debug.dll.meta │ │ ├── System.Linq.dll │ │ ├── System.Linq.dll.meta │ │ ├── System.Reflection.Extensions.dll │ │ ├── System.Reflection.Extensions.dll.meta │ │ ├── System.Reflection.dll │ │ ├── System.Reflection.dll.meta │ │ ├── System.Resources.ResourceManager.dll │ │ ├── System.Resources.ResourceManager.dll.meta │ │ ├── System.Runtime.Extensions.dll │ │ ├── System.Runtime.Extensions.dll.meta │ │ ├── System.Runtime.InteropServices.dll │ │ ├── System.Runtime.InteropServices.dll.meta │ │ ├── System.Runtime.Numerics.dll │ │ ├── System.Runtime.Numerics.dll.meta │ │ ├── System.Runtime.dll │ │ ├── System.Runtime.dll.meta │ │ ├── System.Text.Encoding.dll │ │ ├── System.Text.Encoding.dll.meta │ │ ├── System.Threading.dll │ │ ├── System.Threading.dll.meta │ │ ├── TensorFlowSharp.Android.dll │ │ ├── TensorFlowSharp.Android.dll.meta │ │ ├── TensorFlowSharp.dll │ │ ├── TensorFlowSharp.dll.meta │ │ ├── libs.meta │ │ └── libs │ │ │ ├── armeabi-v7a.meta │ │ │ ├── armeabi-v7a │ │ │ ├── libtensorflow.so │ │ │ └── libtensorflow.so.meta │ │ │ ├── x86.meta │ │ │ └── x86 │ │ │ ├── libtensorflow.so │ │ │ └── libtensorflow.so.meta │ ├── Computer.meta │ ├── Computer │ │ ├── TensorFlowSharp.dll │ │ ├── TensorFlowSharp.dll.meta │ │ ├── liblibtensorflow.so │ │ ├── liblibtensorflow.so.meta │ │ ├── libtensorflow.bundle │ │ ├── libtensorflow.bundle.meta │ │ ├── libtensorflow.dll │ │ └── libtensorflow.dll.meta │ ├── JSON.meta │ ├── JSON │ │ ├── Newtonsoft.Json.dll │ │ └── Newtonsoft.Json.dll.meta │ ├── System.Numerics.dll │ ├── System.Numerics.dll.meta │ ├── System.ValueTuple.dll │ ├── System.ValueTuple.dll.meta │ ├── iOS.meta │ └── iOS │ │ ├── TensorFlowSharp.dll │ │ ├── TensorFlowSharp.dll.meta │ │ ├── libprotobuf-lite.a │ │ ├── libprotobuf-lite.a.meta │ │ ├── libprotobuf.a │ │ ├── libprotobuf.a.meta │ │ ├── libtensorflow-core.a │ │ └── libtensorflow-core.a.meta ├── SmoothFollow.cs └── SmoothFollow.cs.meta ├── Docs ├── Images │ ├── ant-acktor.gif │ ├── ant-random.gif │ ├── dm_walker_1m.gif │ ├── dm_walker_3m.gif │ ├── hopper_1.5m_ml_agents_ppo.gif │ ├── hopper_2m.gif │ ├── hopper_300k.gif │ └── walker_3m_ml_agents_ppo.gif └── ml_agents.md ├── LICENSE.md ├── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── NetworkManager.asset ├── Physics2DSettings.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset └── UnityConnectSettings.asset ├── README.md └── UnityPackageManager └── manifest.json /.gitignore: -------------------------------------------------------------------------------- 1 | [Ll]ibrary/ 2 | [Tt]emp/ 3 | [Oo]bj/ 4 | [Bb]uild/ 5 | [Bb]uilds/ 6 | Assets/AssetStoreTools* 7 | 8 | # Visual Studio 2015 cache directory 9 | /.vs/ 10 | 11 | # Autogenerated VS/MD/Consulo solution and project files 12 | ExportedObj/ 13 | .consulo/ 14 | *.csproj 15 | *.unityproj 16 | *.sln 17 | *.suo 18 | *.tmp 19 | *.user 20 | *.userprefs 21 | *.pidb 22 | *.booproj 23 | *.svd 24 | *.pdb 25 | 26 | # Unity3D generated meta files 27 | *.pidb.meta 28 | *.pdb.meta 29 | 30 | # Unity3D Generated File On Crash Reports 31 | sysinfo.txt 32 | 33 | # Builds 34 | *.apk 35 | *.unitypackage 36 | Assets/MJP 37 | Assets/StreamingAssets 38 | MJP.meta 39 | StreamingAssets.meta 40 | Capture/ 41 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Unity Editor", 9 | "type": "unity", 10 | "request": "launch" 11 | }, 12 | { 13 | "name": "Windows Player", 14 | "type": "unity", 15 | "request": "launch" 16 | }, 17 | { 18 | "name": "OSX Player", 19 | "type": "unity", 20 | "request": "launch" 21 | }, 22 | { 23 | "name": "Linux Player", 24 | "type": "unity", 25 | "request": "launch" 26 | }, 27 | { 28 | "name": "iOS Player", 29 | "type": "unity", 30 | "request": "launch" 31 | }, 32 | { 33 | "name": "Android Player", 34 | "type": "unity", 35 | "request": "launch" 36 | } 37 | ] 38 | } -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.exclude": 3 | { 4 | "**/.DS_Store":true, 5 | "**/.git":true, 6 | "**/.gitignore":true, 7 | "**/.gitmodules":true, 8 | "**/*.booproj":true, 9 | "**/*.pidb":true, 10 | "**/*.suo":true, 11 | "**/*.user":true, 12 | "**/*.userprefs":true, 13 | "**/*.unityproj":true, 14 | "**/*.dll":true, 15 | "**/*.exe":true, 16 | "**/*.pdf":true, 17 | "**/*.mid":true, 18 | "**/*.midi":true, 19 | "**/*.wav":true, 20 | "**/*.gif":true, 21 | "**/*.ico":true, 22 | "**/*.jpg":true, 23 | "**/*.jpeg":true, 24 | "**/*.png":true, 25 | "**/*.psd":true, 26 | "**/*.tga":true, 27 | "**/*.tif":true, 28 | "**/*.tiff":true, 29 | "**/*.3ds":true, 30 | "**/*.3DS":true, 31 | "**/*.fbx":true, 32 | "**/*.FBX":true, 33 | "**/*.lxo":true, 34 | "**/*.LXO":true, 35 | "**/*.ma":true, 36 | "**/*.MA":true, 37 | "**/*.obj":true, 38 | "**/*.OBJ":true, 39 | "**/*.asset":true, 40 | "**/*.cubemap":true, 41 | "**/*.flare":true, 42 | "**/*.mat":true, 43 | "**/*.meta":true, 44 | "**/*.prefab":true, 45 | "**/*.unity":true, 46 | "build/":true, 47 | "Build/":true, 48 | "Library/":true, 49 | "library/":true, 50 | "obj/":true, 51 | "Obj/":true, 52 | "ProjectSettings/":true, 53 | "temp/":true, 54 | "Temp/":true 55 | } 56 | } -------------------------------------------------------------------------------- /Assets/Bomb.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class Bomb : MonoBehaviour { 6 | 7 | // Use this for initialization 8 | public float radius = 5.0F; 9 | public float power = 10.0F; 10 | public float delay = 1.0F; 11 | public float repeate = 0F; 12 | 13 | 14 | void Update() 15 | { 16 | if (delay == 0f) 17 | return; 18 | delay -= Time.deltaTime; 19 | delay = Mathf.Max(0f, delay); 20 | if (delay == 0f){ 21 | Explode(); 22 | delay = repeate; 23 | } 24 | 25 | } 26 | 27 | void Explode() 28 | { 29 | Vector3 explosionPos = transform.position; 30 | Collider[] colliders = Physics.OverlapSphere(explosionPos, radius); 31 | foreach (Collider hit in colliders) 32 | { 33 | Rigidbody rb = hit.GetComponent(); 34 | 35 | if (rb != null) 36 | rb.AddExplosionForce(power, explosionPos, radius, 3.0F); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Assets/Bomb.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b7037b44d045ede72e135c57d42e0ff2 3 | timeCreated: 1633024800 4 | licenseType: Pro 5 | DefaultImporter: 6 | externalObjects: {} 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/ML-Agents.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9eccdb315c61e07cb0ff2f9b7e8ce7d0008d7c4d900ca58fed77f31043de59be 3 | timeCreated: 1633024800 4 | licenseType: Pro 5 | DefaultImporter: 6 | externalObjects: {} 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/ML-Agents/Editor.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:884c09da465e3bf562e6b17cdce4d0600f2f1f09e03a47d44b6edc06247d686a 3 | size 192 4 | -------------------------------------------------------------------------------- /Assets/ML-Agents/Editor/AgentEditor.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | 4 | /* 5 | This code is meant to modify the behavior of the inspector on Brain Components. 6 | Depending on the type of brain that is used, the available fields will be modified in the inspector accordingly. 7 | */ 8 | [CustomEditor(typeof(Agent), true)] 9 | [CanEditMultipleObjects] 10 | public class AgentEditor : Editor 11 | { 12 | 13 | public override void OnInspectorGUI() 14 | { 15 | SerializedObject serializedAgent = serializedObject; 16 | serializedAgent.Update(); 17 | 18 | SerializedProperty brain = serializedAgent.FindProperty("brain"); 19 | SerializedProperty actionsPerDecision = serializedAgent.FindProperty( 20 | "agentParameters.numberOfActionsBetweenDecisions"); 21 | SerializedProperty maxSteps = serializedAgent.FindProperty( 22 | "agentParameters.maxStep"); 23 | SerializedProperty isResetOnDone = serializedAgent.FindProperty( 24 | "agentParameters.resetOnDone"); 25 | SerializedProperty isODD = serializedAgent.FindProperty( 26 | "agentParameters.onDemandDecision"); 27 | SerializedProperty cameras = serializedAgent.FindProperty( 28 | "agentParameters.agentCameras"); 29 | 30 | EditorGUILayout.PropertyField(brain); 31 | 32 | EditorGUILayout.LabelField("Agent Cameras"); 33 | for (int i = 0; i < cameras.arraySize; i++) 34 | { 35 | EditorGUILayout.PropertyField( 36 | cameras.GetArrayElementAtIndex(i), 37 | new GUIContent("Camera " + (i + 1).ToString() + ": ")); 38 | } 39 | EditorGUILayout.BeginHorizontal(); 40 | if (GUILayout.Button("Add Camera", EditorStyles.miniButton)) 41 | { 42 | cameras.arraySize++; 43 | } 44 | if (GUILayout.Button("Remove Camera", EditorStyles.miniButton)) 45 | { 46 | cameras.arraySize--; 47 | } 48 | EditorGUILayout.EndHorizontal(); 49 | 50 | EditorGUILayout.PropertyField( 51 | maxSteps, 52 | new GUIContent( 53 | "Max Step", "The per-agent maximum number of steps.")); 54 | EditorGUILayout.PropertyField( 55 | isResetOnDone, 56 | new GUIContent( 57 | "Reset On Done", 58 | "If checked, the agent will reset on done. Else, AgentOnDone() will be called.")); 59 | EditorGUILayout.PropertyField( 60 | isODD, 61 | new GUIContent( 62 | "On Demand Decisions", 63 | "If checked, you must manually request decisions.")); 64 | if (!isODD.boolValue) 65 | { 66 | EditorGUILayout.PropertyField( 67 | actionsPerDecision, 68 | new GUIContent( 69 | "Decision Frequency", 70 | "The agent will automatically request a decision every X" + 71 | " steps and perform an action at every step.")); 72 | actionsPerDecision.intValue = Mathf.Max(1, actionsPerDecision.intValue); 73 | } 74 | 75 | serializedAgent.ApplyModifiedProperties(); 76 | 77 | EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); 78 | base.OnInspectorGUI(); 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /Assets/ML-Agents/Editor/AgentEditor.cs.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8e9d8613a2c47f3375f0d42a16356cacf601a05221ae22dfd0e4dff6036d21c6 3 | size 263 4 | -------------------------------------------------------------------------------- /Assets/ML-Agents/Editor/BrainEditor.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | using UnityEditor; 6 | using System.Linq; 7 | /* 8 | This code is meant to modify the behavior of the inspector on Brain Components. 9 | Depending on the type of brain that is used, the available fields will be modified in the inspector accordingly. 10 | */ 11 | [CustomEditor (typeof(Brain))] 12 | public class BrainEditor : Editor 13 | { 14 | [SerializeField] 15 | bool _Foldout = true; 16 | 17 | public override void OnInspectorGUI () 18 | { 19 | Brain myBrain = (Brain)target; 20 | SerializedObject serializedBrain = serializedObject; 21 | 22 | if (myBrain.transform.parent == null) { 23 | EditorGUILayout.HelpBox ("A Brain GameObject must be a child of an Academy GameObject!", MessageType.Error); 24 | } else if (myBrain.transform.parent.GetComponent () == null) { 25 | EditorGUILayout.HelpBox ("The Parent of a Brain must have an Academy Component attached to it!", MessageType.Error); 26 | } 27 | 28 | BrainParameters parameters = myBrain.brainParameters; 29 | if (parameters.vectorActionDescriptions == null || parameters.vectorActionDescriptions.Length != parameters.vectorActionSize) 30 | parameters.vectorActionDescriptions = new string[parameters.vectorActionSize]; 31 | 32 | serializedBrain.Update(); 33 | 34 | 35 | _Foldout = EditorGUILayout.Foldout(_Foldout, "Brain Parameters"); 36 | int indentLevel = EditorGUI.indentLevel; 37 | if (_Foldout) 38 | { 39 | EditorGUI.indentLevel++; 40 | EditorGUILayout.LabelField("Vector Observation"); 41 | EditorGUI.indentLevel++; 42 | 43 | SerializedProperty bpVectorObsType = serializedBrain.FindProperty("brainParameters.vectorObservationSpaceType"); 44 | EditorGUILayout.PropertyField(bpVectorObsType, new GUIContent("Space Type", "Corresponds to whether state " + 45 | "vector contains a single integer (Discrete) " + 46 | "or a series of real-valued floats (Continuous).")); 47 | 48 | SerializedProperty bpVectorObsSize = serializedBrain.FindProperty("brainParameters.vectorObservationSize"); 49 | EditorGUILayout.PropertyField(bpVectorObsSize, new GUIContent("Space Size", "Length of state " + 50 | "vector for brain (In Continuous state space)." + 51 | "Or number of possible values (in Discrete state space).")); 52 | 53 | 54 | SerializedProperty bpNumStackedVectorObs = serializedBrain.FindProperty("brainParameters.numStackedVectorObservations"); 55 | EditorGUILayout.PropertyField(bpNumStackedVectorObs, new GUIContent("Stacked Vectors", "Number of states that" + 56 | " will be stacked before beeing fed to the neural network.")); 57 | 58 | EditorGUI.indentLevel--; 59 | SerializedProperty bpCamResol = serializedBrain.FindProperty("brainParameters.cameraResolutions"); 60 | EditorGUILayout.PropertyField(bpCamResol, new GUIContent("Visual Observation", "Describes height, " + 61 | "width, and whether to greyscale visual observations for the Brain."), true); 62 | 63 | EditorGUILayout.LabelField("Vector Action"); 64 | EditorGUI.indentLevel++; 65 | 66 | SerializedProperty bpVectorActionType = serializedBrain.FindProperty("brainParameters.vectorActionSpaceType"); 67 | EditorGUILayout.PropertyField(bpVectorActionType, new GUIContent("Space Type", "Corresponds to whether state" + 68 | " vector contains a single integer (Discrete) " + 69 | "or a series of real-valued floats (Continuous).")); 70 | 71 | SerializedProperty bpVectorActionSize = serializedBrain.FindProperty("brainParameters.vectorActionSize"); 72 | EditorGUILayout.PropertyField(bpVectorActionSize, new GUIContent("Space Size", "Length of action vector " + 73 | "for brain (In Continuous state space)." + 74 | "Or number of possible values (In Discrete action space).")); 75 | 76 | SerializedProperty bpVectorActionDescription = serializedBrain.FindProperty("brainParameters.vectorActionDescriptions"); 77 | EditorGUILayout.PropertyField(bpVectorActionDescription, new GUIContent("Action Descriptions", "A list of strings used to name" + 78 | " the available actions for the Brain."), true); 79 | 80 | } 81 | EditorGUI.indentLevel = indentLevel; 82 | SerializedProperty bt = serializedBrain.FindProperty("brainType"); 83 | EditorGUILayout.PropertyField(bt); 84 | 85 | 86 | 87 | 88 | if (bt.enumValueIndex < 0) { 89 | bt.enumValueIndex = (int)BrainType.Player; 90 | } 91 | 92 | serializedBrain.ApplyModifiedProperties(); 93 | 94 | myBrain.UpdateCoreBrains (); 95 | myBrain.coreBrain.OnInspector (); 96 | 97 | #if !NET_4_6 && ENABLE_TENSORFLOW 98 | EditorGUILayout.HelpBox ("You cannot have ENABLE_TENSORFLOW without NET_4_6", MessageType.Error); 99 | #endif 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /Assets/ML-Agents/Editor/BrainEditor.cs.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:e972702ac3c5326e21bbcba223110cc27c8faaa698b7d51e59990c1d37645f45 3 | size 263 4 | -------------------------------------------------------------------------------- /Assets/ML-Agents/Editor/MLAgentsEditModeTest.cs.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:9dbc4974473fb26d0e851bdeb155b9847cb8f9a11c7b44ab94890ae047b2d8cf 3 | size 263 4 | -------------------------------------------------------------------------------- /Assets/ML-Agents/Editor/ResetParameterDrawer.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | using System; 4 | using System.Linq; 5 | using UnityEditor.SceneManagement; 6 | 7 | [CustomPropertyDrawer(typeof(ResetParameters))] 8 | public class ResetParameterDrawer : PropertyDrawer 9 | { 10 | private ResetParameters _Dictionary; 11 | private const float lineHeight = 17f; 12 | 13 | public override float GetPropertyHeight(SerializedProperty property, GUIContent label) 14 | { 15 | CheckInitialize(property, label); 16 | return (_Dictionary.Count + 2) * lineHeight; 17 | } 18 | 19 | public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) 20 | { 21 | 22 | CheckInitialize(property, label); 23 | position.height = lineHeight; 24 | EditorGUI.LabelField(position, label); 25 | 26 | EditorGUI.BeginProperty(position, label, property); 27 | foreach (var item in _Dictionary) 28 | { 29 | var key = item.Key; 30 | var value = item.Value; 31 | position.y += lineHeight; 32 | 33 | // This is the rectangle for the key 34 | var keyRect = position; 35 | keyRect.x += 20; 36 | keyRect.width /= 2; 37 | keyRect.width -= 24; 38 | EditorGUI.BeginChangeCheck(); 39 | var newKey = EditorGUI.TextField(keyRect, key); 40 | if (EditorGUI.EndChangeCheck()) 41 | { 42 | EditorSceneManager.MarkSceneDirty(EditorSceneManager.GetActiveScene()); 43 | try 44 | { 45 | _Dictionary.Remove(key); 46 | _Dictionary.Add(newKey, value); 47 | } 48 | catch (Exception e) 49 | { 50 | Debug.Log(e.Message); 51 | } 52 | break; 53 | } 54 | 55 | // This is the Rectangle for the value 56 | var valueRect = position; 57 | valueRect.x = position.width / 2 + 15; 58 | valueRect.width = keyRect.width - 18; 59 | EditorGUI.BeginChangeCheck(); 60 | value = EditorGUI.FloatField(valueRect, value); 61 | if (EditorGUI.EndChangeCheck()) 62 | { 63 | EditorSceneManager.MarkSceneDirty(EditorSceneManager.GetActiveScene()); 64 | _Dictionary[key] = value; 65 | break; 66 | } 67 | } 68 | 69 | // This is the rectangle for the Add button 70 | position.y += lineHeight; 71 | var AddButtonRect = position; 72 | AddButtonRect.x += 20; 73 | AddButtonRect.width /= 2; 74 | AddButtonRect.width -= 24; 75 | if (GUI.Button(AddButtonRect, new GUIContent("Add New", 76 | "Add a new item to the default reset paramters"), EditorStyles.miniButton)) 77 | { 78 | EditorSceneManager.MarkSceneDirty(EditorSceneManager.GetActiveScene()); 79 | AddNewItem(); 80 | } 81 | 82 | // This is the rectangle for the Remove button 83 | var RemoveButtonRect = position; 84 | RemoveButtonRect.x = position.width / 2 + 15; 85 | RemoveButtonRect.width = AddButtonRect.width - 18; 86 | if (GUI.Button(RemoveButtonRect, new GUIContent("Remove Last", 87 | "Remove the last item to the default reset paramters"), EditorStyles.miniButton)) 88 | { 89 | EditorSceneManager.MarkSceneDirty(EditorSceneManager.GetActiveScene()); 90 | RemoveLastItem(); 91 | } 92 | 93 | 94 | EditorGUI.EndProperty(); 95 | 96 | } 97 | 98 | private void CheckInitialize(SerializedProperty property, GUIContent label) 99 | { 100 | if (_Dictionary == null) 101 | { 102 | var target = property.serializedObject.targetObject; 103 | _Dictionary = fieldInfo.GetValue(target) as ResetParameters; 104 | if (_Dictionary == null) 105 | { 106 | _Dictionary = new ResetParameters(); 107 | fieldInfo.SetValue(target, _Dictionary); 108 | } 109 | } 110 | } 111 | 112 | private void ClearResetParamters() 113 | { 114 | _Dictionary.Clear(); 115 | } 116 | 117 | private void RemoveLastItem() 118 | { 119 | if (_Dictionary.Count > 0) 120 | { 121 | string key = _Dictionary.Keys.ToList()[_Dictionary.Count - 1]; 122 | _Dictionary.Remove(key); 123 | } 124 | } 125 | 126 | private void AddNewItem() 127 | { 128 | string key = "Param-" + _Dictionary.Count.ToString(); 129 | var value = default(float); 130 | try 131 | { 132 | _Dictionary.Add(key, value); 133 | } 134 | catch (Exception e) 135 | { 136 | Debug.Log(e.Message); 137 | } 138 | } 139 | } -------------------------------------------------------------------------------- /Assets/ML-Agents/Editor/ResetParameterDrawer.cs.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:dea71abc638374b3e99257b0c0324771f2d85be033dc6d045f40c225a419fe45 3 | size 263 4 | -------------------------------------------------------------------------------- /Assets/ML-Agents/Scripts.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:35886cba6ec99cef757bf36392e60c8dae08f3eb42e35149cabef2d56159a270 3 | size 192 4 | -------------------------------------------------------------------------------- /Assets/ML-Agents/Scripts/Academy.cs.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:fabdbe0abd089f9b916751b1f2ea8047d3eb4478bf82544735b89a2790931ecf 3 | size 263 4 | -------------------------------------------------------------------------------- /Assets/ML-Agents/Scripts/Agent.cs.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5662d3c3a3fad4d531e2dc32e7b1f6f306bfbad801acae1fce67f8b876a13f3b 3 | size 263 4 | -------------------------------------------------------------------------------- /Assets/ML-Agents/Scripts/BCTeacherHelper.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | 6 | /// 7 | /// Behavioral Cloning Helper script. Attach to teacher agent to enable 8 | /// resetting the experience buffer, as well as toggling session recording. 9 | /// 10 | public class BCTeacherHelper : MonoBehaviour { 11 | 12 | bool recordExperiences; 13 | bool resetBuffer; 14 | Agent myAgent; 15 | float bufferResetTime; 16 | 17 | public KeyCode recordKey = KeyCode.R; 18 | public KeyCode resetKey = KeyCode.C; 19 | 20 | // Use this for initialization 21 | void Start () { 22 | recordExperiences = true; 23 | resetBuffer = false; 24 | myAgent = GetComponent(); 25 | bufferResetTime = Time.time; 26 | } 27 | 28 | // Update is called once per frame 29 | void Update () { 30 | if (Input.GetKeyDown(recordKey)) 31 | { 32 | recordExperiences = !recordExperiences; 33 | } 34 | if (Input.GetKeyDown(resetKey)) 35 | { 36 | resetBuffer = true; 37 | bufferResetTime = Time.time; 38 | } 39 | else 40 | { 41 | resetBuffer = false; 42 | } 43 | Monitor.Log("Recording experiences " + recordKey.ToString(), recordExperiences.ToString()); 44 | float timeSinceBufferReset = Time.time - bufferResetTime; 45 | Monitor.Log("Seconds since buffer reset " + resetKey.ToString(), Mathf.FloorToInt(timeSinceBufferReset)); 46 | } 47 | 48 | void FixedUpdate() 49 | { 50 | // Convert both bools into single comma separated string. Python makes 51 | // assumption that this structure is preserved. 52 | myAgent.SetTextObs(recordExperiences.ToString() + "," + resetBuffer.ToString()); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Assets/ML-Agents/Scripts/BCTeacherHelper.cs.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5baed6d5ff5c07f50b234b12e774bd3c9c26736567f1043e4250501eaa2423aa 3 | size 243 4 | -------------------------------------------------------------------------------- /Assets/ML-Agents/Scripts/Brain.cs.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:6c84c1ec217faffc0297131b21cd9fe836538ccbad5a08348b3bef2ee8b415c7 3 | size 263 4 | -------------------------------------------------------------------------------- /Assets/ML-Agents/Scripts/Communicator.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | /** \brief AcademyParameters is a structure containing basic information about the 6 | * training environment. */ 7 | /** The AcademyParameters will be sent via socket at the start of the Environment. 8 | * This structure does not need to be modified. 9 | */ 10 | public struct AcademyParameters 11 | { 12 | /**< \brief The name of the Academy. If the communicator is External, 13 | * it will be the name of the Academy GameObject */ 14 | public string AcademyName; 15 | 16 | /**< \brief The API number for the communicator. */ 17 | public string apiNumber; 18 | 19 | /**< \brief The location of the logfile*/ 20 | public string logPath; 21 | 22 | /**< \brief The default reset parameters are sent via socket*/ 23 | public Dictionary resetParameters; 24 | 25 | /**< \brief A list of the all the brains names sent via socket*/ 26 | public List brainNames; 27 | 28 | /**< \brief A list of the External brains parameters sent via socket*/ 29 | public List brainParameters; 30 | 31 | /**< \brief A list of the External brains names sent via socket*/ 32 | public List externalBrainNames; 33 | } 34 | 35 | public enum ExternalCommand 36 | { 37 | STEP, 38 | RESET, 39 | QUIT 40 | } 41 | 42 | /** 43 | * This is the interface used to generate coordinators. 44 | * This does not need to be modified nor implemented to create a 45 | * Unity environment. 46 | */ 47 | public interface Communicator 48 | { 49 | 50 | /// Implement this method to allow brains to subscribe to the 51 | /// decisions made outside of Unity 52 | void SubscribeBrain(Brain brain); 53 | 54 | /// First contact between Communicator and external process 55 | bool CommunicatorHandShake(); 56 | 57 | /// Implement this method to initialize the communicator 58 | void InitializeCommunicator(); 59 | 60 | /// Implement this method to receive actions from outside of Unity and 61 | /// update the actions of the brains that subscribe 62 | void UpdateActions(); 63 | 64 | /// Implement this method to return the ExternalCommand that 65 | /// was given outside of Unity 66 | ExternalCommand GetCommand(); 67 | 68 | void UpdateCommand(); 69 | void SetCommand(ExternalCommand c); 70 | 71 | /// Implement this method to return the new dictionary of resetParameters 72 | /// that was given outside of Unity 73 | Dictionary GetResetParameters(); 74 | 75 | 76 | 77 | Dictionary GetHasTried(); 78 | Dictionary GetSent(); 79 | 80 | } 81 | -------------------------------------------------------------------------------- /Assets/ML-Agents/Scripts/Communicator.cs.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5a35b53ca088a51858cb66131ba328da40a84c15c5564ee4248718db9fdd82ef 3 | size 263 4 | -------------------------------------------------------------------------------- /Assets/ML-Agents/Scripts/CoreBrain.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | /** \brief An interface which defines the functions needed for a CoreBrain. */ 6 | /** There is no need to modify or implement CoreBrain to create a Unity environment. 7 | */ 8 | public interface CoreBrain 9 | { 10 | 11 | /// Implement setBrain so let the coreBrain know what brain is using it 12 | void SetBrain(Brain b); 13 | /// Implement this method to initialize CoreBrain 14 | void InitializeCoreBrain(Communicator communicator); 15 | /// Implement this method to define the logic for deciding actions 16 | void DecideAction(Dictionary agentInfo); 17 | /// Implement this method to define what should be displayed in the brain Inspector 18 | void OnInspector(); 19 | } 20 | -------------------------------------------------------------------------------- /Assets/ML-Agents/Scripts/CoreBrain.cs.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:6bec1ffb345d018eed5d4d2c96b162db5b06b0f8ad2463d84f2b74619d494986 3 | size 263 4 | -------------------------------------------------------------------------------- /Assets/ML-Agents/Scripts/CoreBrainExternal.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | /// CoreBrain which decides actions via communication with an external system such as Python. 6 | public class CoreBrainExternal : ScriptableObject, CoreBrain 7 | { 8 | /**< Reference to the brain that uses this CoreBrainExternal */ 9 | public Brain brain; 10 | 11 | ExternalCommunicator coord; 12 | 13 | /// Creates the reference to the brain 14 | public void SetBrain(Brain b) 15 | { 16 | brain = b; 17 | } 18 | 19 | /// Generates the communicator for the Academy if none was present and 20 | /// subscribe to ExternalCommunicator if it was present. 21 | public void InitializeCoreBrain(Communicator communicator) 22 | { 23 | if (communicator == null) 24 | { 25 | coord = null; 26 | throw new UnityAgentsException(string.Format("The brain {0} was set to" + 27 | " External mode" + 28 | " but Unity was unable to read the" + 29 | " arguments passed at launch.", brain.gameObject.name)); 30 | } 31 | else if (communicator is ExternalCommunicator) 32 | { 33 | coord = (ExternalCommunicator)communicator; 34 | coord.SubscribeBrain(brain); 35 | } 36 | 37 | } 38 | 39 | /// Uses the communicator to retrieve the actions, memories and values and 40 | /// sends them to the agents 41 | public void DecideAction(Dictionary agentInfo) 42 | { 43 | if (coord != null) 44 | { 45 | coord.GiveBrainInfo(brain, agentInfo); 46 | } 47 | return ; 48 | } 49 | 50 | /// Nothing needs to appear in the inspector 51 | public void OnInspector() 52 | { 53 | 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Assets/ML-Agents/Scripts/CoreBrainExternal.cs.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ce8a52efcfd0d1f81143182fd87996cc6a4794316af65503bc60564e4b3208c4 3 | size 263 4 | -------------------------------------------------------------------------------- /Assets/ML-Agents/Scripts/CoreBrainHeuristic.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | #if UNITY_EDITOR 6 | using UnityEditor; 7 | #endif 8 | 9 | /// CoreBrain which decides actions using developer-provided Decision script. 10 | public class CoreBrainHeuristic : ScriptableObject, CoreBrain 11 | { 12 | [SerializeField] 13 | private bool broadcast = true; 14 | 15 | /**< Reference to the brain that uses this CoreBrainHeuristic */ 16 | public Brain brain; 17 | 18 | ExternalCommunicator coord; 19 | 20 | /**< Reference to the Decision component used to decide the actions */ 21 | public Decision decision; 22 | 23 | /// Create the reference to the brain 24 | public void SetBrain(Brain b) 25 | { 26 | brain = b; 27 | } 28 | 29 | /// Create the reference to decision 30 | public void InitializeCoreBrain(Communicator communicator) 31 | { 32 | decision = brain.gameObject.GetComponent(); 33 | 34 | if ((communicator == null) 35 | || (!broadcast)) 36 | { 37 | coord = null; 38 | } 39 | else if (communicator is ExternalCommunicator) 40 | { 41 | coord = (ExternalCommunicator)communicator; 42 | coord.SubscribeBrain(brain); 43 | } 44 | } 45 | 46 | /// Uses the Decision Component to decide that action to take 47 | public void DecideAction(Dictionary agentInfo) 48 | { 49 | if (coord!=null) 50 | { 51 | coord.GiveBrainInfo(brain, agentInfo); 52 | } 53 | 54 | if (decision == null) 55 | { 56 | throw new UnityAgentsException("The Brain is set to Heuristic, but no decision script attached to it"); 57 | } 58 | 59 | foreach (Agent agent in agentInfo.Keys) 60 | { 61 | agent.UpdateVectorAction(decision.Decide( 62 | agentInfo[agent].stackedVectorObservation, 63 | agentInfo[agent].visualObservations, 64 | agentInfo[agent].reward, 65 | agentInfo[agent].done, 66 | agentInfo[agent].memories)); 67 | 68 | } 69 | 70 | foreach (Agent agent in agentInfo.Keys) 71 | { 72 | agent.UpdateMemoriesAction(decision.MakeMemory( 73 | agentInfo[agent].stackedVectorObservation, 74 | agentInfo[agent].visualObservations, 75 | agentInfo[agent].reward, 76 | agentInfo[agent].done, 77 | agentInfo[agent].memories)); 78 | } 79 | } 80 | 81 | /// Displays an error if no decision component is attached to the brain 82 | public void OnInspector() 83 | { 84 | #if UNITY_EDITOR 85 | EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); 86 | broadcast = EditorGUILayout.Toggle(new GUIContent("Broadcast", 87 | "If checked, the brain will broadcast states and actions to Python."), broadcast); 88 | if (brain.gameObject.GetComponent() == null) 89 | { 90 | EditorGUILayout.HelpBox("You need to add a 'Decision' component to this gameObject", MessageType.Error); 91 | } 92 | #endif 93 | } 94 | 95 | } 96 | -------------------------------------------------------------------------------- /Assets/ML-Agents/Scripts/CoreBrainHeuristic.cs.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c85de7bc234f801b853531e4b814eae97e0644c92f235f4bd302cef0255ed673 3 | size 263 4 | -------------------------------------------------------------------------------- /Assets/ML-Agents/Scripts/CoreBrainInternal.cs.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:254ecf166cad6bcf46178976fb052eb8d8540c3fc8d881091fc16b07701eccb8 3 | size 263 4 | -------------------------------------------------------------------------------- /Assets/ML-Agents/Scripts/CoreBrainPlayer.cs.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:65f2c84c442116bef9cd14b226e1cd444ead564e7fb7025879541c1e902b7f8c 3 | size 263 4 | -------------------------------------------------------------------------------- /Assets/ML-Agents/Scripts/Decision.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEngine; 3 | 4 | /// 5 | /// Interface for implementing the behavior of an Agent that uses a Heuristic 6 | /// Brain. The behavior of an Agent in this case is fully decided using the 7 | /// implementation of these methods and no training or inference takes place. 8 | /// Currently, the Heuristic Brain does not support text observations and actions. 9 | /// 10 | public interface Decision 11 | { 12 | /// 13 | /// Defines the decision-making logic of the agent. Given the information 14 | /// about the agent, returns a vector of actions. 15 | /// 16 | /// Vector action vector. 17 | /// The vector observations of the agent. 18 | /// The cameras the agent uses for visual observations. 19 | /// The reward the agent received at the previous step. 20 | /// Whether or not the agent is done. 21 | /// 22 | /// The memories stored from the previous step with 23 | /// 24 | /// 25 | float[] Decide( 26 | List 27 | vectorObs, 28 | List visualObs, 29 | float reward, 30 | bool done, 31 | List memory); 32 | 33 | /// 34 | /// Defines the logic for creating the memory vector for the Agent. 35 | /// 36 | /// The vector of memories the agent will use at the next step. 37 | /// The vector observations of the agent. 38 | /// The cameras the agent uses for visual observations. 39 | /// The reward the agent received at the previous step. 40 | /// Whether or not the agent is done. 41 | /// 42 | /// The memories stored from the previous call to this method. 43 | /// 44 | List MakeMemory( 45 | List vectorObs, 46 | List visualObs, 47 | float reward, 48 | bool done, 49 | List memory); 50 | } 51 | -------------------------------------------------------------------------------- /Assets/ML-Agents/Scripts/Decision.cs.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d62a790e005a83fa1dd3753947cc88aa68bd28fc1ff8faddf8c2d98b052ed0e2 3 | size 263 4 | -------------------------------------------------------------------------------- /Assets/ML-Agents/Scripts/ExternalCommunicator.cs.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:4dfc6a921b2ae8379c6c49da5c10a220b38234eaf06af88f1a1aba5778c528c6 3 | size 263 4 | -------------------------------------------------------------------------------- /Assets/ML-Agents/Scripts/Monitor.cs.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ba33d1a185a9ec40411f132100a927ca1e777d59909994bb5463be7121792d4d 3 | size 263 4 | -------------------------------------------------------------------------------- /Assets/ML-Agents/Scripts/ResetParameters.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | 6 | [System.Serializable] 7 | public class ResetParameters : Dictionary, ISerializationCallbackReceiver 8 | { 9 | 10 | [System.Serializable] 11 | public struct ResetParameter 12 | { 13 | public string key; 14 | public float value; 15 | } 16 | [SerializeField] 17 | private List resetParameters = new List(); 18 | 19 | public void OnBeforeSerialize() 20 | { 21 | resetParameters.Clear(); 22 | 23 | foreach (KeyValuePair pair in this) 24 | { 25 | ResetParameter rp = new ResetParameter(); 26 | rp.key = pair.Key; 27 | 28 | rp.value = pair.Value; 29 | resetParameters.Add(rp); 30 | } 31 | 32 | } 33 | 34 | public void OnAfterDeserialize() 35 | { 36 | this.Clear(); 37 | 38 | 39 | 40 | for (int i = 0; i < resetParameters.Count; i++) 41 | { 42 | if (this.ContainsKey(resetParameters[i].key)) 43 | { 44 | Debug.LogError("The ResetParameters contains the same key twice"); 45 | } 46 | else 47 | { 48 | this.Add(resetParameters[i].key, resetParameters[i].value); 49 | } 50 | } 51 | } 52 | } -------------------------------------------------------------------------------- /Assets/ML-Agents/Scripts/ResetParameters.cs.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7d2ede5948122fb8e7fd3aea2bf0f30bec3e7a88b3bec22c80d68a400e84cb63 3 | size 263 4 | -------------------------------------------------------------------------------- /Assets/ML-Agents/Scripts/UnityAgentsException.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | using System; 6 | [System.Serializable] 7 | /// Contains exceptions specific to ML-Agents. 8 | public class UnityAgentsException : System.Exception 9 | { 10 | /// When a UnityAgentsException is called, the timeScale is set to 0. 11 | /// The simulation will end since no steps will be taken. 12 | public UnityAgentsException(string message) : base(message) 13 | { 14 | Time.timeScale = 0f; 15 | } 16 | 17 | /// A constructor is needed for serialization when an exception propagates 18 | /// from a remoting server to the client. 19 | protected UnityAgentsException(System.Runtime.Serialization.SerializationInfo info, 20 | System.Runtime.Serialization.StreamingContext context) 21 | { } 22 | } 23 | -------------------------------------------------------------------------------- /Assets/ML-Agents/Scripts/UnityAgentsException.cs.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8553494f9138cf07440305e7db888079952a2b50a97041f4ffa62dfc6e8e9d64 3 | size 263 4 | -------------------------------------------------------------------------------- /Assets/MLA-MujocoUnity.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:99ea63b23d75b764527354951bc6a16571dc53368d64396a268f9a3e7a59f367 3 | size 214 4 | -------------------------------------------------------------------------------- /Assets/MLA-MujocoUnity/Models.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c9a4efeb57162dc2102ff4e9813b39a63672735cf008505a691f286aa13b062e 3 | size 214 4 | -------------------------------------------------------------------------------- /Assets/MLA-MujocoUnity/Models/humanoid113_AbnormalGaitA-10m.bytes: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a6e313387623e98abc766e7799705ac29eda4c17fbf9ebc274979e5433b803ab 3 | size 241229 4 | -------------------------------------------------------------------------------- /Assets/MLA-MujocoUnity/Models/humanoid113_AbnormalGaitA-10m.bytes.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c107b983b485f280805abb222baf4fddbb9bb2f0d3e9b0dace3f10e0c1bc2b7c 3 | size 200 4 | -------------------------------------------------------------------------------- /Assets/MLA-MujocoUnity/Models/humanoid113_AbnormalGaitA-1m.bytes: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:f1e4f7479435a07a41a1c4668927dd3327da1945ac7eb929d89cfbb0ad9dfb20 3 | size 241228 4 | -------------------------------------------------------------------------------- /Assets/MLA-MujocoUnity/Models/humanoid113_AbnormalGaitA-1m.bytes.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:4fa122754b5a0890870bdc8b2ef5c130f34bfcc902677c33e9106c785e6aad21 3 | size 200 4 | -------------------------------------------------------------------------------- /Assets/MLA-MujocoUnity/Models/humanoid113_AbnormalGaitA-3m.bytes: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d866f7db194964bedaefca168ab02ee27a2f09f3a72d5c35f8a574794b020901 3 | size 241229 4 | -------------------------------------------------------------------------------- /Assets/MLA-MujocoUnity/Models/humanoid113_AbnormalGaitA-3m.bytes.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:2a68af89e72f2a42c4115d012ce8c3b605b335560f9422da2a6ec2498a14c510 3 | size 200 4 | -------------------------------------------------------------------------------- /Assets/MLA-MujocoUnity/Models/humanoid124_wip-1m.bytes: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:29dff51f62b0229294dbc4b9ab16f0bc41e49c20ec2a7a4536893da999e0c30f 3 | size 241228 4 | -------------------------------------------------------------------------------- /Assets/MLA-MujocoUnity/Models/humanoid124_wip-1m.bytes.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:33b7235cefefa4aaef5fff95648b355652d6690bc1a9327606f15a3df2eb6e5c 3 | size 200 4 | -------------------------------------------------------------------------------- /Assets/MLA-MujocoUnity/Prefabs.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a0ec7d840a533280ed9e1733cb86fb5c648c3ae397275e9cc3f16e25fae8c431 3 | size 214 4 | -------------------------------------------------------------------------------- /Assets/MLA-MujocoUnity/Prefabs/MLA-MujocoSpawner.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1001 &100100000 4 | Prefab: 5 | m_ObjectHideFlags: 1 6 | serializedVersion: 2 7 | m_Modification: 8 | m_TransformParent: {fileID: 0} 9 | m_Modifications: [] 10 | m_RemovedComponents: [] 11 | m_ParentPrefab: {fileID: 0} 12 | m_RootGameObject: {fileID: 1176651103004916} 13 | m_IsPrefabParent: 1 14 | --- !u!1 &1176651103004916 15 | GameObject: 16 | m_ObjectHideFlags: 0 17 | m_PrefabParentObject: {fileID: 0} 18 | m_PrefabInternal: {fileID: 100100000} 19 | serializedVersion: 5 20 | m_Component: 21 | - component: {fileID: 4114328417322356} 22 | - component: {fileID: 114930587501614892} 23 | - component: {fileID: 114652901231369746} 24 | m_Layer: 10 25 | m_Name: MLA-MujocoSpawner 26 | m_TagString: Untagged 27 | m_Icon: {fileID: 0} 28 | m_NavMeshLayer: 0 29 | m_StaticEditorFlags: 0 30 | m_IsActive: 1 31 | --- !u!4 &4114328417322356 32 | Transform: 33 | m_ObjectHideFlags: 1 34 | m_PrefabParentObject: {fileID: 0} 35 | m_PrefabInternal: {fileID: 100100000} 36 | m_GameObject: {fileID: 1176651103004916} 37 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 38 | m_LocalPosition: {x: 0, y: 0, z: 0} 39 | m_LocalScale: {x: 1, y: 1, z: 1} 40 | m_Children: [] 41 | m_Father: {fileID: 0} 42 | m_RootOrder: 0 43 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 44 | --- !u!114 &114652901231369746 45 | MonoBehaviour: 46 | m_ObjectHideFlags: 1 47 | m_PrefabParentObject: {fileID: 0} 48 | m_PrefabInternal: {fileID: 100100000} 49 | m_GameObject: {fileID: 1176651103004916} 50 | m_Enabled: 1 51 | m_EditorHideFlags: 0 52 | m_Script: {fileID: 11500000, guid: f2a639ea3e5c84c84bb9eb8b183cb903, type: 3} 53 | m_Name: 54 | m_EditorClassIdentifier: 55 | MujocoJoints: [] 56 | MujocoSensors: [] 57 | CameraTarget: {fileID: 0} 58 | applyRandomToAll: 0 59 | applyTargets: 0 60 | targets: [] 61 | qpos: [] 62 | qglobpos: [] 63 | qvel: [] 64 | OnSensor: [] 65 | SensorIsInTouch: [] 66 | MujocoTimeStep: 0 67 | _focalPoint: {fileID: 0} 68 | FocalPointPosition: {x: 0, y: 0, z: 0} 69 | FocalPointPositionVelocity: {x: 0, y: 0, z: 0} 70 | FocalPointRotation: {x: 0, y: 0, z: 0} 71 | FocalPointEulerAngles: {x: 0, y: 0, z: 0} 72 | FocalPointRotationVelocity: {x: 0, y: 0, z: 0} 73 | JointAngles: [] 74 | JointVelocity: [] 75 | JointRotations: [] 76 | JointAngularVelocities: [] 77 | --- !u!114 &114930587501614892 78 | MonoBehaviour: 79 | m_ObjectHideFlags: 1 80 | m_PrefabParentObject: {fileID: 0} 81 | m_PrefabInternal: {fileID: 100100000} 82 | m_GameObject: {fileID: 1176651103004916} 83 | m_Enabled: 1 84 | m_EditorHideFlags: 0 85 | m_Script: {fileID: 11500000, guid: a532e373957504411bd01901bf361ad3, type: 3} 86 | m_Name: 87 | m_EditorClassIdentifier: 88 | MujocoXml: {fileID: 0} 89 | Material: {fileID: 2100000, guid: 9013613e105254620b29c7301046af30, type: 2} 90 | PhysicMaterial: {fileID: 13400000, guid: 38b7ea504254a4fa986e42a7bb16c8df, type: 2} 91 | DefaultCollisionLayer: 92 | serializedVersion: 2 93 | m_Bits: 1 94 | AplusB_CollisionLayer: 95 | serializedVersion: 2 96 | m_Bits: 1024 97 | A_CollisionLayer: 98 | serializedVersion: 2 99 | m_Bits: 2048 100 | B_CollisionLayer: 101 | serializedVersion: 2 102 | m_Bits: 4096 103 | UseMujocoTimestep: 1 104 | DebugOutput: 0 105 | GravityOff: 0 106 | SpawnOnStart: 0 107 | ListOf2dScripts: 108 | - half_cheetah 109 | - hopper 110 | - walker2d 111 | UseMotorNotSpring: 1 112 | GlobalDamping: 10 113 | BaseForce: 0 114 | ForceMultiple: 1 115 | Mass: 1 116 | OnGenerateApplyRandom: 0.005 117 | -------------------------------------------------------------------------------- /Assets/MLA-MujocoUnity/Prefabs/MLA-MujocoSpawner.prefab.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:18dfe239ec6a83031073af5e12ca841f64c32efa88639f7650284a68b70876f5 3 | size 224 4 | -------------------------------------------------------------------------------- /Assets/MLA-MujocoUnity/Scenes.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:f5508aeb7283d80ace24fbf1ee01386b8fea84457ca8eae0b86d0aaa4a6c1cf7 3 | size 214 4 | -------------------------------------------------------------------------------- /Assets/MLA-MujocoUnity/Scenes/hopper.unity.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:33accb5168327267bf9b06f97c8ba51c2dd70d3faa490c0f3f35db742291c452 3 | size 197 4 | -------------------------------------------------------------------------------- /Assets/MLA-MujocoUnity/Scenes/humanoid.unity.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5405c851639a8a18ae1af2c9ff1dd9d5655c04a513eb6e78fa39a77512ad1d2b 3 | size 197 4 | -------------------------------------------------------------------------------- /Assets/MLA-MujocoUnity/Scenes/walker.unity.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:1c96dc5027a5a92b55706706fe0b9a680206bf88735284a87b12d71bdd448f5f 3 | size 197 4 | -------------------------------------------------------------------------------- /Assets/MLA-MujocoUnity/Scripts.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:116ddfea29bb9bf2abc40d3e34903f8e95375a7538883a00dc485318c213c2a7 3 | size 214 4 | -------------------------------------------------------------------------------- /Assets/MLA-MujocoUnity/Scripts/GameManager.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using MujocoUnity; 5 | using UnityEngine; 6 | 7 | 8 | namespace MlaMujocoUnity 9 | { 10 | [System.Serializable] 11 | public class m_MujocoType 12 | { 13 | public string ActorId; 14 | public TextAsset MujocoXml; 15 | } 16 | public class GameManager : MonoBehaviour 17 | { 18 | public SmoothFollow CameraControl; // Reference to the CameraControl script for control during different phases. 19 | public GameObject MujocoPrefab; 20 | public m_MujocoType[] m_MujocoFiles; 21 | public Transform m_SpawnPoint; 22 | 23 | private List Actors; 24 | 25 | public int SpawnCount = 1; 26 | 27 | public string ActorId; 28 | 29 | Brain _brain; 30 | void Start () { 31 | StartCoroutine (GameLoop ()); 32 | } 33 | private void SpawnAllActors() 34 | { 35 | if (Actors != null) { 36 | foreach (var actor in Actors) { 37 | Destroy(actor); 38 | } 39 | } 40 | _brain = GameObject.Find("MujocoBrain").GetComponent(); 41 | var spawnPos = m_SpawnPoint.position; 42 | for (int i = 0; i < SpawnCount; i++) 43 | { 44 | // var envId = _actorWorkerManager.Experiment.EnvironmentId; 45 | var actorId = ActorId; 46 | 47 | var mujocoType = m_MujocoFiles.FirstOrDefault(x=>x.ActorId == actorId); 48 | if (mujocoType == null) { 49 | var saferActorId = actorId.Split(new string[] { "-v" }, System.StringSplitOptions.None)[0]; 50 | saferActorId += "-v0"; 51 | mujocoType = m_MujocoFiles.FirstOrDefault(x=>x.ActorId == saferActorId); 52 | if (mujocoType == null) 53 | throw new System.ArgumentException($"Invalid actor: {actorId}"); 54 | } 55 | var prefab = MujocoPrefab; 56 | var instance = Instantiate(prefab, spawnPos, m_SpawnPoint.rotation) as GameObject; 57 | var mAgent = instance.AddComponent(); 58 | mAgent.MujocoXml = mujocoType.MujocoXml; 59 | mAgent.ActorId = actorId; 60 | mAgent.ShowMonitor = i==0; 61 | mAgent.GiveBrain(_brain); 62 | 63 | if (Actors == null) 64 | Actors = new List(); 65 | Actors.Add(instance); 66 | 67 | var mujocoController = instance.GetComponent(); 68 | if (mujocoController != null && i ==0) { 69 | mujocoController.CameraTarget = CameraControl.gameObject; 70 | } 71 | mAgent.AgentReset(); 72 | 73 | spawnPos.z += 1; 74 | } 75 | var template = Actors[0]; 76 | // _brain.brainParameters.vectorObservationSize = template.GetComponent().GetObservationCount(); 77 | // _brain.brainParameters.vectorActionSize = template.GetComponent().GetActionsCount(); 78 | } 79 | private IEnumerator GameLoop () 80 | { 81 | // yield return StartCoroutine (EnsureWorkerHasJob ()); 82 | yield return StartCoroutine (RoundStarting ()); 83 | yield return StartCoroutine (RoundPlaying()); 84 | yield return StartCoroutine (RoundEnding()); 85 | Resources.UnloadUnusedAssets(); 86 | StartCoroutine (GameLoop ()); 87 | } 88 | private IEnumerator RoundStarting () 89 | { 90 | SpawnAllActors(); 91 | yield return 0; 92 | } 93 | private IEnumerator RoundPlaying () 94 | { 95 | while (HasRoundEnded() == false) 96 | { 97 | // ... return on the next frame. 98 | yield return null; 99 | } 100 | } 101 | private IEnumerator RoundEnding () 102 | { 103 | yield return 0; 104 | } 105 | private bool HasRoundEnded() 106 | { 107 | // if (_requesReset || _disconnected) 108 | // return true; 109 | return false; 110 | } 111 | 112 | } 113 | } -------------------------------------------------------------------------------- /Assets/MLA-MujocoUnity/Scripts/GameManager.cs.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:cf8ced15fe14d758c6a2ff3e1587f3dec988bf22e30a22a5382dbfb3047e55d2 3 | size 285 4 | -------------------------------------------------------------------------------- /Assets/MLA-MujocoUnity/Scripts/MujocoAcademy.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace MlaMujocoUnity { 6 | public class MujocoAcademy : Academy { 7 | 8 | // // Use this for initialization 9 | // void Start () { 10 | 11 | // } 12 | 13 | // // Update is called once per frame 14 | // void Update () { 15 | 16 | // } 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /Assets/MLA-MujocoUnity/Scripts/MujocoAcademy.cs.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:076a18628f06cb61f4a796f4eeba09cb8b9631865f4829d395895c9e3fc76eac 3 | size 285 4 | -------------------------------------------------------------------------------- /Assets/MLA-MujocoUnity/Scripts/MujocoAgent.cs.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d6358bee8744937a583c443b5562526fcf08a263dcc8ed4909ce71b014656bbc 3 | size 285 4 | -------------------------------------------------------------------------------- /Assets/MLA-MujocoUnity/Scripts/SendOnCollisionTrigger.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace MlaMujocoUnity { 4 | public class SendOnCollisionTrigger : MonoBehaviour { 5 | // Use this for initialization 6 | void Start () { 7 | 8 | } 9 | 10 | // Update is called once per frame 11 | void Update () { 12 | 13 | } 14 | 15 | void OnCollisionEnter(Collision other) { 16 | // Messenger. 17 | var otherGameobject = other.gameObject; 18 | var mujocoAgent = otherGameobject.GetComponentInParent(); 19 | // if (mujocoAgent?.Length > 0) 20 | if (mujocoAgent != null) 21 | mujocoAgent.OnTerrainCollision(otherGameobject, this.gameObject); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /Assets/MLA-MujocoUnity/Scripts/SendOnCollisionTrigger.cs.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:32579ff1a27eae0cd93ba8d45c322bedb16efe7664b4512ad16454c0d46c791c 3 | size 285 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a4313b5cf871031448cf2a2b36fc47a196fcb8efc8dfcaf8b864479add428cc4 3 | size 214 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Materials.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c58484fdd4f333590c936d7cfaff2402e16fd02d513a24c03d6c54ab50b79322 3 | size 214 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Materials/MujocoMat.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: MujocoMat 10 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A 12 | m_LightmapFlags: 4 13 | m_EnableInstancingVariants: 1 14 | m_DoubleSidedGI: 0 15 | m_CustomRenderQueue: -1 16 | stringTagMap: {} 17 | disabledShaderPasses: [] 18 | m_SavedProperties: 19 | serializedVersion: 3 20 | m_TexEnvs: 21 | - _BumpMap: 22 | m_Texture: {fileID: 0} 23 | m_Scale: {x: 1, y: 1} 24 | m_Offset: {x: 0, y: 0} 25 | - _DetailAlbedoMap: 26 | m_Texture: {fileID: 0} 27 | m_Scale: {x: 1, y: 1} 28 | m_Offset: {x: 0, y: 0} 29 | - _DetailMask: 30 | m_Texture: {fileID: 0} 31 | m_Scale: {x: 1, y: 1} 32 | m_Offset: {x: 0, y: 0} 33 | - _DetailNormalMap: 34 | m_Texture: {fileID: 0} 35 | m_Scale: {x: 1, y: 1} 36 | m_Offset: {x: 0, y: 0} 37 | - _EmissionMap: 38 | m_Texture: {fileID: 0} 39 | m_Scale: {x: 1, y: 1} 40 | m_Offset: {x: 0, y: 0} 41 | - _MainTex: 42 | m_Texture: {fileID: 0} 43 | m_Scale: {x: 1, y: 1} 44 | m_Offset: {x: 0, y: 0} 45 | - _MetallicGlossMap: 46 | m_Texture: {fileID: 0} 47 | m_Scale: {x: 1, y: 1} 48 | m_Offset: {x: 0, y: 0} 49 | - _OcclusionMap: 50 | m_Texture: {fileID: 0} 51 | m_Scale: {x: 1, y: 1} 52 | m_Offset: {x: 0, y: 0} 53 | - _ParallaxMap: 54 | m_Texture: {fileID: 0} 55 | m_Scale: {x: 1, y: 1} 56 | m_Offset: {x: 0, y: 0} 57 | - _SpecGlossMap: 58 | m_Texture: {fileID: 0} 59 | m_Scale: {x: 1, y: 1} 60 | m_Offset: {x: 0, y: 0} 61 | m_Floats: 62 | - _BumpScale: 1 63 | - _Cutoff: 0.5 64 | - _DetailNormalMapScale: 1 65 | - _DstBlend: 0 66 | - _GlossMapScale: 0.241 67 | - _Glossiness: 0.35 68 | - _GlossyReflections: 1 69 | - _Metallic: 0 70 | - _Mode: 0 71 | - _OcclusionStrength: 1 72 | - _Parallax: 0.02 73 | - _Shininess: 0.03 74 | - _SmoothnessTextureChannel: 1 75 | - _SpecularHighlights: 1 76 | - _SrcBlend: 1 77 | - _UVSec: 0 78 | - _ZWrite: 1 79 | m_Colors: 80 | - _Color: {r: 0.8039216, g: 0.6039216, b: 0.4, a: 1} 81 | - _EmissionColor: {r: 0.2896552, g: 0.2896552, b: 0.2896552, a: 1} 82 | - _SpecColor: {r: 0, g: 0, b: 0, a: 0} 83 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Materials/MujocoMat.mat.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:98e7394f46393222a3d14d6fe0c48f70a47f77e319182fff6bdb38753daf3b83 3 | size 230 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/New Terrain.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sohojoe/MujocoUnity/2350ffcc83f2cd2e19a1f98f57d4b65b3879c25a/Assets/MujocoUnity/New Terrain.asset -------------------------------------------------------------------------------- /Assets/MujocoUnity/New Terrain.asset.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:41530cdd9c4b8b0c2ae4162986c61e6903773ec7039c55590a813d4e54dd8ac2 3 | size 224 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/PhysicsMaterials.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5eb1d2bbcb916799fde7688a8bd7cf8e4b4a27acaa647ed7f363cb0db5d762f3 3 | size 214 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/PhysicsMaterials/Actor.physicMaterial: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!134 &13400000 4 | PhysicMaterial: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_Name: Actor 9 | dynamicFriction: 2 10 | staticFriction: 2 11 | bounciness: 0 12 | frictionCombine: 3 13 | bounceCombine: 0 14 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/PhysicsMaterials/Actor.physicMaterial.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8f0115e9db9d672e7c8a30443f1d91ebfb0ac2dd42912b099aebb74fed41fade 3 | size 231 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/PhysicsMaterials/Ground.physicMaterial: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!134 &13400000 4 | PhysicMaterial: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_Name: Ground 9 | dynamicFriction: 0.6 10 | staticFriction: 0.6 11 | bounciness: 0 12 | frictionCombine: 0 13 | bounceCombine: 0 14 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/PhysicsMaterials/Ground.physicMaterial.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:dfb702bb06ad24e38226e37dc04e1caa12ef8468a2b9540fc9781be8299580eb 3 | size 231 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Prefabs.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:314ee2c549e191a01025be867d393ad11619c61eccfa705590cc564b1d7242d0 3 | size 214 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Prefabs/MujocoSpawner.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1001 &100100000 4 | Prefab: 5 | m_ObjectHideFlags: 1 6 | serializedVersion: 2 7 | m_Modification: 8 | m_TransformParent: {fileID: 0} 9 | m_Modifications: [] 10 | m_RemovedComponents: [] 11 | m_ParentPrefab: {fileID: 0} 12 | m_RootGameObject: {fileID: 1176651103004916} 13 | m_IsPrefabParent: 1 14 | --- !u!1 &1176651103004916 15 | GameObject: 16 | m_ObjectHideFlags: 0 17 | m_PrefabParentObject: {fileID: 0} 18 | m_PrefabInternal: {fileID: 100100000} 19 | serializedVersion: 5 20 | m_Component: 21 | - component: {fileID: 4114328417322356} 22 | - component: {fileID: 114930587501614892} 23 | - component: {fileID: 114652901231369746} 24 | m_Layer: 10 25 | m_Name: MujocoSpawner 26 | m_TagString: Untagged 27 | m_Icon: {fileID: 0} 28 | m_NavMeshLayer: 0 29 | m_StaticEditorFlags: 0 30 | m_IsActive: 1 31 | --- !u!4 &4114328417322356 32 | Transform: 33 | m_ObjectHideFlags: 1 34 | m_PrefabParentObject: {fileID: 0} 35 | m_PrefabInternal: {fileID: 100100000} 36 | m_GameObject: {fileID: 1176651103004916} 37 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 38 | m_LocalPosition: {x: 0, y: 0, z: 0} 39 | m_LocalScale: {x: 1, y: 1, z: 1} 40 | m_Children: [] 41 | m_Father: {fileID: 0} 42 | m_RootOrder: 0 43 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 44 | --- !u!114 &114652901231369746 45 | MonoBehaviour: 46 | m_ObjectHideFlags: 1 47 | m_PrefabParentObject: {fileID: 0} 48 | m_PrefabInternal: {fileID: 100100000} 49 | m_GameObject: {fileID: 1176651103004916} 50 | m_Enabled: 1 51 | m_EditorHideFlags: 0 52 | m_Script: {fileID: 11500000, guid: f2a639ea3e5c84c84bb9eb8b183cb903, type: 3} 53 | m_Name: 54 | m_EditorClassIdentifier: 55 | MujocoJoints: [] 56 | MujocoSensors: [] 57 | CameraTarget: {fileID: 0} 58 | applyRandomToAll: 0 59 | applyTargets: 0 60 | targets: [] 61 | qpos: [] 62 | qglobpos: [] 63 | qvel: [] 64 | OnSensor: [] 65 | SensorIsInTouch: [] 66 | MujocoTimeStep: 0 67 | _focalPoint: {fileID: 0} 68 | FocalPointPosition: {x: 0, y: 0, z: 0} 69 | FocalPointPositionVelocity: {x: 0, y: 0, z: 0} 70 | FocalPointRotation: {x: 0, y: 0, z: 0} 71 | FocalPointEulerAngles: {x: 0, y: 0, z: 0} 72 | FocalPointRotationVelocity: {x: 0, y: 0, z: 0} 73 | JointAngles: [] 74 | JointVelocity: [] 75 | JointRotations: [] 76 | JointAngularVelocities: [] 77 | --- !u!114 &114930587501614892 78 | MonoBehaviour: 79 | m_ObjectHideFlags: 1 80 | m_PrefabParentObject: {fileID: 0} 81 | m_PrefabInternal: {fileID: 100100000} 82 | m_GameObject: {fileID: 1176651103004916} 83 | m_Enabled: 1 84 | m_EditorHideFlags: 0 85 | m_Script: {fileID: 11500000, guid: a532e373957504411bd01901bf361ad3, type: 3} 86 | m_Name: 87 | m_EditorClassIdentifier: 88 | MujocoXml: {fileID: 0} 89 | Material: {fileID: 2100000, guid: 9013613e105254620b29c7301046af30, type: 2} 90 | PhysicMaterial: {fileID: 13400000, guid: 38b7ea504254a4fa986e42a7bb16c8df, type: 2} 91 | DefaultCollisionLayer: 92 | serializedVersion: 2 93 | m_Bits: 1 94 | AplusB_CollisionLayer: 95 | serializedVersion: 2 96 | m_Bits: 1024 97 | A_CollisionLayer: 98 | serializedVersion: 2 99 | m_Bits: 2048 100 | B_CollisionLayer: 101 | serializedVersion: 2 102 | m_Bits: 4096 103 | UseMujocoTimestep: 1 104 | DebugOutput: 0 105 | GravityOff: 0 106 | SpawnOnStart: 0 107 | ListOf2dScripts: 108 | - half_cheetah 109 | - hopper 110 | - walker2d 111 | UseMotorNotSpring: 1 112 | GlobalDamping: 10 113 | BaseForce: 0 114 | ForceMultiple: 1 115 | Mass: 1 116 | OnGenerateApplyRandom: 0.005 117 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Prefabs/MujocoSpawner.prefab.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c18b1f2d727628e064d04b98070763e4ef481e8fb0aaf80d043775b5e2451b30 3 | size 232 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ea137e445052c6d52349d83a67e2fd1fc5e2d5186499b0af0628f8429b7847c7 3 | size 214 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:74a095ca3558e9d44ecf68948df0801e5abae955c2f857d8191ff4e23eea80be 3 | size 214 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/common.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:951cf575d0443fb8882a973ea071d452e1f4dce857ce98690e0ca396966c7134 3 | size 214 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/common/materials.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/common/materials.xml.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:914de97e596fea455ec9c1b8acef65670442a18849ad72621a0d7a3fe72ea536 3 | size 200 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/common/skybox.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/common/skybox.xml.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:028798cfead4cadaf077bf369235c384614fb18144cd9a6d51524c98c00b3a38 3 | size 200 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/common/visual.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/common/visual.xml.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:e77be3e4a442f293c2b554751b47429d3a052fd37ffbc9e41e64c535b771ab61 3 | size 200 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/debug1.xml.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d194018e7f538938f736a0ed6397f5826c87f2c69ee2a2a8ce909e3d82634f99 3 | size 200 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/debug2.xml.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a5da5c7f6c64849f520c65b66969f05e4cd0685b4e1d1f2d35880695c8aea95d 3 | size 200 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/debugAnt.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 81 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/debugAnt.xml.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:6d1897c572b409974276268f90bdaf0b4e8fd62b90f5da4eee50920a78bb8919 3 | size 200 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/dm_acrobot.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/dm_acrobot.xml.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:549f1279af9cab3695f46d32e5823e7f62631d1347fbdfaa0816e78768619324 3 | size 200 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/dm_ball_in_cup.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/dm_ball_in_cup.xml.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:82dc1c30b5d4c4ee48692239a9c3763e01ac087a006be152a35fd2ff0af5b53f 3 | size 200 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/dm_cartpole.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/dm_cartpole.xml.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:868c36dd3eb50a53f45ff29fce172508bf738575b9fa4a3f91aea1fa15ff6c82 3 | size 200 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/dm_cheetah.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 71 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/dm_cheetah.xml.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ae9a3d9943cb6a4654ac8db80e29a61b46f78b65efd94e62168604cbdaf825ea 3 | size 200 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/dm_finger.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/dm_finger.xml.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:981b0a8e391b2ca7d4431bf8298b32dafd03b08aa815ad1d8cf7979b0efe0c77 3 | size 200 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/dm_fish.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/dm_fish.xml.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5c3ecbef553912472a438e5fa2c0d8bfa18ce244824958c1a48745cc6a33bd49 3 | size 200 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/dm_hopper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 66 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/dm_hopper.xml.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:3e08dcef7a5b86636ef70d5494838a61bc9a4eaf2241f903ee380c0d43543bb8 3 | size 200 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/dm_humanoid.xml.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:41be61b02a270e482405e90221c89fc9d39f4f588a11c832398e9013056b5dc2 3 | size 200 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/dm_humanoid_CMU.xml.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:0bb642ff3e1d593487238988483b6cf5d538853f3c7bfbba316b6b941a66fc4a 3 | size 200 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/dm_lqr.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/dm_lqr.xml.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:3cbd85f8a87570bafcfb4adc0f9c9f9b44a7b59f5939ef5b15694b7bcd3e92d1 3 | size 200 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/dm_manipulator.xml.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:28b36e3938e88c1ec98503b71abef7e5c732bf98bf9c92a283a5526f19b06d8b 3 | size 200 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/dm_pendulum.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/dm_pendulum.xml.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ab1d76d9506ddb8996c581eb1fd2f0b626daea3f8f6e874fccf605bc72dc4a48 3 | size 200 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/dm_point_mass.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/dm_point_mass.xml.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7f87f4f25a341b3e02b52cd09a7ee679a8bc5089fcf474a91d798a2a7343fb2d 3 | size 200 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/dm_reacher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/dm_reacher.xml.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:3685d208b486434c69f1bf9c6621535477143e96f55c45b1fa9818d15738a324 3 | size 200 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/dm_stacker.xml.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:14b3cc8ada9dde5b70b89db488c5752d524e1865e18fc69847ff84c0675cbcd6 3 | size 200 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/dm_swimmer.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/dm_swimmer.xml.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:53c39b63a680e424785b1d57108d7dc5358d32fc7528e3d13f362d775efe7068 3 | size 200 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/dm_walker.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 67 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/dm_walker.xml.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:91b0ddfdd7c75ddcf17c44eac1628b309f7001ead6e92136dd776534f8f1ddd7 3 | size 200 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/oai_ant.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 81 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/oai_ant.xml.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:946ae89108003553935be80f14b0b5bf27865b5bfcf4d290e533b7096ad6444e 3 | size 200 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/oai_half_cheetah.xml.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:cb8edf2be6ab2cd8d85102d8682e032678731bdde4113c4f1d4e67b2d2b8549f 3 | size 200 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/oai_hopper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/oai_hopper.xml.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ad01231572ccd09c742275a260a95d6e74ecf7a4f915f43f73e4aec2ead95e62 3 | size 200 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/oai_humanoid.xml.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:12d9539f53c610a9d29c756151c075351eeee8d1803416027246823826c96ab8 3 | size 200 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/oai_humanoidstandup.xml.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:4e1365cfe65b144b780f2b2e683599190d8ed668f2d154ad3f19be27a4940601 3 | size 200 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/oai_inverted_double_pendulum.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/oai_inverted_double_pendulum.xml.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:01126b5a6748b8396271ff7f5b66d9d5ec7dd97b34f38e00023ade92b9e39a8c 3 | size 200 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/oai_inverted_pendulum.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/oai_inverted_pendulum.xml.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:3ce1fab08b20d54cad1f22117f945655082cc71a3115f5466e5b96384c2d0a76 3 | size 200 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/oai_point.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 32 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/oai_point.xml.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:985ac9e55da2cc9914ee2bac3886e3557babb5524d52d4a369a56722cb65d3b9 3 | size 200 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/oai_reacher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/oai_reacher.xml.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c7f90aa88e4f884db65d822d1b043eaa01ad2822154bc232b31e04f1d6adda02 3 | size 200 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/oai_swimmer.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 39 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/oai_swimmer.xml.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a9b2a6962e3e9be1d68de286292f0361a74cb0f6f9c17a09f749671b30fbb190 3 | size 200 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/oai_walker2d.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/oai_walker2d.xml.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ded118a95f3a8b3ba4e5560da6af846180bf51fcb4ec602985417f72a3e684af 3 | size 200 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/unity_dm_walker.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/unity_dm_walker.xml.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a5d69e01589ff9769955b6a6c4078554d3aeb8aa627c05e7624c04621482047f 3 | size 200 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/unity_oai_ant.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 81 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/unity_oai_ant.xml.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:47d4c9fb67fdad238f5f4e320066b3b972412a331d2e87d57ddf3333ba747e71 3 | size 200 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/unity_oai_hopper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/unity_oai_hopper.xml.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:0c35ab53098d84f568f61322f6931afc483bd6c9efa8b99ca0127f57de30af97 3 | size 200 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/unity_oai_humanoid.xml.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:cbcc6ef3c1de86cc4e1f55a0a06bd307fe26648eaac92b2d4408d3f2bda23920 3 | size 200 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/unity_oai_walker2d.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Resources/MujocoXml/unity_oai_walker2d.xml.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:3173bdd68e383839db83a068e725b9094cedf612992ad77392db09e9a18ed4ac 3 | size 200 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Scenes.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c1b409d7e2e146ae984e694285665a33e634ad18b56c49fbfe32ee9501f7d1b4 3 | size 214 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Scenes/Sample.unity.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:cc0f7e058c53f974050f201b805eb055285373b819b4e888ad0ec69bdc209c72 3 | size 197 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Scripts.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:be4318cd5132e99f898fbc5af76a9547fbf232507ac4bba94a7e657c99ebe436 3 | size 214 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Scripts/JointTest.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace MujocoUnity { 4 | 5 | static class LocalExt { 6 | public static void MoveRotationTorque (this Rigidbody rigidbody, Quaternion targetRotation) { 7 | rigidbody.maxAngularVelocity = 1000; 8 | 9 | Quaternion rotation = targetRotation * Quaternion.Inverse (rigidbody.rotation); 10 | rigidbody.AddTorque (rotation.x / Time.fixedDeltaTime, rotation.y / Time.fixedDeltaTime, rotation.z / Time.fixedDeltaTime, ForceMode.VelocityChange); 11 | rigidbody.angularVelocity = Vector3.zero; 12 | } 13 | 14 | } 15 | 16 | public class JointTest : MonoBehaviour { 17 | // public HingeJoint hj; 18 | public HingeJoint joint1; 19 | public HingeJoint joint2; 20 | public HingeJoint joint3; 21 | 22 | public bool applyRandomToAll; 23 | // public Vector3 force; 24 | public float target1; 25 | public float target2; 26 | public float target3; 27 | 28 | void Start () { 29 | 30 | } 31 | 32 | void ApplyTarget (HingeJoint joint, float target) { 33 | if (joint != null) { 34 | JointSpring js; 35 | js = joint.spring; 36 | var safeTarget = Mathf.Clamp (target, 0, 1); 37 | var min = joint.limits.min; 38 | var max = joint.limits.max; 39 | var scale = max - min; 40 | var scaledTarget = min + (safeTarget * scale); 41 | js.targetPosition = scaledTarget; 42 | joint.spring = js; 43 | } 44 | } 45 | 46 | void FixedUpdate () { 47 | if (applyRandomToAll) { 48 | ApplyTarget (joint1, Random.value); 49 | ApplyTarget (joint2, Random.value); 50 | ApplyTarget (joint3, Random.value); 51 | } else { 52 | ApplyTarget (joint1, target1); 53 | ApplyTarget (joint2, target2); 54 | ApplyTarget (joint3, target3); 55 | } 56 | } 57 | } 58 | } -------------------------------------------------------------------------------- /Assets/MujocoUnity/Scripts/JointTest.cs.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:4f2ad74463a0161ff25332e8bdab1a850bc8b5ff1f6ad80d41c3c71c5dc63ee2 3 | size 285 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Scripts/MujocoController.cs.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:97ad7dde336523025752564ca53f1268530209b9e25535ddc2389e896316bc74 3 | size 285 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Scripts/MujocoHelper.cs.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:15ba6f4cebd127b24bd06fbaa26377ff59764431d048c5c4ee1e729a803539ad 3 | size 285 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Scripts/MujocoJoint.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace MujocoUnity 4 | { 5 | [System.Serializable] 6 | public class MujocoJoint 7 | { 8 | public Joint Joint; 9 | public string Name; 10 | public string JointName; 11 | public Vector2 CtrlRange; 12 | public bool? CtrlLimited; 13 | public float? Gear; 14 | public ConfigurableJoint TrueBase; 15 | public Transform TrueTarget; 16 | public float MaximumForce; 17 | } 18 | } -------------------------------------------------------------------------------- /Assets/MujocoUnity/Scripts/MujocoJoint.cs.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d15c6fac4a3293c4ec297b711913da3f384f2c130c5c6f72f4ce284c31681b9d 3 | size 285 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Scripts/MujocoSensor.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace MujocoUnity 4 | { 5 | [System.Serializable] 6 | public class MujocoSensor 7 | { 8 | public Collider SiteObject; 9 | public string Name; 10 | public string SiteName; 11 | } 12 | } -------------------------------------------------------------------------------- /Assets/MujocoUnity/Scripts/MujocoSensor.cs.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:0baadd41f244d603da5c1bff235ab627a9ad2d09ee319e25eab235402ddb6f15 3 | size 285 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Scripts/MujocoSpawner.cs.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:4ccb70a2a14c12c137962ada9a5668632e8329930677b0d325ac99db84bf42d1 3 | size 285 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Scripts/ParseMujoco.cs.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:6e492f5dcbdd919c98e8ba55c1ac9ede924d36657b1ef085121520457665d283 3 | size 285 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Scripts/PrimitiveHelper.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEngine; 3 | 4 | namespace MujocoUnity { 5 | public class PrimitiveHelper { 6 | private static Dictionary primitiveMeshes = new Dictionary (); 7 | static Material _defaultMaterial; 8 | 9 | public static GameObject CreatePrimitive (PrimitiveType type, bool withCollider) { 10 | if (withCollider) { return GameObject.CreatePrimitive (type); } 11 | 12 | GameObject gameObject = new GameObject (type.ToString ()); 13 | MeshFilter meshFilter = gameObject.AddComponent (); 14 | meshFilter.sharedMesh = PrimitiveHelper.GetPrimitiveMesh (type); 15 | gameObject.AddComponent (); 16 | 17 | return gameObject; 18 | } 19 | 20 | public static Mesh GetPrimitiveMesh (PrimitiveType type) { 21 | if (!PrimitiveHelper.primitiveMeshes.ContainsKey (type)) { 22 | PrimitiveHelper.CreatePrimitiveMesh (type); 23 | } 24 | 25 | return PrimitiveHelper.primitiveMeshes[type]; 26 | } 27 | 28 | public static Material GetDefaultMaterial() 29 | { 30 | // var mm = new Material(Shader.Find("Diffuse")); 31 | if (_defaultMaterial == null) 32 | _defaultMaterial = new Material(Shader.Find("Diffuse")); 33 | return _defaultMaterial; 34 | } 35 | 36 | private static Mesh CreatePrimitiveMesh (PrimitiveType type) { 37 | GameObject gameObject = GameObject.CreatePrimitive (type); 38 | Mesh mesh = gameObject.GetComponent ().sharedMesh; 39 | GameObject.Destroy (gameObject); 40 | 41 | PrimitiveHelper.primitiveMeshes[type] = mesh; 42 | return mesh; 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /Assets/MujocoUnity/Scripts/PrimitiveHelper.cs.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b4fa0911d79be1bc96e8ba3c1517aff2d13b67f183c46a99171d2341c5e8d654 3 | size 285 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Scripts/ProceduralCapsule.cs: -------------------------------------------------------------------------------- 1 | //------------------------------// 2 | // ProceduralCapsule.cs // 3 | // Written by Jay Kay // 4 | // 2016/05/27 // 5 | //------------------------------// 6 | 7 | 8 | using UnityEngine; 9 | using System.Collections; 10 | 11 | 12 | [RequireComponent( typeof(MeshFilter), typeof(MeshRenderer) )] 13 | public class ProceduralCapsule : MonoBehaviour 14 | { 15 | #if UNITY_EDITOR 16 | [ContextMenu("Generate Procedural Capsule")] 17 | public void GenerateProceduralCapsule() 18 | { 19 | // GenerateMesh(); 20 | } 21 | #endif 22 | 23 | 24 | public float height = 2f; 25 | public float radius = 0.5f; 26 | 27 | public int segments = 24; 28 | 29 | 30 | // void GenerateMesh() 31 | void Start () 32 | { 33 | } 34 | public void CreateMesh() 35 | { 36 | // make segments an even number 37 | if ( segments % 2 != 0 ) 38 | segments ++; 39 | 40 | // extra vertex on the seam 41 | int points = segments + 1; 42 | 43 | // calculate points around a circle 44 | float[] pX = new float[ points ]; 45 | float[] pZ = new float[ points ]; 46 | float[] pY = new float[ points ]; 47 | float[] pR = new float[ points ]; 48 | 49 | float calcH = 0f; 50 | float calcV = 0f; 51 | 52 | for ( int i = 0; i < points; i ++ ) 53 | { 54 | pX[ i ] = Mathf.Sin( calcH * Mathf.Deg2Rad ); 55 | pZ[ i ] = Mathf.Cos( calcH * Mathf.Deg2Rad ); 56 | pY[ i ] = Mathf.Cos( calcV * Mathf.Deg2Rad ); 57 | pR[ i ] = Mathf.Sin( calcV * Mathf.Deg2Rad ); 58 | 59 | calcH += 360f / (float)segments; 60 | calcV += 180f / (float)segments; 61 | } 62 | 63 | 64 | // - Vertices and UVs - 65 | 66 | Vector3[] vertices = new Vector3[ points * ( points + 1 ) ]; 67 | Vector2[] uvs = new Vector2[ vertices.Length ]; 68 | int ind = 0; 69 | 70 | // Y-offset is half the height minus the diameter 71 | // float yOff = ( height - ( radius * 2f ) ) * 0.5f; 72 | float yOff = ( height - ( radius ) ) * 0.5f; 73 | if ( yOff < 0 ) 74 | yOff = 0; 75 | 76 | // uv calculations 77 | float stepX = 1f / ( (float)(points - 1) ); 78 | float uvX, uvY; 79 | 80 | // Top Hemisphere 81 | int top = Mathf.CeilToInt( (float)points * 0.5f ); 82 | 83 | for ( int y = 0; y < top; y ++ ) 84 | { 85 | for ( int x = 0; x < points; x ++ ) 86 | { 87 | vertices[ ind ] = new Vector3( pX[ x ] * pR[ y ], pY[ y ], pZ[ x ] * pR[ y ] ) * radius; 88 | vertices[ ind ].y = yOff + vertices[ ind ].y; 89 | 90 | uvX = 1f - ( stepX * (float)x ); 91 | uvY = ( vertices[ ind ].y + ( height * 0.5f ) ) / height; 92 | uvs[ ind ] = new Vector2( uvX, uvY ); 93 | 94 | ind ++; 95 | } 96 | } 97 | 98 | // Bottom Hemisphere 99 | int btm = Mathf.FloorToInt( (float)points * 0.5f ); 100 | 101 | for ( int y = btm; y < points; y ++ ) 102 | { 103 | for ( int x = 0; x < points; x ++ ) 104 | { 105 | vertices[ ind ] = new Vector3( pX[ x ] * pR[ y ], pY[ y ], pZ[ x ] * pR[ y ] ) * radius; 106 | vertices[ ind ].y = -yOff + vertices[ ind ].y; 107 | 108 | uvX = 1f - ( stepX * (float)x ); 109 | uvY = ( vertices[ ind ].y + ( height * 0.5f ) ) / height; 110 | uvs[ ind ] = new Vector2( uvX, uvY ); 111 | 112 | ind ++; 113 | } 114 | } 115 | 116 | 117 | // - Triangles - 118 | 119 | int[] triangles = new int[ ( segments * (segments + 1) * 2 * 3 ) ]; 120 | 121 | for ( int y = 0, t = 0; y < segments + 1; y ++ ) 122 | { 123 | for ( int x = 0; x < segments; x ++, t += 6 ) 124 | { 125 | triangles[ t + 0 ] = ( (y + 0) * ( segments + 1 ) ) + x + 0; 126 | triangles[ t + 1 ] = ( (y + 1) * ( segments + 1 ) ) + x + 0; 127 | triangles[ t + 2 ] = ( (y + 1) * ( segments + 1 ) ) + x + 1; 128 | 129 | triangles[ t + 3 ] = ( (y + 0) * ( segments + 1 ) ) + x + 1; 130 | triangles[ t + 4 ] = ( (y + 0) * ( segments + 1 ) ) + x + 0; 131 | triangles[ t + 5 ] = ( (y + 1) * ( segments + 1 ) ) + x + 1; 132 | } 133 | } 134 | 135 | 136 | // - Assign Mesh - 137 | 138 | MeshFilter mf = gameObject.GetComponent< MeshFilter >(); 139 | Mesh mesh = mf.sharedMesh; 140 | if ( !mesh ) 141 | { 142 | mesh = new Mesh(); 143 | mf.sharedMesh = mesh; 144 | } 145 | mesh.Clear(); 146 | 147 | mesh.name = "ProceduralCapsule"; 148 | 149 | mesh.vertices = vertices; 150 | mesh.uv = uvs; 151 | mesh.triangles = triangles; 152 | 153 | mesh.RecalculateBounds(); 154 | mesh.RecalculateNormals(); 155 | } 156 | } 157 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Scripts/ProceduralCapsule.cs.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:72089b9571915e858a396b311d9d4189a1fa67534685404457cd7bc26b3141f4 3 | size 285 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Scripts/SensorBehavior.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace MujocoUnity 4 | { 5 | public class SensorBehavior : MonoBehaviour 6 | { 7 | MujocoController _mujocoController; 8 | Collider _collider; 9 | void Start () 10 | { 11 | _mujocoController = GetComponentInParent(); 12 | _collider = GetComponent(); 13 | } 14 | void OnCollisionEnter(Collision other) 15 | { 16 | if (_mujocoController!=null) 17 | _mujocoController.SensorCollisionEnter(_collider, other); 18 | } 19 | void OnCollisionExit(Collision other) 20 | { 21 | if (_mujocoController!=null) 22 | _mujocoController.SensorCollisionExit(_collider, other); 23 | } 24 | 25 | } 26 | } -------------------------------------------------------------------------------- /Assets/MujocoUnity/Scripts/SensorBehavior.cs.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:6ba66bf352eae51752130929d7ec4d8cbe110361dd75d6b740818a5bd4e263e7 3 | size 285 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Textures.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:31f1e917397d3d66f6b12c4c004ab8dc2f9d9301c8f22e3312c3449b09900c96 3 | size 214 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Textures/grid1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sohojoe/MujocoUnity/2350ffcc83f2cd2e19a1f98f57d4b65b3879c25a/Assets/MujocoUnity/Textures/grid1.jpg -------------------------------------------------------------------------------- /Assets/MujocoUnity/Textures/grid1.jpg.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b35f8e26d8b84459ba05578a3e52af2a1382cb380be046f1dd5ff2cae2848fe5 3 | size 1690 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Textures/grid2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sohojoe/MujocoUnity/2350ffcc83f2cd2e19a1f98f57d4b65b3879c25a/Assets/MujocoUnity/Textures/grid2.jpg -------------------------------------------------------------------------------- /Assets/MujocoUnity/Textures/grid2.jpg.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:003f637849719abdc71a22f1414001e5e9d4b1ece85d398b879479fe1df316be 3 | size 1690 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Textures/grid3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sohojoe/MujocoUnity/2350ffcc83f2cd2e19a1f98f57d4b65b3879c25a/Assets/MujocoUnity/Textures/grid3.jpg -------------------------------------------------------------------------------- /Assets/MujocoUnity/Textures/grid3.jpg.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ac4186aa457d3cc3e0489d00671e9d04660c56844efa7eb76888f80d579c8df1 3 | size 1690 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Textures/grid4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sohojoe/MujocoUnity/2350ffcc83f2cd2e19a1f98f57d4b65b3879c25a/Assets/MujocoUnity/Textures/grid4.jpg -------------------------------------------------------------------------------- /Assets/MujocoUnity/Textures/grid4.jpg.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:da59772ad2c14063362ed73af9f0d09fd18dac0dbdb2f2be8600c39460c904ad 3 | size 1690 4 | -------------------------------------------------------------------------------- /Assets/MujocoUnity/Textures/grid6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sohojoe/MujocoUnity/2350ffcc83f2cd2e19a1f98f57d4b65b3879c25a/Assets/MujocoUnity/Textures/grid6.jpg -------------------------------------------------------------------------------- /Assets/MujocoUnity/Textures/grid6.jpg.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:93ecad50d7e69246afbc442d7af676b84fee2f3b7c8b4dc8b85a132ba1ca5949 3 | size 1690 4 | -------------------------------------------------------------------------------- /Assets/Plugins.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c46ac6edab90a3db2135cddf9f2d22df0e487604fd1e6f8ffdc9d4df6789d631 3 | size 214 4 | -------------------------------------------------------------------------------- /Assets/Plugins/Android.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d04084b45e45be3794be1582c8984430062fb19202a68a7e2c3b1a9923ab92ad 3 | size 192 4 | -------------------------------------------------------------------------------- /Assets/Plugins/Android/Java.Interop.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:04d008b4054a4fbfea81e0b53cf23165aacb5d0adb61239fd217b470b55f80a3 3 | size 103936 4 | -------------------------------------------------------------------------------- /Assets/Plugins/Android/Java.Interop.dll.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8fa8cbd6343634800ddc6a8dbe76277bda84665671635225634e7c38c447843c 3 | size 755 4 | -------------------------------------------------------------------------------- /Assets/Plugins/Android/Mono.Android.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:eb367b4003feb5661865b62544923cab6f6836e35d21997ef5dc762c0be508b1 3 | size 22547968 4 | -------------------------------------------------------------------------------- /Assets/Plugins/Android/Mono.Android.dll.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a4d7792dc8335fe78ccdf2eb1a71267bea7485e166531fcf82ab0207d4d0a2ba 3 | size 755 4 | -------------------------------------------------------------------------------- /Assets/Plugins/Android/System.Collections.Concurrent.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8034758de94dca19d080ca8254e7a09699bf31e63d33c1e2920d15e2bff3dc93 3 | size 5120 4 | -------------------------------------------------------------------------------- /Assets/Plugins/Android/System.Collections.Concurrent.dll.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:432d94fc0165175c86ce0d483a31c64b957e73ab95a55e796bc4689332c0d94f 3 | size 755 4 | -------------------------------------------------------------------------------- /Assets/Plugins/Android/System.Collections.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b6d58d4ea2747ee1ff35951e2080df89aa8ff866c38d49415114baee5fb22c9c 3 | size 5120 4 | -------------------------------------------------------------------------------- /Assets/Plugins/Android/System.Collections.dll.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:cc3666509e3e09c48829f5d1e1a71a4e8f9fca0d6059a16cc8f7404c78b3a192 3 | size 755 4 | -------------------------------------------------------------------------------- /Assets/Plugins/Android/System.Diagnostics.Debug.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:aabc8555a3d936cdd2cad6a2641ddd15ecbea4c2f326aa37b4dc09939b5b6d58 3 | size 4608 4 | -------------------------------------------------------------------------------- /Assets/Plugins/Android/System.Diagnostics.Debug.dll.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:413cf56ca41cca8b34c2a78080f90ddbe878d5ea549378d2835d45a3150d8a18 3 | size 755 4 | -------------------------------------------------------------------------------- /Assets/Plugins/Android/System.Linq.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c98119445e3f6a86a9c7cc5cc7ba86addd7852d778a12febcca3d73a5436da8c 3 | size 5120 4 | -------------------------------------------------------------------------------- /Assets/Plugins/Android/System.Linq.dll.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ef3329fc3dde6cdf216d2864e887eecde05e762e11fd7a848c47df8adf0c0ec5 3 | size 755 4 | -------------------------------------------------------------------------------- /Assets/Plugins/Android/System.Reflection.Extensions.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:28adde5c8a7c0c66a95d2059e8b161c6e9f42ad9fd6a2d41676506df032cc026 3 | size 4608 4 | -------------------------------------------------------------------------------- /Assets/Plugins/Android/System.Reflection.Extensions.dll.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:59122cf32b6449a9e1f3f5437365473acc09a0da9a9c84168029086bd97336f4 3 | size 755 4 | -------------------------------------------------------------------------------- /Assets/Plugins/Android/System.Reflection.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:79d790f0f2b93bf0de4177d3fba213e7c657134094e5bffd2e912d77ce671baf 3 | size 5632 4 | -------------------------------------------------------------------------------- /Assets/Plugins/Android/System.Reflection.dll.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:894fec3ab11dd28c59bea9863c7d222453252d5c5d74f050c93eee42b6ccb688 3 | size 755 4 | -------------------------------------------------------------------------------- /Assets/Plugins/Android/System.Resources.ResourceManager.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7f563a3565f6b88b95b482e7433dee7c639cc3357b6491bf77548f27d05777f0 3 | size 4608 4 | -------------------------------------------------------------------------------- /Assets/Plugins/Android/System.Resources.ResourceManager.dll.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:383b2de94473737c85ef073260767bdaa150f1b425f52c6a23eafd425aa399a6 3 | size 755 4 | -------------------------------------------------------------------------------- /Assets/Plugins/Android/System.Runtime.Extensions.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:daaaee3b0f0fc5292413153472ec4b5b171cd55a749bfcfeb577073dce25b090 3 | size 5120 4 | -------------------------------------------------------------------------------- /Assets/Plugins/Android/System.Runtime.Extensions.dll.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ff2ff43fcc7b9447c5c43cb94759258e6534016cdfa0e9e7cdadb04e9291e4d7 3 | size 755 4 | -------------------------------------------------------------------------------- /Assets/Plugins/Android/System.Runtime.InteropServices.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8f13cf5bc9f12808d544e3a18a057cc139009ea58b0ae36516fcb49372b967df 3 | size 7680 4 | -------------------------------------------------------------------------------- /Assets/Plugins/Android/System.Runtime.InteropServices.dll.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:299bbef98dfc362fe32a81d5cc87211dac73af1b3f56672541af4ae5cb08f09b 3 | size 755 4 | -------------------------------------------------------------------------------- /Assets/Plugins/Android/System.Runtime.Numerics.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:e1cc5b04ca04372eedb27ff473498859d8d5022f5b35c67edc2bbc551f7b2e36 3 | size 4608 4 | -------------------------------------------------------------------------------- /Assets/Plugins/Android/System.Runtime.Numerics.dll.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:0348e0ae5b9720f75a1b72000d93a61c6cc4dc2f73423555cbff2794a3b5f9fc 3 | size 755 4 | -------------------------------------------------------------------------------- /Assets/Plugins/Android/System.Runtime.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ea429882754c3dc4c8f5269873499d3f3b49d0c8a6eeeaa49d5dd8aca16d6706 3 | size 13312 4 | -------------------------------------------------------------------------------- /Assets/Plugins/Android/System.Runtime.dll.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:23f6bd3c2292654e872035779a5f5b82b0e792080a79d4735f242850714222a3 3 | size 755 4 | -------------------------------------------------------------------------------- /Assets/Plugins/Android/System.Text.Encoding.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:0ec8efb031948458efbc1587aea4f41835a67f6a3737dfdb618e86b226d98770 3 | size 5120 4 | -------------------------------------------------------------------------------- /Assets/Plugins/Android/System.Text.Encoding.dll.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:6bc1ab9ebdf46eb85e7b70c72611cc906bb9aac7a806cb88d92471c2ed52c1df 3 | size 755 4 | -------------------------------------------------------------------------------- /Assets/Plugins/Android/System.Threading.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:0e52add82750214cf3115b172cbc24beef5c2bf46f0c9fead07fc84424678f82 3 | size 5632 4 | -------------------------------------------------------------------------------- /Assets/Plugins/Android/System.Threading.dll.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:9bbc2d5471ebcb589cbbac03755988530a8b4bf54c3d74adbd3cedae239595ae 3 | size 755 4 | -------------------------------------------------------------------------------- /Assets/Plugins/Android/TensorFlowSharp.Android.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:42c3cead4a394c50ca9be71332411e6d5402531523d033b9cd47020bfe6690df 3 | size 5632 4 | -------------------------------------------------------------------------------- /Assets/Plugins/Android/TensorFlowSharp.Android.dll.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:43281bb218e424e906d06d9659bca25577a64963aa2e684164739a2e9d7f47f7 3 | size 2704 4 | -------------------------------------------------------------------------------- /Assets/Plugins/Android/TensorFlowSharp.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b5b34c42a3639d40f9f7776b573bb3746d75112b5cf9c00f0fb0427c538d8164 3 | size 190464 4 | -------------------------------------------------------------------------------- /Assets/Plugins/Android/TensorFlowSharp.dll.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8c199294c36030b996e2c33797c6a6c2e1d3aba027357e4f3dab8a8920be79a7 3 | size 755 4 | -------------------------------------------------------------------------------- /Assets/Plugins/Android/libs.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:90834868b817effcd1e6cf36948b2ff2c6b86c7294a7e28ce9730cf91800baf4 3 | size 192 4 | -------------------------------------------------------------------------------- /Assets/Plugins/Android/libs/armeabi-v7a.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:fc2c3205b1b3ef7d455caa56a557d7090b2bd1961f6ba582ddb692fb2d7a5d46 3 | size 213 4 | -------------------------------------------------------------------------------- /Assets/Plugins/Android/libs/armeabi-v7a/libtensorflow.so: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:2969e4ca1a02d78e58af6808d2f855acc6e5812c33324cf25a2cf26699431949 3 | size 13998448 4 | -------------------------------------------------------------------------------- /Assets/Plugins/Android/libs/armeabi-v7a/libtensorflow.so.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:dcbf98edbd7ce3a9f565030a9f3665b062b5943e2581a17ef05f49514306ad22 3 | size 590 4 | -------------------------------------------------------------------------------- /Assets/Plugins/Android/libs/x86.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ac16797526fea81ee18fe6bfaa889013db0294a0b0d2e169e1243e799891e7c6 3 | size 172 4 | -------------------------------------------------------------------------------- /Assets/Plugins/Android/libs/x86/libtensorflow.so: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:138e00e4a09011e955f71c0d40cfde726a67d9f7eea094e0304b2f937ede5f37 3 | size 20522736 4 | -------------------------------------------------------------------------------- /Assets/Plugins/Android/libs/x86/libtensorflow.so.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7e06cff05cb5b5a26770935f04aa9fd7a89d7cd0cc276e4c35b9b5f78da66c2a 3 | size 1499 4 | -------------------------------------------------------------------------------- /Assets/Plugins/Computer.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:def11fd3ed5349cccb37f183aa1b5385308a3b8e07ac36ef00df447655c40f9a 3 | size 191 4 | -------------------------------------------------------------------------------- /Assets/Plugins/Computer/TensorFlowSharp.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a3980f03c54ef3dd8fbc80ac17edfc79518878486031d03be20152c09f10f279 3 | size 177152 4 | -------------------------------------------------------------------------------- /Assets/Plugins/Computer/TensorFlowSharp.dll.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b57d3d3f33f3db3e1f8944993805c25d07a80525468e2727abf00202c8628de5 3 | size 2465 4 | -------------------------------------------------------------------------------- /Assets/Plugins/Computer/liblibtensorflow.so: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c164be3ed3e8a9d94c4504a0c4067e76c2c036c0217430b573180c410c7ca5db 3 | size 39370016 4 | -------------------------------------------------------------------------------- /Assets/Plugins/Computer/liblibtensorflow.so.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:faef19551b0d390f63a970ef8ebec2fb6da51b7da678e4808c32bb49508a7d68 3 | size 2561 4 | -------------------------------------------------------------------------------- /Assets/Plugins/Computer/libtensorflow.bundle: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:e26a8aa3589b2ce3a5858b4b865088dbf86dd152e7ba7ceb505d235b88692346 3 | size 89479868 4 | -------------------------------------------------------------------------------- /Assets/Plugins/Computer/libtensorflow.bundle.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:adc0259c8a521e5cdd1199fddac2c5290e9ffeb636411f9f5d89351fb54bd1b8 3 | size 835 4 | -------------------------------------------------------------------------------- /Assets/Plugins/Computer/libtensorflow.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:96bc71c8613d9c4708a1d86236d09f17b7e5b032d23c80f8a697af6e22592ad4 3 | size 43709440 4 | -------------------------------------------------------------------------------- /Assets/Plugins/Computer/libtensorflow.dll.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:dd2d36ae659ca74ece865f91510cdd530ba4052e5cd39ad29096e351cd7c2b3e 3 | size 2529 4 | -------------------------------------------------------------------------------- /Assets/Plugins/JSON.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:4f49059418926dc1caf22f4f01748e9aea78ccab1ff25371623f8250c11f7186 3 | size 192 4 | -------------------------------------------------------------------------------- /Assets/Plugins/JSON/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:4a56ef352f84ad19c1b4486c7c9e64fef9a67c464c62e51bababa79cd2d89551 3 | size 483840 4 | -------------------------------------------------------------------------------- /Assets/Plugins/JSON/Newtonsoft.Json.dll.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:34eed3d48d1fdaf54fce2011966a51fed378f3338758ebdfaf34484a2dc8a0f3 3 | size 486 4 | -------------------------------------------------------------------------------- /Assets/Plugins/System.Numerics.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:16eed243e61682dddf2be072a626de471792a9f0ad67e96f26964a84faeeb8b2 3 | size 137912 4 | -------------------------------------------------------------------------------- /Assets/Plugins/System.Numerics.dll.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:82ee67a048d616821afd8a73b0ec30260b0bc3eb6746eefb74d3ddd678f00ef9 3 | size 652 4 | -------------------------------------------------------------------------------- /Assets/Plugins/System.ValueTuple.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ea0cba14ca502f8e1152af51ebae70f0e051017953ca09aaae90eb890d11d3dd 3 | size 78024 4 | -------------------------------------------------------------------------------- /Assets/Plugins/System.ValueTuple.dll.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:6754875997392abe243090836319497d220cf14d5a3a1c407de4988c21bb8c69 3 | size 652 4 | -------------------------------------------------------------------------------- /Assets/Plugins/iOS.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d3169aa1706e895ea7583e492fe6c78a57d9ae30a70272787fcdc0f64a9a1b91 3 | size 191 4 | -------------------------------------------------------------------------------- /Assets/Plugins/iOS/TensorFlowSharp.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8a1ae8b912aa8f08e303c189fa0b85ccaa76893baf41cafa7a235ee5e94819b3 3 | size 175104 4 | -------------------------------------------------------------------------------- /Assets/Plugins/iOS/TensorFlowSharp.dll.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8f00772e7c6bab5694f41a2bf6e6331a856460e2d90a57797509a684d2b9087d 3 | size 2461 4 | -------------------------------------------------------------------------------- /Assets/Plugins/iOS/libprotobuf-lite.a: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:93567f8946b711cc59631a0afa1e4f0b2365be76e5dbede108b548dee57d692e 3 | size 4240688 4 | -------------------------------------------------------------------------------- /Assets/Plugins/iOS/libprotobuf-lite.a.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:f5faec1f5e9f20e2541c821c69a2a626a272d16647e556ae0e27c4c1c737f454 3 | size 2307 4 | -------------------------------------------------------------------------------- /Assets/Plugins/iOS/libprotobuf.a: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:acae7edcc6a9352825a804fcf7d6b6b35e650b64f63eea3b91f916c5a8925619 3 | size 35404568 4 | -------------------------------------------------------------------------------- /Assets/Plugins/iOS/libprotobuf.a.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8034094529bcc7d916a01bd3284663977ad113fecaaeb9ed574f5f0f7ea66a97 3 | size 2307 4 | -------------------------------------------------------------------------------- /Assets/Plugins/iOS/libtensorflow-core.a: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5f3550711cd4f51772c7a35b46b1940131f0e2fc4ff067bf0660caeabc5da3be 3 | size 482297264 4 | -------------------------------------------------------------------------------- /Assets/Plugins/iOS/libtensorflow-core.a.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:91810fb98a36773c6524099105d8dcd74059c40c440255f4b8d39cab86b98620 3 | size 2320 4 | -------------------------------------------------------------------------------- /Assets/SmoothFollow.cs: -------------------------------------------------------------------------------- 1 | // Smooth Follow from Standard Assets 2 | // Converted to C# because I fucking hate UnityScript and it's inexistant C# interoperability 3 | // If you have C# code and you want to edit SmoothFollow's vars ingame, use this instead. 4 | using System.Collections; 5 | using UnityEngine; 6 | 7 | namespace MujocoUnity { 8 | 9 | public class SmoothFollow : MonoBehaviour { 10 | 11 | // The target we are following 12 | public Transform target; 13 | // The distance in the x-z plane to the target 14 | public float distance = 10.0f; 15 | // the height we want the camera to be above the target 16 | public float height = 5.0f; 17 | public bool clampToFloor; 18 | // How much we 19 | public float heightDamping = 2.0f; 20 | public float rotationDamping = 3.0f; 21 | 22 | // Place the script in the Camera-Control group in the component menu 23 | [AddComponentMenu ("Camera-Control/Smooth Follow")] 24 | 25 | void Start () { } 26 | void LateUpdate () { 27 | // Early out if we don't have a target 28 | if (!target) return; 29 | 30 | // Calculate the current rotation angles 31 | float wantedRotationAngle = target.eulerAngles.y; 32 | float wantedHeight = clampToFloor ? height : target.position.y + height; 33 | 34 | float currentRotationAngle = transform.eulerAngles.y; 35 | float currentHeight = transform.position.y; 36 | 37 | // Damp the rotation around the y-axis 38 | currentRotationAngle = Mathf.LerpAngle (currentRotationAngle, wantedRotationAngle, rotationDamping * Time.deltaTime); 39 | 40 | // Damp the height 41 | currentHeight = Mathf.Lerp (currentHeight, wantedHeight, heightDamping * Time.deltaTime); 42 | 43 | // Convert the angle into a rotation 44 | var currentRotation = Quaternion.Euler (0, currentRotationAngle, 0); 45 | 46 | // Set the position of the camera on the x-z plane to: 47 | // distance meters behind the target 48 | transform.position = target.position; 49 | transform.position -= currentRotation * Vector3.forward * distance; 50 | 51 | // Set the height of the camera 52 | transform.position = new Vector3 (transform.position.x, currentHeight, transform.position.z); 53 | 54 | // Always look at the target 55 | transform.LookAt (target); 56 | } 57 | } 58 | } -------------------------------------------------------------------------------- /Assets/SmoothFollow.cs.meta: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ae4f318105279d3b9445cc10c6d056b6d92e8a0191cc48f643592780081a7602 3 | size 285 4 | -------------------------------------------------------------------------------- /Docs/Images/ant-acktor.gif: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:f8895c1b1c8415e6719408c2c29274b310fa51e3ba7cb80eea35e3207a404060 3 | size 8695772 4 | -------------------------------------------------------------------------------- /Docs/Images/ant-random.gif: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:9ca04d46284e320e4f9031c611815e33b7b46c3dc6f29aba3ffed2536302f16f 3 | size 7346918 4 | -------------------------------------------------------------------------------- /Docs/Images/dm_walker_1m.gif: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:929efad1a9b22e34eb143499252f962f082c8353f57fe3792d960828465466ef 3 | size 8470579 4 | -------------------------------------------------------------------------------- /Docs/Images/dm_walker_3m.gif: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:03039af6a004741f8285c49f78e34e183488b890bbf29fb9806b165268c5cf0c 3 | size 7046246 4 | -------------------------------------------------------------------------------- /Docs/Images/hopper_1.5m_ml_agents_ppo.gif: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:28e2b5b371528f4fbff61572d2598b808fc61a91506c18b2804447fe62b1974e 3 | size 6827977 4 | -------------------------------------------------------------------------------- /Docs/Images/hopper_2m.gif: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:2d8d31ea8d2695746d0f643c24a0eabff90d787ce93f541a593d44f0f7c240eb 3 | size 6748599 4 | -------------------------------------------------------------------------------- /Docs/Images/hopper_300k.gif: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:50dd78455b5ed50b0b7f38ed6eb20f43564131cfe05e29175f6c09feb56a85f9 3 | size 6942676 4 | -------------------------------------------------------------------------------- /Docs/Images/walker_3m_ml_agents_ppo.gif: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:e23c6686dc0c0351ee8a72e296142fac3d06f22e9df2b55e48abd4de3ec421d2 3 | size 6859441 4 | -------------------------------------------------------------------------------- /Docs/ml_agents.md: -------------------------------------------------------------------------------- 1 | # Using with Unity ml-agents 2 | 3 | 4 | ### Setup 5 | 1. Install Unity [ml-agents](https://github.com/Unity-Technologies/ml-agents) (follow their documentation) 6 | 2. Add the MujocoBrain (below) to the train_config.yaml file in the python directory 7 | 3. In Unity, open hopper or walker from MujocoUnity\Assets\MLA-MujocoUnity\Scenes\ 8 | 4. Run to see trained brain 9 | 5. Set brain to external, build and run from your python path (follow unity ml-agents documentation) 10 | 11 | 12 | #### Hyperparameters used for walker_w57-3m / 1.5 and hopper_h2-1.5m 13 | ```yaml 14 | MujocoBrain: 15 | beta: 1.0e-4 16 | epsilon: 0.20 17 | gamma: 0.99 18 | lambd: 0.95 19 | learning_rate: 3.0e-4 20 | num_epoch: 3 21 | time_horizon: 128 22 | summary_freq: 1000 23 | use_recurrent: false 24 | normalize: true 25 | num_layers: 2 26 | hidden_units: 64 27 | batch_size: 2048 28 | buffer_size: 20480 29 | max_steps: 1e6 30 | ``` 31 | 32 | #### Hyperparameters used for walker_w61-xxx and hopper_h21-xxx (will train faster, less stable) 33 | ```yaml 34 | MujocoBrain: 35 | beta: 5.0e-3 36 | epsilon: 0.20 37 | gamma: 0.99 38 | lambd: 0.95 39 | learning_rate: 1.0e-3 40 | num_epoch: 3 41 | time_horizon: 128 42 | summary_freq: 1000 43 | use_recurrent: false 44 | normalize: true 45 | num_layers: 2 46 | hidden_units: 64 47 | batch_size: 2048 48 | buffer_size: 10240 49 | max_steps: 3e5 50 | ``` 51 | 52 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | # MujocoUnity 2 | 3 | The MIT License 4 | 5 | Copyright (c) 2018 Joe Booth (http://joebooth.com) 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | 25 | 26 | # Mujoco models 27 | 28 | This work is derived from [MuJuCo models](http://www.mujoco.org/forum/index.php?resources/) used under the following license: 29 | 30 | ``` 31 | This file is part of MuJoCo. 32 | Copyright 2009-2015 Roboti LLC. 33 | Mujoco :: Advanced physics simulation engine 34 | Source : www.roboti.us 35 | Version : 1.31 36 | Released : 23Apr16 37 | Author :: Vikash Kumar 38 | Contacts : kumar@roboti.us 39 | ``` 40 | -------------------------------------------------------------------------------- /ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | m_Volume: 1 7 | Rolloff Scale: 1 8 | Doppler Factor: 1 9 | Default Speaker Mode: 2 10 | m_SampleRate: 0 11 | m_DSPBufferSize: 0 12 | m_VirtualVoiceCount: 512 13 | m_RealVoiceCount: 32 14 | m_SpatializerPlugin: 15 | m_AmbisonicDecoderPlugin: 16 | m_DisableAudio: 0 17 | m_VirtualizeEffects: 1 18 | -------------------------------------------------------------------------------- /ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 7 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_SleepThreshold: 0.005 11 | m_DefaultContactOffset: 0.01 12 | m_DefaultSolverIterations: 15 13 | m_DefaultSolverVelocityIterations: 1 14 | m_QueriesHitBackfaces: 0 15 | m_QueriesHitTriggers: 1 16 | m_EnableAdaptiveForce: 0 17 | m_ClothInterCollisionDistance: 0 18 | m_ClothInterCollisionStiffness: 0 19 | m_ContactsGeneration: 1 20 | m_LayerCollisionMatrix: fffffffffffefffffffffffffffffffffffefffffffeffffffffffffffffffffcdfeffffffffffffffe7fffffffbfffffffbffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 21 | m_AutoSimulation: 1 22 | m_AutoSyncTransforms: 1 23 | m_ClothInterCollisionSettingsToggle: 0 24 | m_ContactPairsMode: 0 25 | m_BroadphaseType: 0 26 | m_WorldBounds: 27 | m_Center: {x: 0, y: 0, z: 0} 28 | m_Extent: {x: 250, y: 250, z: 250} 29 | m_WorldSubdivisions: 8 30 | -------------------------------------------------------------------------------- /ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: [] 8 | -------------------------------------------------------------------------------- /ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 7 7 | m_ExternalVersionControlSupport: Visible Meta Files 8 | m_SerializationMode: 2 9 | m_LineEndingsForNewScripts: 1 10 | m_DefaultBehaviorMode: 0 11 | m_SpritePackerMode: 0 12 | m_SpritePackerPaddingPower: 1 13 | m_EtcTextureCompressorBehavior: 1 14 | m_EtcTextureFastCompressor: 1 15 | m_EtcTextureNormalCompressor: 2 16 | m_EtcTextureBestCompressor: 4 17 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp 18 | m_ProjectGenerationRootNamespace: 19 | m_UserGeneratedProjectSuffix: 20 | m_CollabEditorSettings: 21 | inProgressEnabled: 1 22 | -------------------------------------------------------------------------------- /ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 12 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_AlwaysIncludedShaders: 32 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 38 | - {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0} 39 | - {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0} 40 | m_PreloadedShaders: [] 41 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 42 | type: 0} 43 | m_CustomRenderPipeline: {fileID: 0} 44 | m_TransparencySortMode: 0 45 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 46 | m_DefaultRenderingPath: 1 47 | m_DefaultMobileRenderingPath: 1 48 | m_TierSettings: [] 49 | m_LightmapStripping: 0 50 | m_FogStripping: 0 51 | m_InstancingStripping: 0 52 | m_LightmapKeepPlain: 1 53 | m_LightmapKeepDirCombined: 1 54 | m_LightmapKeepDynamicPlain: 1 55 | m_LightmapKeepDynamicDirCombined: 1 56 | m_LightmapKeepShadowMask: 1 57 | m_LightmapKeepSubtractive: 1 58 | m_FogKeepLinear: 1 59 | m_FogKeepExp: 1 60 | m_FogKeepExp2: 1 61 | m_AlbedoSwatchInfos: [] 62 | m_LightsUseLinearIntensity: 0 63 | m_LightsUseColorTemperature: 0 64 | -------------------------------------------------------------------------------- /ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshProjectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | m_LastAgentTypeID: -887442657 73 | m_Settings: 74 | - serializedVersion: 2 75 | agentTypeID: 0 76 | agentRadius: 0.5 77 | agentHeight: 2 78 | agentSlope: 45 79 | agentClimb: 0.75 80 | ledgeDropHeight: 0 81 | maxJumpAcrossDistance: 0 82 | minRegionArea: 2 83 | manualCellSize: 0 84 | cellSize: 0.16666667 85 | manualTileSize: 0 86 | tileSize: 256 87 | accuratePlacement: 0 88 | debug: 89 | m_Flags: 0 90 | m_SettingNames: 91 | - Humanoid 92 | -------------------------------------------------------------------------------- /ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!149 &1 4 | NetworkManager: 5 | m_ObjectHideFlags: 0 6 | m_DebugLevel: 0 7 | m_Sendrate: 15 8 | m_AssetToPrefab: {} 9 | -------------------------------------------------------------------------------- /ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 3 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_AutoSimulation: 1 23 | m_QueriesHitTriggers: 1 24 | m_QueriesStartInColliders: 1 25 | m_ChangeStopsCallbacks: 0 26 | m_CallbacksOnDisable: 1 27 | m_AutoSyncTransforms: 1 28 | m_AlwaysShowColliders: 0 29 | m_ShowColliderSleep: 1 30 | m_ShowColliderContacts: 0 31 | m_ShowColliderAABB: 0 32 | m_ContactArrowScale: 0.2 33 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 34 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 35 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 36 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 37 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 38 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2017.3.1f1 2 | -------------------------------------------------------------------------------- /ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 14 | - 15 | - 16 | - 17 | - 18 | - mujoco_a+b 19 | - mujoco_a 20 | - mujoco_b 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.02 7 | Maximum Allowed Timestep: 0.33333334 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | m_Enabled: 0 7 | m_TestMode: 0 8 | m_TestEventUrl: 9 | m_TestConfigUrl: 10 | m_TestInitMode: 0 11 | CrashReportingSettings: 12 | m_EventUrl: https://perf-events.cloud.unity3d.com/api/events/crashes 13 | m_NativeEventUrl: https://perf-events.cloud.unity3d.com/symbolicate 14 | m_Enabled: 0 15 | m_CaptureEditorExceptions: 1 16 | UnityPurchasingSettings: 17 | m_Enabled: 0 18 | m_TestMode: 0 19 | UnityAnalyticsSettings: 20 | m_Enabled: 1 21 | m_InitializeOnStartup: 1 22 | m_TestMode: 0 23 | m_TestEventUrl: 24 | m_TestConfigUrl: 25 | UnityAdsSettings: 26 | m_Enabled: 0 27 | m_InitializeOnStartup: 1 28 | m_TestMode: 0 29 | m_IosGameId: 30 | m_AndroidGameId: 31 | m_GameIds: {} 32 | m_GameId: 33 | PerformanceReportingSettings: 34 | m_Enabled: 0 35 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MujocoUnity 2 | 3 | ## Reproducing MuJoCo benchmarks in a modern, commercial game /physics engine (Unity + PhysX). 4 | 5 | Presented March 19th, 2018 at the AI Summit - Game Developer Conference 2018 - http://schedule.gdconf.com/session/beyond-bots-making-machine-learning-accessible-and-useful/856147 6 | 7 | --- 8 | ## IMPORTANT: Active development has moved to [Marathon-envs](https://github.com/Unity-Technologies/marathon-envs) ## 9 | * This project is now a add-on for Unity ML-Agents Toolkit and is still being maintained and supported. See the new repro here - https://github.com/Unity-Technologies/marathon-envs 10 | 11 | ![MujocoUnity](https://github.com/Sohojoe/ml-agents/blob/develop-feature-mujoco-unity/docs/images/MujocoUnityBanner.gif) 12 | 13 | ---- 14 | Legacy readme... 15 | 16 | ### v0.2 17 | supports Unity ml-agents ([instructions](Docs/ml_agents.md)) 18 | 19 | ### Trained with ml-agents PPO: 20 | 21 | **unity_oai_hopper.xml** 22 | 23 | ![Mujoco Hopper 1.5m](Docs/Images/hopper_1.5m_ml_agents_ppo.gif) 1.5m steps 24 | 25 | **unity_dm_walker.xml** 26 | 27 | ![Mujoco Hopper 1.5m](Docs/Images/walker_3m_ml_agents_ppo.gif) 3m steps 28 | 29 | 30 | ### Trained with Baselines DDPG: 31 | 32 | **unity_oai_hopper.xml** 33 | 34 | ![Mujoco Hopper 300k](https://github.com/Sohojoe/MujocoUnity/blob/master/Docs/Images/hopper_300k.gif) 300k steps ![Mujoco Hopper 300k](https://github.com/Sohojoe/MujocoUnity/blob/master/Docs/Images/hopper_2m.gif) 2m steps 35 | 36 | **unity_dm_walker.xml** 37 | 38 | ![Mujoco Hopper 300k](https://github.com/Sohojoe/MujocoUnity/blob/master/Docs/Images/dm_walker_1m.gif) 1m steps ![Mujoco Hopper 300k](https://github.com/Sohojoe/MujocoUnity/blob/master/Docs/Images/dm_walker_3m.gif) 3m steps 39 | 40 | 41 | Note: to reproduce you'll need to figure out how to patch OpenAI baselines with Unity. 42 | 43 | ### Known Issues: 44 | 45 | * oai_humanoid - is broken. Configurable joint needs updating to support multi-directional joints 46 | * oai_half_cheetah - need to implement geom axis-angle 47 | * dm_xxxx - need to implement class= 48 | * phyx is not tuned properly 49 | * Capsules are slightly too long - NOTE: this can cause collision issues whereby the leg may slightly poke the a foot and trigger collisions 50 | 51 | 52 | ## From earlier version: 53 | 54 | 55 | **Ant** - Random ![Mujoco Ant random policy](https://github.com/Sohojoe/MujocoUnity/blob/master/Docs/Images/ant-random.gif) Ant - trained with ACKTR ![Mujoco Ant trainged with acktr](https://github.com/Sohojoe/MujocoUnity/blob/master/Docs/Images/ant-acktor.gif) 56 | 57 | -------------------------------------------------------------------------------- /UnityPackageManager/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | } 4 | } 5 | --------------------------------------------------------------------------------