diff --git a/ArmRobot/Assets/Materials/AlphabetCubeMaterial.mat b/ArmRobot/Assets/Materials/AlphabetCubeMaterial.mat new file mode 100644 index 00000000..9dceea8f --- /dev/null +++ b/ArmRobot/Assets/Materials/AlphabetCubeMaterial.mat @@ -0,0 +1,78 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AlphabetCubeMaterial + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 452601e9fe9ce416a839845ba14929ee, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 0.7607844, g: 0.7607844, b: 0.7607844, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + m_BuildTextureStacks: [] diff --git a/ArmRobot/Assets/Materials/AlphabetCubeMaterial.mat.meta b/ArmRobot/Assets/Materials/AlphabetCubeMaterial.mat.meta new file mode 100644 index 00000000..b052cab0 --- /dev/null +++ b/ArmRobot/Assets/Materials/AlphabetCubeMaterial.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 66bcd89a9bb8148f8beb3c24e3ac3cee +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/ArmRobot/Assets/Materials/NonsymmetricCubeTexture.png b/ArmRobot/Assets/Materials/NonsymmetricCubeTexture.png new file mode 100644 index 00000000..85e114b4 Binary files /dev/null and b/ArmRobot/Assets/Materials/NonsymmetricCubeTexture.png differ diff --git a/ArmRobot/Assets/Materials/NonsymmetricCubeTexture.png.meta b/ArmRobot/Assets/Materials/NonsymmetricCubeTexture.png.meta new file mode 100644 index 00000000..d1295afc --- /dev/null +++ b/ArmRobot/Assets/Materials/NonsymmetricCubeTexture.png.meta @@ -0,0 +1,94 @@ +fileFormatVersion: 2 +guid: 452601e9fe9ce416a839845ba14929ee +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/ArmRobot/Assets/Models.meta b/ArmRobot/Assets/Models.meta new file mode 100644 index 00000000..a9713899 --- /dev/null +++ b/ArmRobot/Assets/Models.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3ae04a772a441465f8329fdee8653011 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/ArmRobot/Assets/Scenes/ArticulationRobot.unity b/ArmRobot/Assets/Scenes/ArticulationRobot.unity index f7814787..eb798e10 100644 --- a/ArmRobot/Assets/Scenes/ArticulationRobot.unity +++ b/ArmRobot/Assets/Scenes/ArticulationRobot.unity @@ -129,6 +129,167 @@ Transform: type: 3} m_PrefabInstance: {fileID: 1783092415} m_PrefabAsset: {fileID: 0} +--- !u!1001 &174459725 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: -8679921383154817045, guid: 3e59c8daa92034cdc906b0103d57c584, + type: 3} + propertyPath: m_LocalPosition.x + value: 0.2 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 3e59c8daa92034cdc906b0103d57c584, + type: 3} + propertyPath: m_LocalPosition.y + value: 0.815 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 3e59c8daa92034cdc906b0103d57c584, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 3e59c8daa92034cdc906b0103d57c584, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 3e59c8daa92034cdc906b0103d57c584, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 3e59c8daa92034cdc906b0103d57c584, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 3e59c8daa92034cdc906b0103d57c584, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 3e59c8daa92034cdc906b0103d57c584, + type: 3} + propertyPath: m_RootOrder + value: 5 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 3e59c8daa92034cdc906b0103d57c584, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 3e59c8daa92034cdc906b0103d57c584, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 3e59c8daa92034cdc906b0103d57c584, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 3e59c8daa92034cdc906b0103d57c584, + type: 3} + propertyPath: m_LocalScale.x + value: 5 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 3e59c8daa92034cdc906b0103d57c584, + type: 3} + propertyPath: m_LocalScale.y + value: 5 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 3e59c8daa92034cdc906b0103d57c584, + type: 3} + propertyPath: m_LocalScale.z + value: 5 + objectReference: {fileID: 0} + - target: {fileID: -7511558181221131132, guid: 3e59c8daa92034cdc906b0103d57c584, + type: 3} + propertyPath: m_Materials.Array.data[0] + value: + objectReference: {fileID: 2100000, guid: 66bcd89a9bb8148f8beb3c24e3ac3cee, type: 2} + - target: {fileID: 919132149155446097, guid: 3e59c8daa92034cdc906b0103d57c584, + type: 3} + propertyPath: m_Name + value: Cube + objectReference: {fileID: 0} + - target: {fileID: 919132149155446097, guid: 3e59c8daa92034cdc906b0103d57c584, + type: 3} + propertyPath: m_TagString + value: Cube + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 3e59c8daa92034cdc906b0103d57c584, type: 3} +--- !u!1 &174459726 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 919132149155446097, guid: 3e59c8daa92034cdc906b0103d57c584, + type: 3} + m_PrefabInstance: {fileID: 174459725} + m_PrefabAsset: {fileID: 0} +--- !u!54 &174459727 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 174459726} + serializedVersion: 2 + m_Mass: 1 + m_Drag: 0 + m_AngularDrag: 0 + m_UseGravity: 1 + m_IsKinematic: 1 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!65 &174459728 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 174459726} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 0.02, y: 0.019999998, z: 0.019999998} + m_Center: {x: 0, y: 0, z: 0} +--- !u!114 &174459730 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 174459726} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee5bbc0d497a34c1b8d8a3ce2896749d, type: 3} + m_Name: + m_EditorClassIdentifier: + hueMin: 0 + hueMax: 1 + saturationMin: 1 + saturationMax: 1 + valueMin: 0.6 + valueMax: 1 +--- !u!114 &174459731 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 174459726} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 12c87eca3d37f49ce94654534ab6996c, type: 3} + m_Name: + m_EditorClassIdentifier: + robotMinReach: 0.2 + robotMaxReach: 0.5 --- !u!1 &385129266 GameObject: m_ObjectHideFlags: 0 @@ -175,7 +336,7 @@ ArticulationBody: m_GameObject: {fileID: 385129266} m_Enabled: 1 m_Mass: 1 - m_ParentAnchorPosition: {x: 0, y: 0.06584515, z: -0.0643453} + m_ParentAnchorPosition: {x: 0, y: 0.06584513, z: -0.0643453} m_ParentAnchorRotation: {x: 0.49999997, y: -0.49999997, z: -0.49999997, w: -0.49999997} m_AnchorPosition: {x: 0, y: 0, z: 0} m_AnchorRotation: {x: 0.49999997, y: -0.49999997, z: -0.49999997, w: -0.49999997} @@ -361,7 +522,7 @@ ArticulationBody: m_GameObject: {fileID: 622386702} m_Enabled: 1 m_Mass: 1 - m_ParentAnchorPosition: {x: 0, y: 0.037492096, z: -0.038539764} + m_ParentAnchorPosition: {x: 0, y: 0.037492037, z: -0.038539764} m_ParentAnchorRotation: {x: 0, y: 0, z: 0.70710677, w: 0.70710677} m_AnchorPosition: {x: 0, y: 0, z: 0} m_AnchorRotation: {x: 0, y: 0, z: 0.70710677, w: 0.70710677} @@ -549,7 +710,7 @@ MonoBehaviour: m_EditorClassIdentifier: _camera: {fileID: 1207423634} maxSamples: 10 - cube: {fileID: 1383161865} + cube: {fileID: 174459726} fileCounter: 0 --- !u!114 &886963047 MonoBehaviour: @@ -563,11 +724,10 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c5d07dd5795be4425aa7c56e4d8da379, type: 3} m_Name: m_EditorClassIdentifier: - cube: {fileID: 1383161865} + cube: {fileID: 174459726} robot: {fileID: 1442213767} table: {fileID: 1064094162} DomainRandomizationObject: {fileID: 1054542686} - index: 0 --- !u!114 &886963048 MonoBehaviour: m_ObjectHideFlags: 0 @@ -580,7 +740,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 2ba02a69f809d49a48b8a6ebaaff6e18, type: 3} m_Name: m_EditorClassIdentifier: - cube: {fileID: 1383161865} + cube: {fileID: 174459726} _camera: {fileID: 1207423634} --- !u!1 &948141744 GameObject: @@ -628,7 +788,7 @@ ArticulationBody: m_GameObject: {fileID: 948141744} m_Enabled: 1 m_Mass: 1 - m_ParentAnchorPosition: {x: -0.000031095744, y: 0.24224612, z: -0.005073361} + m_ParentAnchorPosition: {x: -0.000031095744, y: 0.24224609, z: -0.0050733536} m_ParentAnchorRotation: {x: -0.49999997, y: 0.49999997, z: -0.49999997, w: -0.49999997} m_AnchorPosition: {x: 0, y: 0, z: 0} m_AnchorRotation: {x: -0.49999997, y: 0.49999997, z: -0.49999997, w: -0.49999997} @@ -896,7 +1056,7 @@ ArticulationBody: m_GameObject: {fileID: 995377197} m_Enabled: 1 m_Mass: 1 - m_ParentAnchorPosition: {x: 0, y: 0.045000076, z: -0.04700001} + m_ParentAnchorPosition: {x: 0, y: 0.045000076, z: -0.046999995} m_ParentAnchorRotation: {x: -0.5, y: 0.5, z: 0.5, w: 0.5} m_AnchorPosition: {x: 0, y: 0, z: 0} m_AnchorRotation: {x: 0, y: 0, z: 0.70710677, w: 0.70710677} @@ -1013,13 +1173,16 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: table: {fileID: 1064094162} - cube: {fileID: 1383161865} + cube: {fileID: 174459726} robot: {fileID: 1442213767} - scaleObject: {x: 7, y: 7, z: 7} - nbMaxDistractorObjects: 2 + _camera: {fileID: 1207423632} + directionalLight: {fileID: 954335180} + maxdistanceToTheCenter: 0 + scaleObject: {x: 0.1, y: 0.1, z: 0.1} + nbMaxDistractorObjects: 5 rotationAngle: 10 - yAltitudeTable: 57 - minimumDistanceWithoutObjects: 0.35 + yAltitudeTable: 0.815 + minimumDistanceWithoutObjects: 0.035 nbMaxLights: 3 --- !u!4 &1054542688 Transform: @@ -1124,17 +1287,17 @@ PrefabInstance: - target: {fileID: -4216859302048453862, guid: 3fba682e7b5a0444eb5e51e6fc772147, type: 3} propertyPath: m_LocalScale.x - value: 0.7 + value: 0.01 objectReference: {fileID: 0} - target: {fileID: -4216859302048453862, guid: 3fba682e7b5a0444eb5e51e6fc772147, type: 3} propertyPath: m_LocalScale.y - value: 0.7 + value: 0.01 objectReference: {fileID: 0} - target: {fileID: -4216859302048453862, guid: 3fba682e7b5a0444eb5e51e6fc772147, type: 3} propertyPath: m_LocalScale.z - value: 0.7 + value: 0.01 objectReference: {fileID: 0} - target: {fileID: -927199367670048503, guid: 3fba682e7b5a0444eb5e51e6fc772147, type: 3} @@ -1413,7 +1576,7 @@ ArticulationBody: m_GameObject: {fileID: 1207038283} m_Enabled: 1 m_Mass: 1 - m_ParentAnchorPosition: {x: 0, y: 0.044682086, z: -0.04507106} + m_ParentAnchorPosition: {x: 0, y: 0.044682026, z: -0.045071054} m_ParentAnchorRotation: {x: -0.49999997, y: 0.49999997, z: -0.49999997, w: -0.49999997} m_AnchorPosition: {x: 0, y: 0, z: 0} m_AnchorRotation: {x: -0.49999997, y: 0.49999997, z: -0.49999997, w: -0.49999997} @@ -1652,173 +1815,12 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1207423632} m_LocalRotation: {x: 0.13052616, y: 0, z: 0, w: 0.9914449} - m_LocalPosition: {x: 1.7, y: 98, z: -104.8} + m_LocalPosition: {x: 0.052, y: 1.71, z: -1.91} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} m_RootOrder: 8 m_LocalEulerAnglesHint: {x: 15, y: 0, z: 0} ---- !u!1 &1383161865 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1383161871} - - component: {fileID: 1383161870} - - component: {fileID: 1383161869} - - component: {fileID: 1383161868} - - component: {fileID: 1383161867} - - component: {fileID: 1383161866} - - component: {fileID: 1383161872} - - component: {fileID: 1383161874} - m_Layer: 0 - m_Name: Cube - m_TagString: Cube - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &1383161866 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1383161865} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: ee5bbc0d497a34c1b8d8a3ce2896749d, type: 3} - m_Name: - m_EditorClassIdentifier: - hueMin: 0 - hueMax: 1 - saturationMin: 1 - saturationMax: 1 - valueMin: 0.5 - valueMax: 1 ---- !u!54 &1383161867 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1383161865} - serializedVersion: 2 - m_Mass: 0.1 - m_Drag: 0 - m_AngularDrag: 0 - m_UseGravity: 1 - m_IsKinematic: 0 - m_Interpolate: 0 - m_Constraints: 0 - m_CollisionDetection: 0 ---- !u!65 &1383161868 -BoxCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1383161865} - m_Material: {fileID: 13400000, guid: 3d0bf61d361114f57882dd46e8074bae, type: 2} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Size: {x: 1, y: 1, z: 1} - m_Center: {x: 0, y: 0, z: 0} ---- !u!23 &1383161869 -MeshRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1383161865} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_DynamicOccludee: 1 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_RayTracingMode: 2 - m_RayTraceProcedural: 0 - m_RenderingLayerMask: 1 - m_RendererPriority: 0 - m_Materials: - - {fileID: 2100000, guid: 351a807c5fbdd4ff19fde1c2c5449e8c, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_ReceiveGI: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 1 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 - m_AdditionalVertexStreams: {fileID: 0} ---- !u!33 &1383161870 -MeshFilter: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1383161865} - m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} ---- !u!4 &1383161871 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1383161865} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 40, y: 57, z: -20} - m_LocalScale: {x: 7, y: 7, z: 7} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 5 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &1383161872 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1383161865} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 12c87eca3d37f49ce94654534ab6996c, type: 3} - m_Name: - m_EditorClassIdentifier: - robotMinReach: 20 - robotMaxReach: 50 - yAltitudeTable: 57 ---- !u!114 &1383161874 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1383161865} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 10a84cf46a89e4e3ab47779e4de8d31e, type: 3} - m_Name: - m_EditorClassIdentifier: - width: 10 --- !u!1 &1442213767 GameObject: m_ObjectHideFlags: 0 @@ -2005,8 +2007,8 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1442213767} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 52, z: 0} - m_LocalScale: {x: 70, y: 70, z: 70} + m_LocalPosition: {x: 0, y: 0.77, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 1089875217} m_Father: {fileID: 0} @@ -2058,7 +2060,7 @@ ArticulationBody: m_GameObject: {fileID: 1449517471} m_Enabled: 1 m_Mass: 1 - m_ParentAnchorPosition: {x: -0.5230001, y: 11.505005, z: -1.3913959} + m_ParentAnchorPosition: {x: -0.52300006, y: 11.505002, z: -1.3914019} m_ParentAnchorRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} m_AnchorPosition: {x: 0, y: 0, z: 0} m_AnchorRotation: {x: 0, y: 0, z: 0.70710677, w: 0.70710677} @@ -2261,7 +2263,7 @@ Transform: m_GameObject: {fileID: 1709081025} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 20, y: 1, z: 20} + m_LocalScale: {x: 0.2, y: 0.01, z: 0.2} m_Children: [] m_Father: {fileID: 0} m_RootOrder: 2 @@ -2363,7 +2365,7 @@ ArticulationBody: m_GameObject: {fileID: 1838417712} m_Enabled: 1 m_Mass: 1 - m_ParentAnchorPosition: {x: 0.5230001, y: 11.505004, z: 1.3914145} + m_ParentAnchorPosition: {x: 0.52300006, y: 11.505001, z: 1.3913966} m_ParentAnchorRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} m_AnchorPosition: {x: 0, y: 0, z: 0} m_AnchorRotation: {x: 0, y: 0, z: 0.70710677, w: 0.70710677} @@ -2485,7 +2487,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2114954002} m_LocalRotation: {x: 0.13052616, y: 0, z: 0, w: 0.9914449} - m_LocalPosition: {x: 1.7, y: 98, z: -104.8} + m_LocalPosition: {x: 0.052, y: 1.601, z: -1.507} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} @@ -2537,7 +2539,7 @@ ArticulationBody: m_GameObject: {fileID: 2127710631} m_Enabled: 1 m_Mass: 1 - m_ParentAnchorPosition: {x: 0.000031095744, y: 0.1733774, z: 0.042625256} + m_ParentAnchorPosition: {x: 0.000031095744, y: 0.1733774, z: 0.04262526} m_ParentAnchorRotation: {x: 0, y: 0, z: 0.70710677, w: 0.70710677} m_AnchorPosition: {x: 0, y: 0, z: 0} m_AnchorRotation: {x: 0, y: 0, z: 0.70710677, w: 0.70710677} diff --git a/ArmRobot/Assets/Scripts/DomainRandomization.cs b/ArmRobot/Assets/Scripts/DomainRandomization.cs index 4f8f228c..cd7c5f4c 100644 --- a/ArmRobot/Assets/Scripts/DomainRandomization.cs +++ b/ArmRobot/Assets/Scripts/DomainRandomization.cs @@ -7,34 +7,22 @@ public class DomainRandomization : MonoBehaviour public GameObject table; public GameObject cube; public GameObject robot; - float robotMinReach; - float robotMaxReach; - - - - public Vector3 scaleObject = new Vector3 (7f, 7f, 7f); - - public int nbMaxDistractorObjects = 8; + public GameObject _camera; + public GameObject directionalLight; + public float maxdistanceToTheCenter = 0.35f; + public Vector3 scaleObject = new Vector3 (0.1f, 0.1f, 0.1f); + public int nbMaxDistractorObjects = 7; public float rotationAngle = 10.0f; - - public float yAltitudeTable = 57f; + public float yAltitudeTable = 0.815f; public float minimumDistanceWithoutObjects = 0.35f; - public int nbMaxLights = 3; void Start() { cube.tag = "Cube"; - - RandomizerPositionObject tablePositionRandomizerCube = cube.GetComponent(); - robotMinReach = tablePositionRandomizerCube.robotMinReach; - robotMaxReach = tablePositionRandomizerCube.robotMaxReach; - } - - public List InitializationObjects(){ List listOfObjectsTable = CreateRandomListDistractors(); @@ -44,8 +32,7 @@ public List InitializationObjects(){ return listOfObjectsTable; } - - public void DomainRandomizationScene(int index) + public void DomainRandomizationScene() { // we create a list that will contains all the objects we have already moved List listOfAlreadyMovedObjects = new List(); @@ -53,21 +40,19 @@ public void DomainRandomizationScene(int index) // Then we start moving the objects and changing the color // move cube RandomizerPositionObject tablePositionRandomizerCube = cube.GetComponent(); - tablePositionRandomizerCube.Move(listOfAlreadyMovedObjects); - + tablePositionRandomizerCube.Move(listOfAlreadyMovedObjects, yAltitudeTable); // then we change its pattern CheckerBoard checkerBoardCube = cube.GetComponent(); - checkerBoardCube.CheckerBoardChange(); + //checkerBoardCube.CheckerBoardChange(); // then we change its color - ColorRandomizer colorRandomizerCube = cube.GetComponent(); - colorRandomizerCube.ChangeColor(); + //colorRandomizerCube.ChangeColor(); listOfAlreadyMovedObjects.Add(cube); - + // We desactive the older objects DesactiveObjects(); @@ -80,11 +65,11 @@ public void DomainRandomizationScene(int index) // we iterate through the listOfObjects and move them one by one foreach (GameObject gameobject in listOfObjectsTable) { RandomizerPositionObject tablePositionRandomizerObject = gameobject.GetComponent(); - tablePositionRandomizerObject.Move(listOfAlreadyMovedObjects); + tablePositionRandomizerObject.Move(listOfAlreadyMovedObjects, yAltitudeTable); listOfAlreadyMovedObjects.Add(gameobject); // we add the gameobject to the already moved objects } - + // move robot MoveRobot(rotationAngle); @@ -95,11 +80,8 @@ public void DomainRandomizationScene(int index) colorRandomizerChildRobot.ChangeColor(); } - - // move the camera - GameObject camera = GameObject.Find("VisionCamera"); - RandomizerPositionCamera randomizedPositionCamera = camera.GetComponent(); + RandomizerPositionCamera randomizedPositionCamera = _camera.GetComponent(); randomizedPositionCamera.Move(); @@ -108,8 +90,7 @@ public void DomainRandomizationScene(int index) colorRandomizerTable.ChangeColor(); // change the Directionalight - GameObject directionLight = GameObject.Find("DirectionalLight"); - DirectionalLightRandomization directionalLightRandomizer = directionLight.GetComponent(); + DirectionalLightRandomization directionalLightRandomizer = directionalLight.GetComponent(); directionalLightRandomizer.UpdateLight(); } @@ -128,23 +109,48 @@ List CreateRandomListDistractors() { // this function is designed to create a list of a random number of cylinders and instantiate them float minimumDistanceBetweenObjects = scaleObject[0] + minimumDistanceWithoutObjects; - int randomNumberDistractors = 1 + Random.Range(1, nbMaxDistractorObjects); + + int randomNumberDistractors = Random.Range(0, nbMaxDistractorObjects); List listOfDistractors = new List(); for (var i = 0; i < randomNumberDistractors; i++) { int typeObject = Random.Range(0,2); GameObject distractor; - if (typeObject == 0){ - - Vector3 position = new Vector3(robotMaxReach - 2*minimumDistanceWithoutObjects, - yAltitudeTable, robotMaxReach - 2*minimumDistanceWithoutObjects - minimumDistanceBetweenObjects*i); - distractor = CreateCylinder(position, scaleObject); + if (i <= 2) { + Vector3 position = new Vector3(maxdistanceToTheCenter - 2*minimumDistanceWithoutObjects, + yAltitudeTable, maxdistanceToTheCenter - minimumDistanceWithoutObjects - minimumDistanceBetweenObjects*i); + if (typeObject == 0){ + distractor = CreateCylinder(position, scaleObject); + } + else { + distractor = CreateShere(position, scaleObject); + } + listOfDistractors.Add(distractor); } - else { - Vector3 position = new Vector3(robotMaxReach - 2*minimumDistanceWithoutObjects - minimumDistanceBetweenObjects, - yAltitudeTable, robotMaxReach - 2*minimumDistanceWithoutObjects - minimumDistanceBetweenObjects*i); - distractor = CreateShere(position, scaleObject); + if ((2 < i) && (i <=5)) { + Vector3 position = new Vector3(maxdistanceToTheCenter - 2*minimumDistanceWithoutObjects - minimumDistanceBetweenObjects, + yAltitudeTable, maxdistanceToTheCenter - minimumDistanceWithoutObjects - minimumDistanceBetweenObjects*(i-2)); + if (typeObject == 0){ + distractor = CreateCylinder(position, scaleObject); + } + else { + distractor = CreateShere(position, scaleObject); + } + listOfDistractors.Add(distractor); } - listOfDistractors.Add(distractor); + + if (i > 5) { + Vector3 position = new Vector3(maxdistanceToTheCenter - 2*minimumDistanceWithoutObjects - 2 * minimumDistanceBetweenObjects, + yAltitudeTable, maxdistanceToTheCenter - minimumDistanceWithoutObjects - minimumDistanceBetweenObjects*(i-5)); + + if (typeObject == 0){ + distractor = CreateCylinder(position, scaleObject); + } + else { + distractor = CreateShere(position, scaleObject); + } + listOfDistractors.Add(distractor); + } + } return listOfDistractors; } @@ -173,8 +179,8 @@ void DesactiveObjects(){ } GameObject CreateCylinder(Vector3 position, Vector3 scale) { - // method to create a cylinder gameobject - GameObject cylinder = GameObject.CreatePrimitive(PrimitiveType.Cylinder); + // method to create a cylinder GameObject + GameObject cylinder = GameObject.CreatePrimitive(PrimitiveType.Cylinder); cylinder.transform.position = position; cylinder.tag = "Cylinder"; @@ -193,8 +199,8 @@ GameObject CreateCylinder(Vector3 position, Vector3 scale) { } GameObject CreateShere(Vector3 position, Vector3 scale) { - // method to create a sphere gameobject - GameObject sphere = GameObject.CreatePrimitive(PrimitiveType.Sphere); + // method to create a sphere GameObject + GameObject sphere = GameObject.CreatePrimitive(PrimitiveType.Sphere); sphere.transform.position = position; sphere.tag = "Sphere"; @@ -213,6 +219,7 @@ GameObject CreateShere(Vector3 position, Vector3 scale) { } GameObject CreateLight(){ + // method to create a light GameObject GameObject light = new GameObject(); light.tag = "Light"; diff --git a/ArmRobot/Assets/Scripts/RandomizerPositionObject.cs b/ArmRobot/Assets/Scripts/RandomizerPositionObject.cs index 5f78b68c..c9dd7473 100644 --- a/ArmRobot/Assets/Scripts/RandomizerPositionObject.cs +++ b/ArmRobot/Assets/Scripts/RandomizerPositionObject.cs @@ -7,16 +7,15 @@ public class RandomizerPositionObject : MonoBehaviour private GameObject gameObjectSeen; - public float robotMinReach = 20f; - public float robotMaxReach = 50f; + public float robotMinReach = 0.20f; + public float robotMaxReach = 0.35f; Bounds tableBounds; - public float yAltitudeTable = 57f; // CONTROL - public void Move(List listOfAlreadyMovedObjects) + public void Move(List listOfAlreadyMovedObjects, float yAltitudeTable) { Vector3 initialRotation = new Vector3(0f, 0f, 0f); transform.rotation = Quaternion.Euler(initialRotation); @@ -38,6 +37,7 @@ public void Move(List listOfAlreadyMovedObjects) Random.value * 360.0f, transform.rotation.eulerAngles.z); transform.rotation = Quaternion.Euler(randomRotation); + } @@ -90,7 +90,7 @@ public Vector2 RandomPoint(float minRadius, float maxRadius, List li // edge (2 * maxRadius - radiusOfTheGameObject) to be sure that the point is reachable by the robot float gameObjectRadius = GameObjectRadius(gameObject); - + float randomX; float randomZ; int randomConstraint = Random.Range(0, 2); diff --git a/ArmRobot/Assets/Scripts/Robot/RobotVisionCapture.cs b/ArmRobot/Assets/Scripts/Robot/RobotVisionCapture.cs index b083005e..34e8cd03 100644 --- a/ArmRobot/Assets/Scripts/Robot/RobotVisionCapture.cs +++ b/ArmRobot/Assets/Scripts/Robot/RobotVisionCapture.cs @@ -8,7 +8,6 @@ public class RobotVisionCapture : MonoBehaviour public GameObject robot; public GameObject table; public GameObject DomainRandomizationObject; - public int index; @@ -27,23 +26,19 @@ private void Update() VisionDataCollector visionDataCollector = GetComponent(); string imageName = visionDataCollector.NextImageName(); Vector3 relativeCubePosition = cube.transform.position - robot.transform.position; - - CameraPixel cameraPixel = GetComponent(); - Vector2 screenPos = cameraPixel.GetPixelPosition(); - - - RobotVisionDataPoint dataPoint = new RobotVisionDataPoint(screenPos, relativeCubePosition, imageName); + + Quaternion cube_orientation = cube.transform.rotation; + RobotVisionDataPoint dataPoint = new RobotVisionDataPoint(cube_orientation, relativeCubePosition, imageName); bool didCapture = visionDataCollector.CaptureIfNecessary(imageName, dataPoint); if (didCapture) { - Reset(index); - index = index + 1; + Reset(); } } - private void Reset(int index) + private void Reset() { /* Here we will do the domain randomization. Thus we will randomize: - number and shape of distractor objects on the table (cylinders and spheres) @@ -53,7 +48,7 @@ private void Reset(int index) */ if (DomainRandomizationObject.GetComponent() != null){ DomainRandomization domainRandomization = DomainRandomizationObject.GetComponent(); - domainRandomization.DomainRandomizationScene(index); + domainRandomization.DomainRandomizationScene(); } } diff --git a/ArmRobot/Assets/Scripts/Robot/RobotVisionDataPoint.cs b/ArmRobot/Assets/Scripts/Robot/RobotVisionDataPoint.cs index a7644d02..4ce6d2ff 100644 --- a/ArmRobot/Assets/Scripts/Robot/RobotVisionDataPoint.cs +++ b/ArmRobot/Assets/Scripts/Robot/RobotVisionDataPoint.cs @@ -3,24 +3,27 @@ [System.Serializable] public class RobotVisionDataPoint { - public float pixel_x; - public float pixel_y; - public float x; public float y; public float z; + public float q_w; + public float q_x; + public float q_y; + public float q_z; public string screenCaptureName; - public RobotVisionDataPoint(Vector2 screenPos, Vector3 relativeCubePosition, string screenCaptureName) + public RobotVisionDataPoint(Quaternion cube_orientation, Vector3 relativeCubePosition, string screenCaptureName) { - - this.pixel_x = screenPos[0]; - this.pixel_y = 1028 - screenPos[1]; // we need to switch from bottom left corner to top left corner this.x = relativeCubePosition[0]; this.y = relativeCubePosition[1]; this.z = relativeCubePosition[2]; + this.q_w = cube_orientation[3]; + this.q_x = cube_orientation[0]; + this.q_y = cube_orientation[1]; + this.q_z = cube_orientation[2]; + this.screenCaptureName = screenCaptureName; } diff --git a/ArmRobot/Assets/Scripts/VisionDataCollector.cs b/ArmRobot/Assets/Scripts/VisionDataCollector.cs index e530e25e..cfd7882e 100644 --- a/ArmRobot/Assets/Scripts/VisionDataCollector.cs +++ b/ArmRobot/Assets/Scripts/VisionDataCollector.cs @@ -88,6 +88,7 @@ IEnumerator Quit() private void Capture(string imageName, System.Object dataPoint) + // method to take a capture of the scene and save it inside the ScreenCapture file but also save the data into the Log file { RenderTexture currentRT = RenderTexture.active; RenderTexture.active = _camera.targetTexture; diff --git a/README.md b/README.md index 808d3461..424aa8d0 100755 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Single Cube Environment +# Multiple objects Environment In this branch, we set up an environment with a [Universal Robotics UR3e](https://www.universal-robots.com/products/ur3-robot/) robot on a table along with a cube. @@ -22,6 +22,9 @@ Below is the list of element we randomize: The domain randomization process is controlled by the script `DomainRandomization.cs` under `Assets` > `Scripts` +`IMPORTANT`: to activate more than one object on the scene you need to go in the `Hierarchy` project and select `DomainRandomizationObject` game object. Go in the `Inspector` pannel. Then in the component `DomainRandomization` there is a variable called `NbMaxDistractorObjects`. This variable corresponds to maximum number of distractors (objects other than the cube) than we can generate on the table at each frame (each simulation). + + ## Glimpse into the code The orchestror file is `Robot` > `RobotVisionCapture.cs`. In this file, at each frame, we extract the position of the cube relative to the camera and we create a datapoint object which is the vector of data we want to extract (see `Robot` > `RobotVisionDataPoint.cs`). Then, we capture the image of the mainCamera and we load the image and the datapoint. We do these two actions in when we call the `CaptureIfNeccessary` method inside `VisionDataCollector.cs` file. Then, if we didn't reach the number of simulated data we want to extract, we repeat the process but we need to change the environment of the data by performing domain randomization. This is done in the `Reset` method. @@ -34,6 +37,23 @@ Then, I need to check if the proposed position does not interfer which other obj For the other elements which are randomized, follow the code inside `DomainRandomization.cs` and go to the corresponding files to understand how it is done. +## Switch from a single cube to a scene composed by a cube and multiple object +`Hierarchy` > `DomainRandomizationObject` then in the `Inspector` pannel, go in the `DomainRandomization` component and set the variable `NbMaxDistractorObjects` to more than 0. + +## Switch to an asymetric cube +The advantage to switch to an asymmetric cube is to train a model for predicting orientation. We define the orientation of an object by its quaternion represensation and to have an asymmetric cube in the scene they are some few steps to do. + + + +- in the `Project` pannel click on `Materials`. You will see a file called `NonSymmetricCubeTexture` +- then click on the `Cube` GameObject in the `Hierarchy`. +- go under `Alphabet Cube Material (Material)` +- drag and drop the `NonSymmetricCubeTexture` file in the `Albedo` variable under `Main Maps` +- go into `Scripts` under `Project pannel` and open the `DomainRandomization.cs` script. Scroll down and comment `//` the lines 45 and 49. These two lines are responsible of imposing a checker pattern to the cube and also of changing its color. + +Then if you want to go back to a symmetric cube, click on the little circle in front of `Albedo` and select `None`. Then you can also change the color of the cube. You can also uncomment lignes 45 and 49 of the `DomainRandomization.cs` script. + + ## Run Simulation Open `Scenes` > `ArticulationRobot`, and press play. To control the number of data you want to extract, you need to change the value of variable `Max Samples` in the inspector of the `VisionDataCollector` game object. Then, when you press start and the ismulation is over, if you go to the log, you can see the path on your computer where the data was loaded. @@ -41,14 +61,14 @@ Open `Scenes` > `ArticulationRobot`, and press play. To control the number of da Then, there is two folders inside the data folder: Logs and ScreenCapture. The ScreenCapture folder gathers all the images captured by the mainCanera object whereas Logs gathers all the datapoints inside txt files. -## Survey +## Survey Your opinion matters a great deal to us. Only by hearing your thoughts can we continue to make Unity a better simulator for robotics. Please take a few minutes to let us know about it. [Fill out the survey](https://docs.google.com/forms/d/e/1FAIpQLSc77ah4azt6D4AOxCWhjpCBgM6Si6f0DA_dunM-ZhDf5xJlgg/viewform) -## License +## License [Apache License 2.0](LICENSE) diff --git a/docs/images/asymmetric_cube.png b/docs/images/asymmetric_cube.png new file mode 100644 index 00000000..d1b192c2 Binary files /dev/null and b/docs/images/asymmetric_cube.png differ