From dc1dc7ae1bdd505da191e2c8d8c16dd6d435312b Mon Sep 17 00:00:00 2001 From: KyleR56 <87942912+KyleR56@users.noreply.github.com> Date: Mon, 27 Feb 2023 18:03:19 -0800 Subject: [PATCH] Update arm (#4) * Update arm * Forgot to save and commit Simulator.unity * Update readme --- Assets/Meshes/{Differential.fbx => Wrist.fbx} | Bin .../{Differential.fbx.meta => Wrist.fbx.meta} | 0 Assets/Scenes/Simulator.unity | 134 +++--------------- Assets/Scripts/Differential.cs | 24 ---- Assets/Scripts/Differential.cs.meta | 11 -- README.md | 3 +- 6 files changed, 18 insertions(+), 154 deletions(-) rename Assets/Meshes/{Differential.fbx => Wrist.fbx} (100%) rename Assets/Meshes/{Differential.fbx.meta => Wrist.fbx.meta} (100%) delete mode 100644 Assets/Scripts/Differential.cs delete mode 100644 Assets/Scripts/Differential.cs.meta diff --git a/Assets/Meshes/Differential.fbx b/Assets/Meshes/Wrist.fbx similarity index 100% rename from Assets/Meshes/Differential.fbx rename to Assets/Meshes/Wrist.fbx diff --git a/Assets/Meshes/Differential.fbx.meta b/Assets/Meshes/Wrist.fbx.meta similarity index 100% rename from Assets/Meshes/Differential.fbx.meta rename to Assets/Meshes/Wrist.fbx.meta diff --git a/Assets/Scenes/Simulator.unity b/Assets/Scenes/Simulator.unity index 01afa73..3378e6d 100644 --- a/Assets/Scenes/Simulator.unity +++ b/Assets/Scenes/Simulator.unity @@ -288,114 +288,6 @@ Transform: m_Father: {fileID: 608569419} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &207039704 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 207039705} - - component: {fileID: 207039706} - m_Layer: 0 - m_Name: Left Motor - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &207039705 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 207039704} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 4971088469074015998} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &207039706 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 207039704} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 7e0a231d7d80d8944ae3499df98139bb, type: 3} - m_Name: - m_EditorClassIdentifier: - _motorName: differentialLeft - _reverse: 1 - _positionSensor: 1 - _minLimitSwitch: 2 - _minLimitPosition: -6000 - _maxLimitSwitch: 2 - _maxLimitPosition: 3000 - _potentiometerOffset: 0 - _statusReportPeriod: 0.033333335 - _speed: 2000 - _gearRatio: 54 ---- !u!1 &288530936 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 288530937} - - component: {fileID: 288530938} - m_Layer: 0 - m_Name: Right Motor - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &288530937 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 288530936} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 4971088469074015998} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &288530938 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 288530936} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 7e0a231d7d80d8944ae3499df98139bb, type: 3} - m_Name: - m_EditorClassIdentifier: - _motorName: differentialRight - _reverse: 1 - _positionSensor: 1 - _minLimitSwitch: 2 - _minLimitPosition: -6000 - _maxLimitSwitch: 2 - _maxLimitPosition: 3000 - _potentiometerOffset: 0 - _statusReportPeriod: 0.033333335 - _speed: 2000 - _gearRatio: 54 --- !u!1 &325670889 GameObject: m_ObjectHideFlags: 0 @@ -1177,7 +1069,7 @@ Transform: - {fileID: 4847145696690951790} - {fileID: 3879536624985976241} m_Father: {fileID: 4971088469074015998} - m_RootOrder: 2 + m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!64 &1122966452 MeshCollider: @@ -2993,8 +2885,6 @@ Transform: m_LocalPosition: {x: -0, y: 0, z: 0.125} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - - {fileID: 207039705} - - {fileID: 288530937} - {fileID: 1122966451} m_Father: {fileID: 52496333168099060} m_RootOrder: 0 @@ -3073,12 +2963,12 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 4971088469074015998} - - component: {fileID: 5744071065781546054} + - component: {fileID: 5744071065781546055} - component: {fileID: 5744071065781546053} - component: {fileID: 8309986882779707739} - component: {fileID: 6104618588724628881} m_Layer: 0 - m_Name: Differential + m_Name: Wrist m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -3098,7 +2988,7 @@ MeshCollider: m_Convex: 1 m_CookingOptions: 30 m_Mesh: {fileID: 2534964839176971238, guid: feb10968614d86f43b4d31cdf72b037f, type: 3} ---- !u!114 &5744071065781546054 +--- !u!114 &5744071065781546055 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -3107,11 +2997,21 @@ MonoBehaviour: m_GameObject: {fileID: 5744071065781546052} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 924ced57ab346aa4d9d829b6f98b0da5, type: 3} + m_Script: {fileID: 11500000, guid: 2d2bb6ea6075e384b803d5c623a61e68, type: 3} m_Name: m_EditorClassIdentifier: - _leftMotor: {fileID: 207039706} - _rightMotor: {fileID: 288530938} + _motorName: wrist + _reverse: 1 + _positionSensor: 1 + _minLimitSwitch: 2 + _minLimitPosition: -5000 + _maxLimitSwitch: 2 + _maxLimitPosition: 5000 + _potentiometerOffset: 0 + _statusReportPeriod: 0.03333334 + _speed: 2000 + _gearRatio: 54 + _axis: {x: 1, y: 0, z: 0} --- !u!23 &5985188835100470529 MeshRenderer: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/Differential.cs b/Assets/Scripts/Differential.cs deleted file mode 100644 index 9902745..0000000 --- a/Assets/Scripts/Differential.cs +++ /dev/null @@ -1,24 +0,0 @@ -using UnityEngine; - -public class Differential : MonoBehaviour -{ - [SerializeField] - private PowerDrivenMotor _leftMotor; - [SerializeField] - private PowerDrivenMotor _rightMotor; - - private void FixedUpdate() - { - float leftPos = _leftMotor.CurrentPosition / _leftMotor.GearRatio; - if (_leftMotor.Reverse) - leftPos = -leftPos; - - float rightPos = _rightMotor.CurrentPosition / _rightMotor.GearRatio; - if (_rightMotor.Reverse) - rightPos = -rightPos; - - float pitch = (rightPos + leftPos) / 2; - float roll = leftPos - rightPos; - transform.localRotation = Quaternion.Euler(pitch, 0, roll); - } -} diff --git a/Assets/Scripts/Differential.cs.meta b/Assets/Scripts/Differential.cs.meta deleted file mode 100644 index 7110f14..0000000 --- a/Assets/Scripts/Differential.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 924ced57ab346aa4d9d829b6f98b0da5 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/README.md b/README.md index 351cd8c..f122da6 100644 --- a/README.md +++ b/README.md @@ -20,8 +20,7 @@ The simulator is able to simulate the motors with the following names: - shoulder - elbow - forearm -- differentialLeft -- differentialRight +- wrist - hand ## Cameras