diff --git a/Assets/Robots/RobotsModels/Cuybot_with_sensors.prefab b/Assets/Robots/RobotsModels/Cuybot_with_sensors.prefab index 6ad0c478f7c0f5c80054f152e61eb596a049a681..4523772266dccff1693e5924563090703e3200f9 100644 --- a/Assets/Robots/RobotsModels/Cuybot_with_sensors.prefab +++ b/Assets/Robots/RobotsModels/Cuybot_with_sensors.prefab @@ -223,10 +223,8 @@ GameObject: - component: {fileID: 3061186050394187488} - component: {fileID: 8679655339076051440} - component: {fileID: 4349708356240028345} - - component: {fileID: 498133031} - - component: {fileID: 498133032} - - component: {fileID: 6442246810404132364} - component: {fileID: 8051383300919184930} + - component: {fileID: 6442246810404132364} m_Layer: 0 m_Name: wheel m_TagString: Untagged @@ -243,7 +241,7 @@ Transform: m_GameObject: {fileID: 1944007635667346338} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0.18530001, y: 0.0518, z: 0.16059995} - m_LocalScale: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.1, y: 0.1, z: 0.1} m_Children: - {fileID: 4157537481017338540} - {fileID: 166020690769825207} @@ -291,107 +289,13 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 7631001c063f69d4495bca90731abab2, type: 3} m_Name: m_EditorClassIdentifier: + dirtyResetOnStart: 0 DisplayInertiaGizmo: 0 UseUrdfData: 0 CenterOfMass: {x: 0, y: 0, z: 0} InertiaTensor: {x: 1, y: 1, z: 1} InertiaTensorRotation: {x: 0, y: 0, z: 0, w: 1} ---- !u!153 &498133031 -ConfigurableJoint: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1944007635667346338} - m_ConnectedBody: {fileID: 2428524261686948678} - m_Anchor: {x: 0, y: 0, z: 0} - m_Axis: {x: 1, y: 0, z: 0} - m_AutoConfigureConnectedAnchor: 1 - m_ConnectedAnchor: {x: 0.1853, y: 0.0518, z: 0.16059995} - serializedVersion: 2 - m_SecondaryAxis: {x: 0, y: 1, z: 0} - m_XMotion: 0 - m_YMotion: 0 - m_ZMotion: 0 - m_AngularXMotion: 2 - m_AngularYMotion: 2 - m_AngularZMotion: 2 - m_LinearLimitSpring: - spring: 0 - damper: 0 - m_LinearLimit: - limit: 0 - bounciness: 0 - contactDistance: 0 - m_AngularXLimitSpring: - spring: 0 - damper: 0 - m_LowAngularXLimit: - limit: 0 - bounciness: 0 - contactDistance: 0 - m_HighAngularXLimit: - limit: 0 - bounciness: 0 - contactDistance: 0 - m_AngularYZLimitSpring: - spring: 0 - damper: 0 - m_AngularYLimit: - limit: 0 - bounciness: 0 - contactDistance: 0 - m_AngularZLimit: - limit: 0 - bounciness: 0 - contactDistance: 0 - m_TargetPosition: {x: 0, y: 0, z: 0} - m_TargetVelocity: {x: 0, y: 0, z: 0} - m_XDrive: - serializedVersion: 3 - positionSpring: 0 - positionDamper: 0 - maximumForce: 3.4028233e+38 - m_YDrive: - serializedVersion: 3 - positionSpring: 0 - positionDamper: 0 - maximumForce: 3.4028233e+38 - m_ZDrive: - serializedVersion: 3 - positionSpring: 0 - positionDamper: 0 - maximumForce: 3.4028233e+38 - m_TargetRotation: {x: 0, y: 0, z: 0, w: 1} - m_TargetAngularVelocity: {x: 0, y: 0, z: 0} - m_RotationDriveMode: 0 - m_AngularXDrive: - serializedVersion: 3 - positionSpring: 0 - positionDamper: 0 - maximumForce: 3.4028233e+38 - m_AngularYZDrive: - serializedVersion: 3 - positionSpring: 0 - positionDamper: 0 - maximumForce: 3.4028233e+38 - m_SlerpDrive: - serializedVersion: 3 - positionSpring: 0 - positionDamper: 0 - maximumForce: 3.4028233e+38 - m_ProjectionMode: 0 - m_ProjectionDistance: 0.1 - m_ProjectionAngle: 180 - m_ConfiguredInWorldSpace: 0 - m_SwapBodies: 0 - m_BreakForce: Infinity - m_BreakTorque: Infinity - m_EnableCollision: 0 - m_EnablePreprocessing: 1 - m_MassScale: 1 - m_ConnectedMassScale: 100 ---- !u!114 &498133032 +--- !u!114 &8051383300919184930 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -417,7 +321,7 @@ ConfigurableJoint: m_Anchor: {x: 0, y: 0, z: 0} m_Axis: {x: 1, y: 0, z: 0} m_AutoConfigureConnectedAnchor: 1 - m_ConnectedAnchor: {x: 0.1853, y: 0.0518, z: 0.16059995} + m_ConnectedAnchor: {x: 0.18530001, y: 0.0518, z: 0.16059995} serializedVersion: 2 m_SecondaryAxis: {x: 0, y: 1, z: 0} m_XMotion: 0 @@ -499,23 +403,8 @@ ConfigurableJoint: m_BreakTorque: Infinity m_EnableCollision: 0 m_EnablePreprocessing: 1 - m_MassScale: 1 + m_MassScale: 0.1 m_ConnectedMassScale: 100 ---- !u!114 &8051383300919184930 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1944007635667346338} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: d7e5edcd03b4c4040bc550e77e4028b0, type: 3} - m_Name: - m_EditorClassIdentifier: - JointName: - EffortLimit: 1000 - VelocityLimit: 1000 --- !u!1 &1989773514065791997 GameObject: m_ObjectHideFlags: 0 @@ -1365,6 +1254,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 60dbf0837965a2646895ca29e229aa07, type: 3} m_Name: m_EditorClassIdentifier: + isActive: 1 Sensing: 0 Bits: 8 SensingFrequency: 20 @@ -1445,7 +1335,7 @@ GameObject: - component: {fileID: 2428524261686948697} - component: {fileID: 2428524261686948678} - component: {fileID: 2428524261686948679} - - component: {fileID: 745677608} + - component: {fileID: 2065997649602301439} m_Layer: 11 m_Name: base_link m_TagString: VirtualRobotActive @@ -1515,12 +1405,13 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 7631001c063f69d4495bca90731abab2, type: 3} m_Name: m_EditorClassIdentifier: + dirtyResetOnStart: 0 DisplayInertiaGizmo: 0 UseUrdfData: 0 CenterOfMass: {x: 0, y: 0, z: 0} InertiaTensor: {x: 1, y: 1, z: 1} InertiaTensorRotation: {x: 0, y: 0, z: 0, w: 1} ---- !u!114 &745677608 +--- !u!114 &2065997649602301439 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -1529,9 +1420,11 @@ MonoBehaviour: m_GameObject: {fileID: 2428524261686948677} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: e3b839f86927c897d9f4fdab9c68e240, type: 3} + m_Script: {fileID: 11500000, guid: 992381e7b5b43af99bed67bf4731bfac, type: 3} m_Name: m_EditorClassIdentifier: + CenterOfMass: {x: 0.07, y: 0.1, z: 0} + UrdfInertialEnabled: 0 --- !u!1 &2428524261740477842 GameObject: m_ObjectHideFlags: 0 @@ -1989,6 +1882,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 7631001c063f69d4495bca90731abab2, type: 3} m_Name: m_EditorClassIdentifier: + dirtyResetOnStart: 0 DisplayInertiaGizmo: 0 UseUrdfData: 0 CenterOfMass: {x: 0, y: 0, z: 0} @@ -2020,7 +1914,7 @@ ConfigurableJoint: m_Anchor: {x: 0, y: 0, z: 0} m_Axis: {x: 1, y: 0, z: 0} m_AutoConfigureConnectedAnchor: 1 - m_ConnectedAnchor: {x: 0.1853, y: 0.0518, z: -0.1605999} + m_ConnectedAnchor: {x: 0.18530001, y: 0.0518, z: -0.16059995} serializedVersion: 2 m_SecondaryAxis: {x: 0, y: 1, z: 0} m_XMotion: 0 @@ -2103,7 +1997,7 @@ ConfigurableJoint: m_EnableCollision: 0 m_EnablePreprocessing: 1 m_MassScale: 1 - m_ConnectedMassScale: 100 + m_ConnectedMassScale: 200 --- !u!1 &5121663560451586306 GameObject: m_ObjectHideFlags: 0 @@ -2227,6 +2121,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 7631001c063f69d4495bca90731abab2, type: 3} m_Name: m_EditorClassIdentifier: + dirtyResetOnStart: 0 DisplayInertiaGizmo: 0 UseUrdfData: 0 CenterOfMass: {x: 0, y: 0, z: 0} @@ -2258,7 +2153,7 @@ ConfigurableJoint: m_Anchor: {x: 0, y: 0, z: 0} m_Axis: {x: 1, y: 0, z: 0} m_AutoConfigureConnectedAnchor: 1 - m_ConnectedAnchor: {x: -0.16589999, y: 0.0518, z: -0.1605999} + m_ConnectedAnchor: {x: -0.1659, y: 0.0518, z: -0.16059995} serializedVersion: 2 m_SecondaryAxis: {x: 0, y: 1, z: 0} m_XMotion: 0 @@ -2341,7 +2236,7 @@ ConfigurableJoint: m_EnableCollision: 0 m_EnablePreprocessing: 1 m_MassScale: 1 - m_ConnectedMassScale: 100 + m_ConnectedMassScale: 200 --- !u!1 &5371104424211349140 GameObject: m_ObjectHideFlags: 0 @@ -2643,6 +2538,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 7631001c063f69d4495bca90731abab2, type: 3} m_Name: m_EditorClassIdentifier: + dirtyResetOnStart: 0 DisplayInertiaGizmo: 0 UseUrdfData: 0 CenterOfMass: {x: 0, y: 0, z: 0} @@ -2674,7 +2570,7 @@ ConfigurableJoint: m_Anchor: {x: 0, y: 0, z: 0} m_Axis: {x: 1, y: 0, z: 0} m_AutoConfigureConnectedAnchor: 1 - m_ConnectedAnchor: {x: -0.16589999, y: 0.0518, z: 0.16059995} + m_ConnectedAnchor: {x: -0.1659, y: 0.0518, z: 0.16059995} serializedVersion: 2 m_SecondaryAxis: {x: 0, y: 1, z: 0} m_XMotion: 0 @@ -2757,7 +2653,7 @@ ConfigurableJoint: m_EnableCollision: 0 m_EnablePreprocessing: 1 m_MassScale: 1 - m_ConnectedMassScale: 100 + m_ConnectedMassScale: 200 --- !u!1 &7555188944893171349 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Robots/RosSharp/Scripts/RosBridgeClient/RosCommuncation/TwistSubscriber.cs b/Assets/Robots/RosSharp/Scripts/RosBridgeClient/RosCommuncation/TwistSubscriber.cs index d3de8f9e87421304c737b3c033dbbae5e7aa805b..7b33cb4052b04090a99e72bd84730c667b6d855c 100644 --- a/Assets/Robots/RosSharp/Scripts/RosBridgeClient/RosCommuncation/TwistSubscriber.cs +++ b/Assets/Robots/RosSharp/Scripts/RosBridgeClient/RosCommuncation/TwistSubscriber.cs @@ -59,12 +59,24 @@ namespace RosSharp.RosBridgeClient { // float deltaTime = Time.realtimeSinceStartup - previousRealTime; float deltaTime = ToolsTime.DeltaTime; - + if(is_forced_based) { if(deltaTime > 0) - rigidbody.AddForce( Quaternion.Inverse(rigidbody.rotation) * (linearVelocity - rigidbody.velocity) * rigidbody.mass / deltaTime ); - // rigidbody.angularVelocity = angularVelocity * deltaTime; + { + if(linearVelocity.magnitude > 0) + { + Vector3 force = rigidbody.transform.rotation * (linearVelocity - rigidbody.velocity) * rigidbody.mass / deltaTime * 2; + rigidbody.AddForce( new Vector3 (force.x, 0, force.z) ); + } + + if (angularVelocity.magnitude > 0) + { + Vector3 torque = rigidbody.transform.rotation * (angularVelocity - rigidbody.angularVelocity) * rigidbody.mass / deltaTime * 2; + rigidbody.AddTorque( new Vector3 (0, torque.y , 0) ); + } + + } } else { diff --git a/Assets/Robots/RosSharp/Scripts/Urdf/UrdfComponents/UrdfInertial.cs b/Assets/Robots/RosSharp/Scripts/Urdf/UrdfComponents/UrdfInertial.cs index 1807162bcdbfb5d1b9dcf8e4da66886024e9f0be..81cbb02762b465fdc8178722fc1f29bb32ab4001 100644 --- a/Assets/Robots/RosSharp/Scripts/Urdf/UrdfComponents/UrdfInertial.cs +++ b/Assets/Robots/RosSharp/Scripts/Urdf/UrdfComponents/UrdfInertial.cs @@ -23,6 +23,7 @@ namespace RosSharp.Urdf [RequireComponent(typeof(Rigidbody))] public class UrdfInertial : MonoBehaviour { + public bool dirtyResetOnStart = false; public bool DisplayInertiaGizmo; public bool UseUrdfData; @@ -77,8 +78,11 @@ namespace RosSharp.Urdf } else { - _rigidbody.ResetCenterOfMass(); - _rigidbody.ResetInertiaTensor(); + if(dirtyResetOnStart) + { + _rigidbody.ResetCenterOfMass(); + _rigidbody.ResetInertiaTensor(); + } } } diff --git a/Assets/Robots/Scripts/Sensors/Lidar/LidarProvider.cs b/Assets/Robots/Scripts/Sensors/Lidar/LidarProvider.cs index c956460f0040dfa0f5d338db5ea674e7207a7e79..2c9e122a0c40ddc7ea11fdc8ea3d38ee54ce0897 100644 --- a/Assets/Robots/Scripts/Sensors/Lidar/LidarProvider.cs +++ b/Assets/Robots/Scripts/Sensors/Lidar/LidarProvider.cs @@ -49,6 +49,8 @@ public class LidarProvider : SensorProvider2D public override IEnumerator Sense () { + if(!isActive) yield return null; + Sensing = true; yield return StartCoroutine(CoroutineUtil.WaitForRealSeconds(SensingFrequency == 0 ? 0 : 1f / SensingFrequency)); int nbMeasures = Mathf.RoundToInt((EndAngle - StartAngle) / AngularResolution); diff --git a/Assets/Robots/Scripts/Sensors/Scripts/SensorProvider.cs b/Assets/Robots/Scripts/Sensors/Scripts/SensorProvider.cs index 1d9b6423fee126cac97b1549529cc82544b2feed..d4aa63dc7c8f652796fb7812c85bc1850c7fba34 100644 --- a/Assets/Robots/Scripts/Sensors/Scripts/SensorProvider.cs +++ b/Assets/Robots/Scripts/Sensors/Scripts/SensorProvider.cs @@ -4,6 +4,8 @@ using UnityEngine; public abstract class SensorProvider : MonoBehaviour { + public bool isActive = true; + [HideInInspector] public bool Sensing; protected float QuantisationStep; @@ -43,6 +45,7 @@ public abstract class SensorProvider : MonoBehaviour // } public virtual void Update(){ + if(!isActive) return; if (!Sensing) { StartCoroutine(Sense()); diff --git a/Assets/Scenes/Tutos/Tuto1.unity b/Assets/Scenes/Tutos/Tuto1.unity index 405e8cc838001af0a76b24cdc983c5f0c09143c2..486b5d580d22a71f336a005f5bfaeeebaf7221d8 100644 --- a/Assets/Scenes/Tutos/Tuto1.unity +++ b/Assets/Scenes/Tutos/Tuto1.unity @@ -9000,7 +9000,7 @@ MeshCollider: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1099706720} - m_Material: {fileID: 0} + m_Material: {fileID: 13400000, guid: 350992b88700690ad8e501040af84faa, type: 2} m_IsTrigger: 0 m_Enabled: 1 serializedVersion: 4 @@ -9114,6 +9114,42 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 0} m_Modifications: + - target: {fileID: 498133031, guid: cb10fa1a13eab5f35971de6bb8cd291e, type: 3} + propertyPath: m_ConnectedAnchor.x + value: 0.18530001 + objectReference: {fileID: 0} + - target: {fileID: 498133031, guid: cb10fa1a13eab5f35971de6bb8cd291e, type: 3} + propertyPath: m_ConnectedAnchor.y + value: 0.0518 + objectReference: {fileID: 0} + - target: {fileID: 498133031, guid: cb10fa1a13eab5f35971de6bb8cd291e, type: 3} + propertyPath: m_MassScale + value: 0.1 + objectReference: {fileID: 0} + - target: {fileID: 498133031, guid: cb10fa1a13eab5f35971de6bb8cd291e, type: 3} + propertyPath: m_ConnectedMassScale + value: 100 + objectReference: {fileID: 0} + - target: {fileID: 1594815881504067069, guid: cb10fa1a13eab5f35971de6bb8cd291e, + type: 3} + propertyPath: m_ConnectedAnchor.x + value: -0.1659 + objectReference: {fileID: 0} + - target: {fileID: 1594815881504067069, guid: cb10fa1a13eab5f35971de6bb8cd291e, + type: 3} + propertyPath: m_ConnectedAnchor.y + value: 0.0518 + objectReference: {fileID: 0} + - target: {fileID: 1594815881504067069, guid: cb10fa1a13eab5f35971de6bb8cd291e, + type: 3} + propertyPath: m_MassScale + value: 0.1 + objectReference: {fileID: 0} + - target: {fileID: 1594815881504067069, guid: cb10fa1a13eab5f35971de6bb8cd291e, + type: 3} + propertyPath: m_ConnectedMassScale + value: 100 + objectReference: {fileID: 0} - target: {fileID: 2428524260522502272, guid: cb10fa1a13eab5f35971de6bb8cd291e, type: 3} propertyPath: m_LocalPosition.x @@ -9174,7 +9210,84 @@ PrefabInstance: propertyPath: m_Name value: Cuybot_with_sensors objectReference: {fileID: 0} - m_RemovedComponents: [] + - target: {fileID: 2428524260990036908, guid: cb10fa1a13eab5f35971de6bb8cd291e, + type: 3} + propertyPath: isActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2428524261686948679, guid: cb10fa1a13eab5f35971de6bb8cd291e, + type: 3} + propertyPath: m_Enabled + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2499975129936484301, guid: cb10fa1a13eab5f35971de6bb8cd291e, + type: 3} + propertyPath: m_ConnectedAnchor.x + value: 0.18530001 + objectReference: {fileID: 0} + - target: {fileID: 2499975129936484301, guid: cb10fa1a13eab5f35971de6bb8cd291e, + type: 3} + propertyPath: m_ConnectedAnchor.y + value: 0.0518 + objectReference: {fileID: 0} + - target: {fileID: 2499975129936484301, guid: cb10fa1a13eab5f35971de6bb8cd291e, + type: 3} + propertyPath: m_ConnectedAnchor.z + value: -0.16059995 + objectReference: {fileID: 0} + - target: {fileID: 2499975129936484301, guid: cb10fa1a13eab5f35971de6bb8cd291e, + type: 3} + propertyPath: m_MassScale + value: 0.1 + objectReference: {fileID: 0} + - target: {fileID: 2499975129936484301, guid: cb10fa1a13eab5f35971de6bb8cd291e, + type: 3} + propertyPath: m_ConnectedMassScale + value: 100 + objectReference: {fileID: 0} + - target: {fileID: 4455809265994286810, guid: cb10fa1a13eab5f35971de6bb8cd291e, + type: 3} + propertyPath: m_ConnectedAnchor.x + value: -0.1659 + objectReference: {fileID: 0} + - target: {fileID: 4455809265994286810, guid: cb10fa1a13eab5f35971de6bb8cd291e, + type: 3} + propertyPath: m_ConnectedAnchor.y + value: 0.0518 + objectReference: {fileID: 0} + - target: {fileID: 4455809265994286810, guid: cb10fa1a13eab5f35971de6bb8cd291e, + type: 3} + propertyPath: m_ConnectedAnchor.z + value: -0.16059995 + objectReference: {fileID: 0} + - target: {fileID: 4455809265994286810, guid: cb10fa1a13eab5f35971de6bb8cd291e, + type: 3} + propertyPath: m_MassScale + value: 0.1 + objectReference: {fileID: 0} + - target: {fileID: 4455809265994286810, guid: cb10fa1a13eab5f35971de6bb8cd291e, + type: 3} + propertyPath: m_ConnectedMassScale + value: 100 + objectReference: {fileID: 0} + - target: {fileID: 6442246810404132364, guid: cb10fa1a13eab5f35971de6bb8cd291e, + type: 3} + propertyPath: m_ConnectedAnchor.x + value: 0.18530001 + objectReference: {fileID: 0} + - target: {fileID: 6442246810404132364, guid: cb10fa1a13eab5f35971de6bb8cd291e, + type: 3} + propertyPath: m_ConnectedAnchor.y + value: 0.0518 + objectReference: {fileID: 0} + - target: {fileID: 6442246810404132364, guid: cb10fa1a13eab5f35971de6bb8cd291e, + type: 3} + propertyPath: m_MassScale + value: 0.1 + objectReference: {fileID: 0} + m_RemovedComponents: + - {fileID: 0} + - {fileID: 0} m_SourcePrefab: {fileID: 100100000, guid: cb10fa1a13eab5f35971de6bb8cd291e, type: 3} --- !u!1 &1121671989 stripped GameObject: @@ -13475,6 +13588,38 @@ CapsuleCollider: m_Height: 0.27 m_Direction: 0 m_Center: {x: 0.08, y: 0.02, z: 0} +--- !u!1 &1734493571 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 6113120077017365461, guid: 63546cc7828dd0ea4b007c226d952460, + type: 3} + m_PrefabInstance: {fileID: 2130930804} + m_PrefabAsset: {fileID: 0} +--- !u!114 &1734493576 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1734493571} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 992381e7b5b43af99bed67bf4731bfac, type: 3} + m_Name: + m_EditorClassIdentifier: + CenterOfMass: {x: 0, y: 0.2, z: 0} + UrdfInertialEnabled: 0 +--- !u!114 &1734493577 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1734493571} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 63ddeb7157efecbd99727465e372e2c3, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &1743297277 stripped GameObject: m_CorrespondingSourceObject: {fileID: 4671438344919443299, guid: 68101e037ab87e54886bd03a80f1a22c, @@ -16994,11 +17139,60 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 0} m_Modifications: + - target: {fileID: 912177690, guid: 63546cc7828dd0ea4b007c226d952460, type: 3} + propertyPath: m_Enabled + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 160198493933270746, guid: 63546cc7828dd0ea4b007c226d952460, + type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 1049666708732476135, guid: 63546cc7828dd0ea4b007c226d952460, + type: 3} + propertyPath: is_forced_based + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 3012755013783190580, guid: 63546cc7828dd0ea4b007c226d952460, + type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 3131725386279832066, guid: 63546cc7828dd0ea4b007c226d952460, + type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 3131725386279832067, guid: 63546cc7828dd0ea4b007c226d952460, + type: 3} + propertyPath: m_UseMotor + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3131725386279832067, guid: 63546cc7828dd0ea4b007c226d952460, + type: 3} + propertyPath: m_ConnectedMassScale + value: 100 + objectReference: {fileID: 0} + - target: {fileID: 3131725386279832067, guid: 63546cc7828dd0ea4b007c226d952460, + type: 3} + propertyPath: m_MassScale + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 3131725386279832067, guid: 63546cc7828dd0ea4b007c226d952460, + type: 3} + propertyPath: m_Motor.freeSpin + value: 0 + objectReference: {fileID: 0} - target: {fileID: 4508275817460764930, guid: 63546cc7828dd0ea4b007c226d952460, type: 3} propertyPath: m_Name value: Qolo_sensors objectReference: {fileID: 0} + - target: {fileID: 5224690066173247126, guid: 63546cc7828dd0ea4b007c226d952460, + type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} - target: {fileID: 5526748559872246136, guid: 63546cc7828dd0ea4b007c226d952460, type: 3} propertyPath: m_LocalPosition.x @@ -17054,6 +17248,101 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 6016981525957559308, guid: 63546cc7828dd0ea4b007c226d952460, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6016981526725478069, guid: 63546cc7828dd0ea4b007c226d952460, + type: 3} + propertyPath: DebugInfo + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6016981526725478069, guid: 63546cc7828dd0ea4b007c226d952460, + type: 3} + propertyPath: isActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6016981526755088197, guid: 63546cc7828dd0ea4b007c226d952460, + type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6113120077017365456, guid: 63546cc7828dd0ea4b007c226d952460, + type: 3} + propertyPath: m_Mass + value: 150 + objectReference: {fileID: 0} + - target: {fileID: 6113120077017365463, guid: 63546cc7828dd0ea4b007c226d952460, + type: 3} + propertyPath: m_Enabled + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6421998529571228886, guid: 63546cc7828dd0ea4b007c226d952460, + type: 3} + propertyPath: m_ConnectedMassScale + value: 100 + objectReference: {fileID: 0} + - target: {fileID: 6421998529571228886, guid: 63546cc7828dd0ea4b007c226d952460, + type: 3} + propertyPath: m_MassScale + value: 0.2 + objectReference: {fileID: 0} + - target: {fileID: 6770956313079162416, guid: 63546cc7828dd0ea4b007c226d952460, + type: 3} + propertyPath: m_Mass + value: 10 + objectReference: {fileID: 0} + - target: {fileID: 6806652194559206623, guid: 63546cc7828dd0ea4b007c226d952460, + type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6977235578875295422, guid: 63546cc7828dd0ea4b007c226d952460, + type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8035768820496661470, guid: 63546cc7828dd0ea4b007c226d952460, + type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8035768820496661471, guid: 63546cc7828dd0ea4b007c226d952460, + type: 3} + propertyPath: m_UseMotor + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8035768820496661471, guid: 63546cc7828dd0ea4b007c226d952460, + type: 3} + propertyPath: m_ConnectedMassScale + value: 100 + objectReference: {fileID: 0} + - target: {fileID: 8035768820496661471, guid: 63546cc7828dd0ea4b007c226d952460, + type: 3} + propertyPath: m_MassScale + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8035768820496661471, guid: 63546cc7828dd0ea4b007c226d952460, + type: 3} + propertyPath: m_Motor.freeSpin + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9047430052818552082, guid: 63546cc7828dd0ea4b007c226d952460, + type: 3} + propertyPath: m_Mass + value: 10 + objectReference: {fileID: 0} + - target: {fileID: 9074220925154144056, guid: 63546cc7828dd0ea4b007c226d952460, + type: 3} + propertyPath: m_ConnectedMassScale + value: 100 + objectReference: {fileID: 0} + - target: {fileID: 9074220925154144056, guid: 63546cc7828dd0ea4b007c226d952460, + type: 3} + propertyPath: m_MassScale + value: 0.2 + objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 63546cc7828dd0ea4b007c226d952460, type: 3} --- !u!1 &2132669723 diff --git a/Assets/basicOdom.cs b/Assets/basicOdom.cs new file mode 100644 index 0000000000000000000000000000000000000000..a8f8ada314669880ee4e2791e3da531e173fee8a --- /dev/null +++ b/Assets/basicOdom.cs @@ -0,0 +1,19 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class basicOdom : MonoBehaviour +{ + Rigidbody rigidbody; + // Start is called before the first frame update + void Start() + { + rigidbody = GetComponent<Rigidbody>(); + } + + // Update is called once per frame + void Update() + { + // print(rigidbody.transform.rotation * rigidbody.velocity); + } +} diff --git a/Assets/cuybotFix.cs.meta b/Assets/basicOdom.cs.meta similarity index 83% rename from Assets/cuybotFix.cs.meta rename to Assets/basicOdom.cs.meta index 4951324da9b91fe90e5f89fb78e9068dfe71d6d5..7f2d49c07bffcdde69780211334143bf8ac81d9e 100644 --- a/Assets/cuybotFix.cs.meta +++ b/Assets/basicOdom.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: e3b839f86927c897d9f4fdab9c68e240 +guid: 63ddeb7157efecbd99727465e372e2c3 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/cuybotFix.cs b/Assets/cuybotFix.cs deleted file mode 100644 index 1931261f962149e796a4c81da9bad2d89fd25b42..0000000000000000000000000000000000000000 --- a/Assets/cuybotFix.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public class cuybotFix : MonoBehaviour -{ - // Update is called once per frame - void Start() - { - gameObject.GetComponent<Rigidbody>().centerOfMass = new Vector3(0.07f, 0.05f,0); - } -} diff --git a/Assets/dirtyFixInertial.cs b/Assets/dirtyFixInertial.cs new file mode 100644 index 0000000000000000000000000000000000000000..98973c6eb1b68f7d6661565da0a79a0bb761ec60 --- /dev/null +++ b/Assets/dirtyFixInertial.cs @@ -0,0 +1,28 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class dirtyFixInertial : MonoBehaviour +{ + public Vector3 CenterOfMass; + + public bool UrdfInertialEnabled = false; + + bool firstUpdate = true; + + // Start is called before the first frame update + void Start() + { + transform.GetComponent<RosSharp.Urdf.UrdfInertial>().enabled = UrdfInertialEnabled; + } + + // Update is called once per frame + void Update() + { + if(firstUpdate) + { + transform.GetComponent<Rigidbody>().centerOfMass = CenterOfMass; + firstUpdate = false; + } + } +} diff --git a/Assets/dirtyFixInertial.cs.meta b/Assets/dirtyFixInertial.cs.meta new file mode 100644 index 0000000000000000000000000000000000000000..c432974fcd8f7741bbda69968022633458af1c50 --- /dev/null +++ b/Assets/dirtyFixInertial.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 992381e7b5b43af99bed67bf4731bfac +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: