From 26e7a83761aaf14299e0ea345bd7d15b4c3167bd Mon Sep 17 00:00:00 2001 From: Leushina Date: Mon, 22 Jun 2026 10:57:52 +0300 Subject: [PATCH] Add custom msg for fire spawn --- .gitignore | 3 +- Assets/RosMessages/GenLocationsOnMesh.meta | 8 ++ .../RosMessages/GenLocationsOnMesh/msg.meta | 8 ++ .../msg/LocationsOnMeshMsg.cs | 78 +++++++++++++++++++ .../msg/LocationsOnMeshMsg.cs.meta | 2 + Assets/Scenes/main.unity | 2 +- 6 files changed, 99 insertions(+), 2 deletions(-) create mode 100644 Assets/RosMessages/GenLocationsOnMesh.meta create mode 100644 Assets/RosMessages/GenLocationsOnMesh/msg.meta create mode 100644 Assets/RosMessages/GenLocationsOnMesh/msg/LocationsOnMeshMsg.cs create mode 100644 Assets/RosMessages/GenLocationsOnMesh/msg/LocationsOnMeshMsg.cs.meta diff --git a/.gitignore b/.gitignore index a0df914..7df6a11 100644 --- a/.gitignore +++ b/.gitignore @@ -203,6 +203,7 @@ InitTestScene*.unity* !/[Aa]ssets/Scenes !/[Aa]ssets/Resources !/[Aa]ssets/CustomLibs +!/[Aa]ssets/RosMessages !/[Aa]ssets/../*.meta @@ -214,4 +215,4 @@ README.md.meta # big stuff *.obj.* -*.obj \ No newline at end of file +*.obj diff --git a/Assets/RosMessages/GenLocationsOnMesh.meta b/Assets/RosMessages/GenLocationsOnMesh.meta new file mode 100644 index 0000000..2eaf20a --- /dev/null +++ b/Assets/RosMessages/GenLocationsOnMesh.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3d90789e91839a8f4bdd696d8bca9a01 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/RosMessages/GenLocationsOnMesh/msg.meta b/Assets/RosMessages/GenLocationsOnMesh/msg.meta new file mode 100644 index 0000000..a61a1be --- /dev/null +++ b/Assets/RosMessages/GenLocationsOnMesh/msg.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fe6f1b1c037796074bf72701e2dd3ed4 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/RosMessages/GenLocationsOnMesh/msg/LocationsOnMeshMsg.cs b/Assets/RosMessages/GenLocationsOnMesh/msg/LocationsOnMeshMsg.cs new file mode 100644 index 0000000..8a08582 --- /dev/null +++ b/Assets/RosMessages/GenLocationsOnMesh/msg/LocationsOnMeshMsg.cs @@ -0,0 +1,78 @@ +//Do not edit! This file was generated by Unity-ROS MessageGeneration. +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text; +using Unity.Robotics.ROSTCPConnector.MessageGeneration; + +namespace RosMessageTypes.GenLocationsOnMesh +{ + [Serializable] + public class LocationsOnMeshMsg : Message + { + public const string k_RosMessageName = "gen_locations_on_mesh_msgs/LocationsOnMesh"; + public override string RosMessageName => k_RosMessageName; + + public uint[] location_id; + public double[] x; + public double[] y; + public double[] z; + + public LocationsOnMeshMsg() + { + this.location_id = new uint[0]; + this.x = new double[0]; + this.y = new double[0]; + this.z = new double[0]; + } + + public LocationsOnMeshMsg(uint[] location_id, double[] x, double[] y, double[] z) + { + this.location_id = location_id; + this.x = x; + this.y = y; + this.z = z; + } + + public static LocationsOnMeshMsg Deserialize(MessageDeserializer deserializer) => new LocationsOnMeshMsg(deserializer); + + private LocationsOnMeshMsg(MessageDeserializer deserializer) + { + deserializer.Read(out this.location_id, sizeof(uint), deserializer.ReadLength()); + deserializer.Read(out this.x, sizeof(double), deserializer.ReadLength()); + deserializer.Read(out this.y, sizeof(double), deserializer.ReadLength()); + deserializer.Read(out this.z, sizeof(double), deserializer.ReadLength()); + } + + public override void SerializeTo(MessageSerializer serializer) + { + serializer.WriteLength(this.location_id); + serializer.Write(this.location_id); + serializer.WriteLength(this.x); + serializer.Write(this.x); + serializer.WriteLength(this.y); + serializer.Write(this.y); + serializer.WriteLength(this.z); + serializer.Write(this.z); + } + + public override string ToString() + { + return "LocationsOnMeshMsg: " + + "\nlocation_id: " + System.String.Join(", ", location_id.ToList()) + + "\nx: " + System.String.Join(", ", x.ToList()) + + "\ny: " + System.String.Join(", ", y.ToList()) + + "\nz: " + System.String.Join(", ", z.ToList()); + } + +#if UNITY_EDITOR + [UnityEditor.InitializeOnLoadMethod] +#else + [UnityEngine.RuntimeInitializeOnLoadMethod] +#endif + public static void Register() + { + MessageRegistry.Register(k_RosMessageName, Deserialize); + } + } +} diff --git a/Assets/RosMessages/GenLocationsOnMesh/msg/LocationsOnMeshMsg.cs.meta b/Assets/RosMessages/GenLocationsOnMesh/msg/LocationsOnMeshMsg.cs.meta new file mode 100644 index 0000000..9116f3f --- /dev/null +++ b/Assets/RosMessages/GenLocationsOnMesh/msg/LocationsOnMeshMsg.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 3fc5ba3014b704832ae2e4bb88e9718e \ No newline at end of file diff --git a/Assets/Scenes/main.unity b/Assets/Scenes/main.unity index 93e3aa1..826c157 100644 --- a/Assets/Scenes/main.unity +++ b/Assets/Scenes/main.unity @@ -138517,7 +138517,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: objectCollector: {fileID: 1329767849} - objectToSpawn: {fileID: 1781949194303238870, guid: e92a0207ed6f749459a3646c2aaf3cd9, type: 3} + objectToSpawn: {fileID: 8295591563862043295, guid: e01f2e62cf41a3449be2dade3b2c2d79, type: 3} topic_name: /locations useNamespace: 0 --- !u!4 &1329767851