From 5967d526bc37cf215901a76d99fcf1eb6a650c0f Mon Sep 17 00:00:00 2001 From: Autumn60 Date: Wed, 14 Feb 2024 19:50:50 +0900 Subject: [PATCH 1/3] Delete old code --- .../Scripts/Serializers/TF/TFMsgSerializer.cs | 39 ------------------- 1 file changed, 39 deletions(-) diff --git a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/TF/TFMsgSerializer.cs b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/TF/TFMsgSerializer.cs index 60f7896a..6b11e2c3 100644 --- a/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/TF/TFMsgSerializer.cs +++ b/Assets/UnitySensorsROS/Runtime/Scripts/Serializers/TF/TFMsgSerializer.cs @@ -46,43 +46,4 @@ public override TFMessageMsg Serialize() return _msg; } } - /* - [System.Serializable] - public class TFSerializer : Serializer - { - - [SerializeField] - private TFMessageMsg _msg; - - private AutoHeader _header; - - public TFMessageMsg msg { get => _msg; } - - public void Init() - { - _msg = new TFMessageMsg(); - _header = new AutoHeader(); - - _header.Init(""); - } - - public TFMessageMsg Serialize(float time, TFData[] tf) - { - _header.Serialize(time); - List transforms = new List(); - foreach(TFData tfData in tf) - { - TransformStampedMsg transform = new TransformStampedMsg(); - transform.header = _header.header; - transform.header.frame_id = tfData.frame_id_parent; - transform.child_frame_id = tfData.frame_id_child; - transform.transform.translation = tfData.position.To(); - transform.transform.rotation = tfData.rotation.To(); - transforms.Add(transform); - } - _msg.transforms = transforms.ToArray(); - return _msg; - } - } - */ } \ No newline at end of file From a3f8e5f8066701726d2cfabbbe454685dae65662 Mon Sep 17 00:00:00 2001 From: Autumn60 Date: Wed, 14 Feb 2024 19:50:58 +0900 Subject: [PATCH 2/3] Fix coordinate calc --- Assets/UnitySensors/Runtime/Scripts/Sensors/TF/TF.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/UnitySensors/Runtime/Scripts/Sensors/TF/TF.cs b/Assets/UnitySensors/Runtime/Scripts/Sensors/TF/TF.cs index ee7d3040..3b5d2a13 100644 --- a/Assets/UnitySensors/Runtime/Scripts/Sensors/TF/TF.cs +++ b/Assets/UnitySensors/Runtime/Scripts/Sensors/TF/TF.cs @@ -54,7 +54,7 @@ public TFData[] GetTFData(string frame_id_parent, Matrix4x4 worldToLocalMatrix, TFData tfData_self; tfData_self.frame_id_parent = frame_id_parent; tfData_self.frame_id_child = _frame_id; - tfData_self.position = worldToLocalMatrix * _transform.position; + tfData_self.position = (Vector3)(worldToLocalMatrix * new Vector4(_transform.position.x, _transform.position.y, _transform.position.z, 1.0f)); tfData_self.rotation = worldToLocalQuaternion * _transform.rotation; tfData.Add(tfData_self); From ee7723a9d8aeace0623e63ea14d5746feb9ee313 Mon Sep 17 00:00:00 2001 From: Autumn60 Date: Wed, 14 Feb 2024 19:54:31 +0900 Subject: [PATCH 3/3] Update version tags --- Assets/UnitySensors/package.json | 2 +- Assets/UnitySensorsROS/package.json | 4 ++-- README.md | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Assets/UnitySensors/package.json b/Assets/UnitySensors/package.json index e77dd29c..4ba8775f 100644 --- a/Assets/UnitySensors/package.json +++ b/Assets/UnitySensors/package.json @@ -1,6 +1,6 @@ { "name": "com.frj.unity-sensors", - "version": "2.0.2", + "version": "2.0.3", "displayName": "UnitySensors", "description": "", "unity": "2021.3", diff --git a/Assets/UnitySensorsROS/package.json b/Assets/UnitySensorsROS/package.json index 7de7a972..e56410d5 100644 --- a/Assets/UnitySensorsROS/package.json +++ b/Assets/UnitySensorsROS/package.json @@ -1,11 +1,11 @@ { "name": "com.frj.unity-sensors-ros", - "version": "2.0.2", + "version": "2.0.3", "displayName": "UnitySensorsROS", "description": "", "unity": "2021.3", "dependencies": { - "com.frj.unity-sensors": "2.0.2", + "com.frj.unity-sensors": "2.0.3", "com.unity.robotics.ros-tcp-connector": "0.7.0-preview" }, "keywords": [ diff --git a/README.md b/README.md index 39d79d7e..6713cee0 100644 --- a/README.md +++ b/README.md @@ -30,8 +30,8 @@ There are several Prefab and Scene files available for testing each sensor. 2. In the Package Manager window, find and click the + button in the upper lefthand corner of the window. Select `Add package from git URL....` 3. Enter the git URL for the desired package. - 1. For the UnitySensors, enter `https://github.com/Field-Robotics-Japan/UnitySensors.git?path=/Assets/UnitySensors#v2.0.2`. - 2. For the UnitySensorsROS, enter `https://github.com/Field-Robotics-Japan/UnitySensors.git?path=/Assets/UnitySensorsROS#v2.0.2`. + 1. For the UnitySensors, enter `https://github.com/Field-Robotics-Japan/UnitySensors.git?path=/Assets/UnitySensors#v2.0.3`. + 2. For the UnitySensorsROS, enter `https://github.com/Field-Robotics-Japan/UnitySensors.git?path=/Assets/UnitySensorsROS#v2.0.3`. __Note: UnitySensorsROS does not contain UnitySensors.__ 4. Click `Add`.