From 8844c57ca61403f0752056ae1e0717798405b2c8 Mon Sep 17 00:00:00 2001 From: Shuo Diao Date: Thu, 20 May 2021 12:01:17 -0700 Subject: [PATCH 1/5] Add editorconfig for formatting --- .editorconfig | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..d48682bf --- /dev/null +++ b/.editorconfig @@ -0,0 +1,75 @@ +; see http://editorconfig.org/ for docs on this file +; See https://github.com/dotnet/format for dotnet format + +root = true + +[*] +ignore_if_in_header = This code was generated by a tool| +indent_style = space +indent_size = 4 +; uncomment to help with sharing files across os's (i.e. network share or through local vm) +#end_of_line = lf +; avoid a bom, which causes endless problems with naive text tooling +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +; keeping auto-format enabled helps avoid merge hell for projects without CI-based format validation +#disable_auto_format = true + +[*.cs] +; uncomment to enable full formatting of c# files +formatters = generic, uncrustify + +[*.asmdef] +scrape_api = true + +[**/Tests/**.asmdef] +scrape_api = false + +[*.Tests.asmdef] +scrape_api = false + +[*.md] +indent_size = 2 +; trailing whitespace is unfortunately significant in markdown +trim_trailing_whitespace = false +; uncomment to enable basic formatting of markdown files +#formatters = generic + +[{Makefile,makefile}] +; tab characters are part of the Makefile format +indent_style = tab + +[*.asmdef] +indent_size = 4 + +[*.json] +indent_size = 2 + +[*.{vcproj,bat,cmd,xaml,tt,t4,ttinclude}] +end_of_line = crlf + +; this VS-specific stuff is based on experiments to see how VS will modify a file after it has been manually edited. +; the settings are meant to closely match what VS does to minimize unnecessary diffs. +[*.{vcxproj,vcxproj.filters}] +indent_style = space +indent_size = 2 +end_of_line = crlf +charset = utf-8-bom +trim_trailing_whitespace = true +insert_final_newline = false +; must be broken out because of 51-char bug (https://github.com/editorconfig/editorconfig-visualstudio/issues/21) +[*.{csproj,pyproj,props,targets}] +indent_style = space +indent_size = 2 +end_of_line = crlf +charset = utf-8-bom +trim_trailing_whitespace = true +insert_final_newline = false +[*.{sln,sln.template}] +indent_style = tab +indent_size = 4 +end_of_line = crlf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = false From 0ff48413c70792b78cd50e856c382ba431312f3e Mon Sep 17 00:00:00 2001 From: Shuo Diao Date: Thu, 20 May 2021 12:01:38 -0700 Subject: [PATCH 2/5] Use linter to format the package code --- .../MessageGeneration/MessageGenBrowser.cs | 6 +- .../MessageGenBrowserSettings.cs | 2 +- .../MessageGeneration/ScriptedMsgImporter.cs | 6 +- .../Editor/ROSSettingsEditor.cs | 2 +- .../Runtime/MessageGeneration/Action.cs | 9 +-- .../MessageGeneration/ActionAutoGen.cs | 18 ++--- .../MessageGeneration/ActionFeedback.cs | 5 +- .../Runtime/MessageGeneration/ActionGoal.cs | 8 ++- .../Runtime/MessageGeneration/ActionResult.cs | 8 ++- .../Runtime/MessageGeneration/Message.cs | 2 +- .../MessageGeneration/MessageAutoGen.cs | 6 +- .../MessageGeneration/MessageParser.cs | 2 +- .../Runtime/MessageGeneration/MessageToken.cs | 4 +- .../MessageGeneration/MessageTokenizer.cs | 4 +- .../MessageGeneration/MsgAutoGenUtilities.cs | 9 +-- .../Actionlib/msg/MGoalStatus.cs | 4 +- .../Actionlib/msg/MGoalStatusArray.cs | 10 +-- .../Diagnostic/msg/MDiagnosticArray.cs | 10 +-- .../Diagnostic/msg/MDiagnosticStatus.cs | 14 ++-- .../Diagnostic/srv/MSelfTestResponse.cs | 14 ++-- .../Geometry/msg/MAccelWithCovariance.cs | 10 +-- .../Geometry/msg/MPolygon.cs | 10 +-- .../Geometry/msg/MPoseArray.cs | 10 +-- .../Geometry/msg/MPoseWithCovariance.cs | 10 +-- .../Geometry/msg/MTwistWithCovariance.cs | 10 +-- .../Nav/msg/MGridCells.cs | 10 +-- .../Nav/msg/MOccupancyGrid.cs | 10 +-- .../PregeneratedMessages/Nav/msg/MPath.cs | 10 +-- .../Nav/srv/MLoadMapResponse.cs | 4 +- .../action/MObjectRecognitionGoal.cs | 10 +-- .../msg/MRecognizedObject.cs | 20 +++--- .../msg/MRecognizedObjectArray.cs | 20 +++--- .../ObjectRecognition/msg/MTable.cs | 10 +-- .../ObjectRecognition/msg/MTableArray.cs | 10 +-- .../Octomap/msg/MOctomap.cs | 10 +-- .../RosTcpEndpoint/msg/MRosUnitySrvMessage.cs | 8 +-- .../srv/MRosUnityTopicListResponse.cs | 10 +-- .../Sensor/msg/MBatteryState.cs | 32 ++++----- .../Sensor/msg/MCameraInfo.cs | 40 +++++------ .../Sensor/msg/MChannelFloat32.cs | 10 +-- .../Sensor/msg/MCompressedImage.cs | 8 +-- .../PregeneratedMessages/Sensor/msg/MImage.cs | 12 ++-- .../PregeneratedMessages/Sensor/msg/MImu.cs | 30 ++++----- .../Sensor/msg/MJointState.cs | 40 +++++------ .../PregeneratedMessages/Sensor/msg/MJoy.cs | 20 +++--- .../Sensor/msg/MJoyFeedback.cs | 8 +-- .../Sensor/msg/MJoyFeedbackArray.cs | 10 +-- .../Sensor/msg/MLaserEcho.cs | 10 +-- .../Sensor/msg/MLaserScan.cs | 20 +++--- .../Sensor/msg/MMagneticField.cs | 10 +-- .../Sensor/msg/MMultiDOFJointState.cs | 40 +++++------ .../Sensor/msg/MMultiEchoLaserScan.cs | 20 +++--- .../Sensor/msg/MNavSatFix.cs | 14 ++-- .../Sensor/msg/MNavSatStatus.cs | 4 +- .../Sensor/msg/MPointCloud.cs | 20 +++--- .../Sensor/msg/MPointCloud2.cs | 18 ++--- .../Sensor/msg/MPointField.cs | 4 +- .../PregeneratedMessages/Sensor/msg/MRange.cs | 4 +- .../PregeneratedMessages/Shape/msg/MMesh.cs | 20 +++--- .../Shape/msg/MMeshTriangle.cs | 10 +-- .../PregeneratedMessages/Shape/msg/MPlane.cs | 10 +-- .../Shape/msg/MSolidPrimitive.cs | 14 ++-- .../PregeneratedMessages/Std/msg/MByte.cs | 4 +- .../Std/msg/MByteMultiArray.cs | 10 +-- .../PregeneratedMessages/Std/msg/MChar.cs | 4 +- .../PregeneratedMessages/Std/msg/MDuration.cs | 2 +- .../Std/msg/MFloat32MultiArray.cs | 10 +-- .../Std/msg/MFloat64MultiArray.cs | 10 +-- .../Std/msg/MInt16MultiArray.cs | 10 +-- .../Std/msg/MInt32MultiArray.cs | 10 +-- .../Std/msg/MInt64MultiArray.cs | 10 +-- .../PregeneratedMessages/Std/msg/MInt8.cs | 4 +- .../Std/msg/MInt8MultiArray.cs | 10 +-- .../Std/msg/MMultiArrayLayout.cs | 10 +-- .../PregeneratedMessages/Std/msg/MTime.cs | 2 +- .../Std/msg/MUInt16MultiArray.cs | 10 +-- .../Std/msg/MUInt32MultiArray.cs | 10 +-- .../Std/msg/MUInt64MultiArray.cs | 10 +-- .../PregeneratedMessages/Std/msg/MUInt8.cs | 4 +- .../Std/msg/MUInt8MultiArray.cs | 8 +-- .../Trajectory/msg/MJointTrajectory.cs | 20 +++--- .../Trajectory/msg/MJointTrajectoryPoint.cs | 40 +++++------ .../msg/MMultiDOFJointTrajectory.cs | 20 +++--- .../msg/MMultiDOFJointTrajectoryPoint.cs | 30 ++++----- .../Visualization/msg/MImageMarker.cs | 24 +++---- .../Visualization/msg/MInteractiveMarker.cs | 20 +++--- .../msg/MInteractiveMarkerControl.cs | 18 ++--- .../msg/MInteractiveMarkerFeedback.cs | 4 +- .../msg/MInteractiveMarkerInit.cs | 10 +-- .../msg/MInteractiveMarkerUpdate.cs | 34 +++++----- .../Visualization/msg/MMarker.cs | 20 +++--- .../Visualization/msg/MMarkerArray.cs | 10 +-- .../Visualization/msg/MMenuEntry.cs | 4 +- .../MessageGeneration/ServiceAutoGen.cs | 13 ++-- .../Runtime/ROSGeometry/CoordinateSpaces.cs | 2 +- .../Runtime/ROSGeometry/ROSVector3.cs | 66 +++++++++---------- .../Runtime/TcpConnector/HUDPanel.cs | 4 +- .../Runtime/TcpConnector/ROSConnection.cs | 8 +-- .../Runtime/TcpConnector/TaskPauser.cs | 4 +- 99 files changed, 626 insertions(+), 616 deletions(-) diff --git a/com.unity.robotics.ros-tcp-connector/Editor/MessageGeneration/MessageGenBrowser.cs b/com.unity.robotics.ros-tcp-connector/Editor/MessageGeneration/MessageGenBrowser.cs index 82a91cf2..43c07aef 100644 --- a/com.unity.robotics.ros-tcp-connector/Editor/MessageGeneration/MessageGenBrowser.cs +++ b/com.unity.robotics.ros-tcp-connector/Editor/MessageGeneration/MessageGenBrowser.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.IO; using System.Linq; using Unity.Robotics.ROSTCPConnector.MessageGeneration; @@ -269,7 +269,7 @@ CachedEntry CacheFolder(string path) if (numActions > 0) buildStrings.Add(numActions + " action" + (numActions > 1 ? "s" : "")); - if(buildStrings.Count > 0) + if (buildStrings.Count > 0) buildLabel = "Build " + string.Join(", ", buildStrings.Select(x => x.ToString())); return new CachedEntry() @@ -294,7 +294,7 @@ CachedEntryStatus GetFileStatus(string path) case ".action": string[] builtActionPaths = ActionAutoGen.GetActionClassPaths(path, MessageGenBrowserSettings.Get().outputPath); return builtActionPaths.All(file => File.Exists(file)) ? CachedEntryStatus.BuiltActionFile : CachedEntryStatus.UnbuiltActionFile; - } + } return CachedEntryStatus.Ignored; } diff --git a/com.unity.robotics.ros-tcp-connector/Editor/MessageGeneration/MessageGenBrowserSettings.cs b/com.unity.robotics.ros-tcp-connector/Editor/MessageGeneration/MessageGenBrowserSettings.cs index 01c92375..333f736f 100644 --- a/com.unity.robotics.ros-tcp-connector/Editor/MessageGeneration/MessageGenBrowserSettings.cs +++ b/com.unity.robotics.ros-tcp-connector/Editor/MessageGeneration/MessageGenBrowserSettings.cs @@ -48,7 +48,7 @@ public static string ToRelativePath(string fullPath) if (!fullPath.StartsWith(dataPath)) return ""; - return fullPath.Substring(dataPath.Length+1); + return fullPath.Substring(dataPath.Length + 1); } } } diff --git a/com.unity.robotics.ros-tcp-connector/Editor/MessageGeneration/ScriptedMsgImporter.cs b/com.unity.robotics.ros-tcp-connector/Editor/MessageGeneration/ScriptedMsgImporter.cs index 56d5191a..07c4b7dd 100644 --- a/com.unity.robotics.ros-tcp-connector/Editor/MessageGeneration/ScriptedMsgImporter.cs +++ b/com.unity.robotics.ros-tcp-connector/Editor/MessageGeneration/ScriptedMsgImporter.cs @@ -15,15 +15,15 @@ public class ScriptedMsgImporter : ScriptedImporter { public override void OnImportAsset(AssetImportContext ctx) { - string inputPath = Path.Combine(Directory.GetCurrentDirectory(), ctx.assetPath); + string inputPath = Path.Combine(Directory.GetCurrentDirectory(), ctx.assetPath); string outputPath = MessageGenBrowserSettings.Get().outputPath; MessageAutoGen.GenerateSingleMessage(inputPath, outputPath); - + string builtPath = MessageAutoGen.GetMessageClassPath(inputPath, outputPath); string builtAssetPath = Path.Combine("Assets", MessageGenBrowserSettings.ToRelativePath(builtPath)); AssetDatabase.ImportAsset(builtAssetPath); Object messageClass = AssetDatabase.LoadAssetAtPath(builtAssetPath, typeof(MonoScript)); - if(messageClass != null) + if (messageClass != null) ctx.AddObjectToAsset("messageClass", messageClass); } } diff --git a/com.unity.robotics.ros-tcp-connector/Editor/ROSSettingsEditor.cs b/com.unity.robotics.ros-tcp-connector/Editor/ROSSettingsEditor.cs index e63b81f1..18e06bf8 100644 --- a/com.unity.robotics.ros-tcp-connector/Editor/ROSSettingsEditor.cs +++ b/com.unity.robotics.ros-tcp-connector/Editor/ROSSettingsEditor.cs @@ -78,4 +78,4 @@ protected virtual void OnGUI() } } } -} \ No newline at end of file +} diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/Action.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/Action.cs index f2b573be..8938deeb 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/Action.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/Action.cs @@ -1,4 +1,4 @@ -/* +/* © Siemens AG, 2019 Author: Sifan Ye (sifan.ye@siemens.com) @@ -16,8 +16,8 @@ limitations under the License. namespace Unity.Robotics.ROSTCPConnector.MessageGeneration { public abstract class Action : Message - where TActionGoal: ActionGoal - where TActionResult: ActionResult + where TActionGoal : ActionGoal + where TActionResult : ActionResult where TActionFeedback : ActionFeedback where TGoal : Message where TResult : Message @@ -29,7 +29,8 @@ public abstract class Action : Message where TGoal : Message public MGoalID goal_id { get; set; } public TGoal goal { get; set; } - public ActionGoal() { + public ActionGoal() + { header = new MHeader(); goal_id = new MGoalID(); } - public ActionGoal(MHeader header, MGoalID goal_id) { + public ActionGoal(MHeader header, MGoalID goal_id) + { this.header = header; this.goal_id = goal_id; } diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/ActionResult.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/ActionResult.cs index fd57cc36..706e6a3e 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/ActionResult.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/ActionResult.cs @@ -1,4 +1,4 @@ -/* +/* © Siemens AG, 2019 Author: Sifan Ye (sifan.ye@siemens.com) @@ -25,12 +25,14 @@ public abstract class ActionResult : Message where TResult : Message public MGoalStatus status { get; set; } public TResult result { get; set; } - public ActionResult() { + public ActionResult() + { header = new MHeader(); status = new MGoalStatus(); } - public ActionResult(MHeader header, MGoalStatus status) { + public ActionResult(MHeader header, MGoalStatus status) + { this.header = header; this.status = status; } diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/Message.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/Message.cs index 6a825e11..cfb948dd 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/Message.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/Message.cs @@ -90,4 +90,4 @@ public byte[] Serialize(bool omitMessageSize = true) /// The offset which a subsequent Deserialize function can begin reading from. public abstract int Deserialize(byte[] data, int offset); } -} \ No newline at end of file +} diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/MessageAutoGen.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/MessageAutoGen.cs index ba591b2f..ae11e7bb 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/MessageAutoGen.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/MessageAutoGen.cs @@ -1,4 +1,4 @@ -/* +/* © Siemens AG, 2019 Author: Sifan Ye (sifan.ye@siemens.com) Licensed under the Apache License, Version 2.0 (the "License"); @@ -38,7 +38,7 @@ public static string GetRosPackageName(string messagePath) if (File.Exists(packagePath)) { XmlReader reader = XmlReader.Create(File.OpenRead(packagePath)); - while(reader.Read()) + while (reader.Read()) { if (reader.NodeType == XmlNodeType.Element && reader.Name == "name") { @@ -78,7 +78,7 @@ public static string GetMessageClassPath(string inFilePath, string outPath) public static List GenerateSingleMessage(string inPath, string outPath, string rosPackageName = "", bool verbose = false) { // If no ROS package name is provided, extract from path - if(rosPackageName == "") + if (rosPackageName == "") rosPackageName = GetRosPackageName(inPath); outPath = GetMessageOutFolder(outPath, rosPackageName); diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/MessageParser.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/MessageParser.cs index b3b0d9eb..1e60a790 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/MessageParser.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/MessageParser.cs @@ -1,4 +1,4 @@ -/* +/* © Siemens AG, 2019 Author: Sifan Ye (sifan.ye@siemens.com) Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/MessageToken.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/MessageToken.cs index a437f9a2..cf8701f8 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/MessageToken.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/MessageToken.cs @@ -1,4 +1,4 @@ -/* +/* © Siemens AG, 2019 Author: Sifan Ye (sifan.ye@siemens.com) Licensed under the Apache License, Version 2.0 (the "License"); @@ -49,4 +49,4 @@ public enum MessageTokenType Seperator } -} \ No newline at end of file +} diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/MessageTokenizer.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/MessageTokenizer.cs index 953f14f0..5c1b82eb 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/MessageTokenizer.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/MessageTokenizer.cs @@ -1,4 +1,4 @@ -/* +/* © Siemens AG, 2019 Author: Sifan Ye (sifan.ye@siemens.com) Licensed under the Apache License, Version 2.0 (the "License"); @@ -415,4 +415,4 @@ public class MessageTokenizerException : Exception { public MessageTokenizerException(string msg) : base(msg) { } } -} \ No newline at end of file +} diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/MsgAutoGenUtilities.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/MsgAutoGenUtilities.cs index 009ccc06..691a9407 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/MsgAutoGenUtilities.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/MsgAutoGenUtilities.cs @@ -1,4 +1,4 @@ -/* +/* © Siemens AG, 2019 Author: Sifan Ye (sifan.ye@siemens.com) Licensed under the Apache License, Version 2.0 (the "License"); @@ -63,7 +63,7 @@ public class MsgAutoGenUtilities {"Duration", "new Duration()"} }; - public static readonly Dictionary numericTypeDeserializationFunctions = new Dictionary + public static readonly Dictionary numericTypeDeserializationFunctions = new Dictionary { {"sbyte", "(sbyte)data[offset];"}, {"byte", "data[offset];"}, @@ -79,7 +79,7 @@ public class MsgAutoGenUtilities {"ulong", "BitConverter.ToUInt64(data, offset)"} }; - public static readonly Dictionary numericTypeByteSize = new Dictionary + public static readonly Dictionary numericTypeByteSize = new Dictionary { {"sbyte", 1}, {"byte", 1}, @@ -115,7 +115,8 @@ public static string CapitalizeFirstLetter(string s) return Char.ToUpper(s[0]) + s.Substring(1); } - public static string LowerFirstLetter(string s) { + public static string LowerFirstLetter(string s) + { return Char.ToLower(s[0]) + s.Substring(1); } diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Actionlib/msg/MGoalStatus.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Actionlib/msg/MGoalStatus.cs index 2201e3f5..8a55d6b6 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Actionlib/msg/MGoalStatus.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Actionlib/msg/MGoalStatus.cs @@ -50,7 +50,7 @@ public override List SerializationStatements() { var listOfSerializations = new List(); listOfSerializations.AddRange(goal_id.SerializationStatements()); - listOfSerializations.Add(new[]{this.status}); + listOfSerializations.Add(new[] { this.status }); listOfSerializations.Add(SerializeString(this.text)); return listOfSerializations; @@ -59,7 +59,7 @@ public override List SerializationStatements() public override int Deserialize(byte[] data, int offset) { offset = this.goal_id.Deserialize(data, offset); - this.status = data[offset];; + this.status = data[offset]; ; offset += 1; var textStringBytesLength = DeserializeLength(data, offset); offset += 4; diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Actionlib/msg/MGoalStatusArray.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Actionlib/msg/MGoalStatusArray.cs index b6c49ecd..09ff0af0 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Actionlib/msg/MGoalStatusArray.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Actionlib/msg/MGoalStatusArray.cs @@ -32,9 +32,9 @@ public override List SerializationStatements() { var listOfSerializations = new List(); listOfSerializations.AddRange(header.SerializationStatements()); - + listOfSerializations.Add(BitConverter.GetBytes(status_list.Length)); - foreach(var entry in status_list) + foreach (var entry in status_list) listOfSerializations.Add(entry.Serialize()); return listOfSerializations; @@ -43,11 +43,11 @@ public override List SerializationStatements() public override int Deserialize(byte[] data, int offset) { offset = this.header.Deserialize(data, offset); - + var status_listArrayLength = DeserializeLength(data, offset); offset += 4; - this.status_list= new MGoalStatus[status_listArrayLength]; - for(var i = 0; i < status_listArrayLength; i++) + this.status_list = new MGoalStatus[status_listArrayLength]; + for (var i = 0; i < status_listArrayLength; i++) { this.status_list[i] = new MGoalStatus(); offset = this.status_list[i].Deserialize(data, offset); diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Diagnostic/msg/MDiagnosticArray.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Diagnostic/msg/MDiagnosticArray.cs index af9346da..151a8390 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Diagnostic/msg/MDiagnosticArray.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Diagnostic/msg/MDiagnosticArray.cs @@ -33,9 +33,9 @@ public override List SerializationStatements() { var listOfSerializations = new List(); listOfSerializations.AddRange(header.SerializationStatements()); - + listOfSerializations.Add(BitConverter.GetBytes(status.Length)); - foreach(var entry in status) + foreach (var entry in status) listOfSerializations.Add(entry.Serialize()); return listOfSerializations; @@ -44,11 +44,11 @@ public override List SerializationStatements() public override int Deserialize(byte[] data, int offset) { offset = this.header.Deserialize(data, offset); - + var statusArrayLength = DeserializeLength(data, offset); offset += 4; - this.status= new MDiagnosticStatus[statusArrayLength]; - for(var i = 0; i < statusArrayLength; i++) + this.status = new MDiagnosticStatus[statusArrayLength]; + for (var i = 0; i < statusArrayLength; i++) { this.status[i] = new MDiagnosticStatus(); offset = this.status[i].Deserialize(data, offset); diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Diagnostic/msg/MDiagnosticStatus.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Diagnostic/msg/MDiagnosticStatus.cs index 9548ab0b..8fdb7315 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Diagnostic/msg/MDiagnosticStatus.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Diagnostic/msg/MDiagnosticStatus.cs @@ -49,13 +49,13 @@ public MDiagnosticStatus(sbyte level, string name, string message, string hardwa public override List SerializationStatements() { var listOfSerializations = new List(); - listOfSerializations.Add(new[]{(byte)this.level}); + listOfSerializations.Add(new[] { (byte)this.level }); listOfSerializations.Add(SerializeString(this.name)); listOfSerializations.Add(SerializeString(this.message)); listOfSerializations.Add(SerializeString(this.hardware_id)); - + listOfSerializations.Add(BitConverter.GetBytes(values.Length)); - foreach(var entry in values) + foreach (var entry in values) listOfSerializations.Add(entry.Serialize()); return listOfSerializations; @@ -63,7 +63,7 @@ public override List SerializationStatements() public override int Deserialize(byte[] data, int offset) { - this.level = (sbyte)data[offset];; + this.level = (sbyte)data[offset]; ; offset += 1; var nameStringBytesLength = DeserializeLength(data, offset); offset += 4; @@ -77,11 +77,11 @@ public override int Deserialize(byte[] data, int offset) offset += 4; this.hardware_id = DeserializeString(data, offset, hardware_idStringBytesLength); offset += hardware_idStringBytesLength; - + var valuesArrayLength = DeserializeLength(data, offset); offset += 4; - this.values= new MKeyValue[valuesArrayLength]; - for(var i = 0; i < valuesArrayLength; i++) + this.values = new MKeyValue[valuesArrayLength]; + for (var i = 0; i < valuesArrayLength; i++) { this.values[i] = new MKeyValue(); offset = this.values[i].Deserialize(data, offset); diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Diagnostic/srv/MSelfTestResponse.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Diagnostic/srv/MSelfTestResponse.cs index cc84278d..d779b4d4 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Diagnostic/srv/MSelfTestResponse.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Diagnostic/srv/MSelfTestResponse.cs @@ -32,10 +32,10 @@ public override List SerializationStatements() { var listOfSerializations = new List(); listOfSerializations.Add(SerializeString(this.id)); - listOfSerializations.Add(new[]{(byte)this.passed}); - + listOfSerializations.Add(new[] { (byte)this.passed }); + listOfSerializations.Add(BitConverter.GetBytes(status.Length)); - foreach(var entry in status) + foreach (var entry in status) listOfSerializations.Add(entry.Serialize()); return listOfSerializations; @@ -47,13 +47,13 @@ public override int Deserialize(byte[] data, int offset) offset += 4; this.id = DeserializeString(data, offset, idStringBytesLength); offset += idStringBytesLength; - this.passed = (sbyte)data[offset];; + this.passed = (sbyte)data[offset]; ; offset += 1; - + var statusArrayLength = DeserializeLength(data, offset); offset += 4; - this.status= new MDiagnosticStatus[statusArrayLength]; - for(var i = 0; i < statusArrayLength; i++) + this.status = new MDiagnosticStatus[statusArrayLength]; + for (var i = 0; i < statusArrayLength; i++) { this.status[i] = new MDiagnosticStatus(); offset = this.status[i].Deserialize(data, offset); diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Geometry/msg/MAccelWithCovariance.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Geometry/msg/MAccelWithCovariance.cs index ff6f852c..a0d4cf97 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Geometry/msg/MAccelWithCovariance.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Geometry/msg/MAccelWithCovariance.cs @@ -34,9 +34,9 @@ public override List SerializationStatements() { var listOfSerializations = new List(); listOfSerializations.AddRange(accel.SerializationStatements()); - + Array.Resize(ref covariance, 36); - foreach(var entry in covariance) + foreach (var entry in covariance) listOfSerializations.Add(BitConverter.GetBytes(entry)); return listOfSerializations; @@ -45,9 +45,9 @@ public override List SerializationStatements() public override int Deserialize(byte[] data, int offset) { offset = this.accel.Deserialize(data, offset); - - this.covariance= new double[36]; - for(var i = 0; i < 36; i++) + + this.covariance = new double[36]; + for (var i = 0; i < 36; i++) { this.covariance[i] = BitConverter.ToDouble(data, offset); offset += 8; diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Geometry/msg/MPolygon.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Geometry/msg/MPolygon.cs index 66424ea4..0fea1531 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Geometry/msg/MPolygon.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Geometry/msg/MPolygon.cs @@ -26,9 +26,9 @@ public MPolygon(MPoint32[] points) public override List SerializationStatements() { var listOfSerializations = new List(); - + listOfSerializations.Add(BitConverter.GetBytes(points.Length)); - foreach(var entry in points) + foreach (var entry in points) listOfSerializations.Add(entry.Serialize()); return listOfSerializations; @@ -36,11 +36,11 @@ public override List SerializationStatements() public override int Deserialize(byte[] data, int offset) { - + var pointsArrayLength = DeserializeLength(data, offset); offset += 4; - this.points= new MPoint32[pointsArrayLength]; - for(var i = 0; i < pointsArrayLength; i++) + this.points = new MPoint32[pointsArrayLength]; + for (var i = 0; i < pointsArrayLength; i++) { this.points[i] = new MPoint32(); offset = this.points[i].Deserialize(data, offset); diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Geometry/msg/MPoseArray.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Geometry/msg/MPoseArray.cs index 5051ea1b..77183f54 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Geometry/msg/MPoseArray.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Geometry/msg/MPoseArray.cs @@ -31,9 +31,9 @@ public override List SerializationStatements() { var listOfSerializations = new List(); listOfSerializations.AddRange(header.SerializationStatements()); - + listOfSerializations.Add(BitConverter.GetBytes(poses.Length)); - foreach(var entry in poses) + foreach (var entry in poses) listOfSerializations.Add(entry.Serialize()); return listOfSerializations; @@ -42,11 +42,11 @@ public override List SerializationStatements() public override int Deserialize(byte[] data, int offset) { offset = this.header.Deserialize(data, offset); - + var posesArrayLength = DeserializeLength(data, offset); offset += 4; - this.poses= new MPose[posesArrayLength]; - for(var i = 0; i < posesArrayLength; i++) + this.poses = new MPose[posesArrayLength]; + for (var i = 0; i < posesArrayLength; i++) { this.poses[i] = new MPose(); offset = this.poses[i].Deserialize(data, offset); diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Geometry/msg/MPoseWithCovariance.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Geometry/msg/MPoseWithCovariance.cs index 0923ffdf..9f425da9 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Geometry/msg/MPoseWithCovariance.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Geometry/msg/MPoseWithCovariance.cs @@ -34,9 +34,9 @@ public override List SerializationStatements() { var listOfSerializations = new List(); listOfSerializations.AddRange(pose.SerializationStatements()); - + Array.Resize(ref covariance, 36); - foreach(var entry in covariance) + foreach (var entry in covariance) listOfSerializations.Add(BitConverter.GetBytes(entry)); return listOfSerializations; @@ -45,9 +45,9 @@ public override List SerializationStatements() public override int Deserialize(byte[] data, int offset) { offset = this.pose.Deserialize(data, offset); - - this.covariance= new double[36]; - for(var i = 0; i < 36; i++) + + this.covariance = new double[36]; + for (var i = 0; i < 36; i++) { this.covariance[i] = BitConverter.ToDouble(data, offset); offset += 8; diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Geometry/msg/MTwistWithCovariance.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Geometry/msg/MTwistWithCovariance.cs index b21eb4d3..15aabac1 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Geometry/msg/MTwistWithCovariance.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Geometry/msg/MTwistWithCovariance.cs @@ -34,9 +34,9 @@ public override List SerializationStatements() { var listOfSerializations = new List(); listOfSerializations.AddRange(twist.SerializationStatements()); - + Array.Resize(ref covariance, 36); - foreach(var entry in covariance) + foreach (var entry in covariance) listOfSerializations.Add(BitConverter.GetBytes(entry)); return listOfSerializations; @@ -45,9 +45,9 @@ public override List SerializationStatements() public override int Deserialize(byte[] data, int offset) { offset = this.twist.Deserialize(data, offset); - - this.covariance= new double[36]; - for(var i = 0; i < 36; i++) + + this.covariance = new double[36]; + for (var i = 0; i < 36; i++) { this.covariance[i] = BitConverter.ToDouble(data, offset); offset += 8; diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Nav/msg/MGridCells.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Nav/msg/MGridCells.cs index e9c8189b..437f700a 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Nav/msg/MGridCells.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Nav/msg/MGridCells.cs @@ -39,9 +39,9 @@ public override List SerializationStatements() listOfSerializations.AddRange(header.SerializationStatements()); listOfSerializations.Add(BitConverter.GetBytes(this.cell_width)); listOfSerializations.Add(BitConverter.GetBytes(this.cell_height)); - + listOfSerializations.Add(BitConverter.GetBytes(cells.Length)); - foreach(var entry in cells) + foreach (var entry in cells) listOfSerializations.Add(entry.Serialize()); return listOfSerializations; @@ -54,11 +54,11 @@ public override int Deserialize(byte[] data, int offset) offset += 4; this.cell_height = BitConverter.ToSingle(data, offset); offset += 4; - + var cellsArrayLength = DeserializeLength(data, offset); offset += 4; - this.cells= new Geometry.MPoint[cellsArrayLength]; - for(var i = 0; i < cellsArrayLength; i++) + this.cells = new Geometry.MPoint[cellsArrayLength]; + for (var i = 0; i < cellsArrayLength; i++) { this.cells[i] = new Geometry.MPoint(); offset = this.cells[i].Deserialize(data, offset); diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Nav/msg/MOccupancyGrid.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Nav/msg/MOccupancyGrid.cs index f805e585..6d9c3e8f 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Nav/msg/MOccupancyGrid.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Nav/msg/MOccupancyGrid.cs @@ -39,9 +39,9 @@ public override List SerializationStatements() var listOfSerializations = new List(); listOfSerializations.AddRange(header.SerializationStatements()); listOfSerializations.AddRange(info.SerializationStatements()); - + listOfSerializations.Add(BitConverter.GetBytes(data.Length)); - listOfSerializations.Add((byte[]) (Array)this.data); + listOfSerializations.Add((byte[])(Array)this.data); return listOfSerializations; } @@ -50,11 +50,11 @@ public override int Deserialize(byte[] data, int offset) { offset = this.header.Deserialize(data, offset); offset = this.info.Deserialize(data, offset); - + var dataArrayLength = DeserializeLength(data, offset); offset += 4; - this.data= new sbyte[dataArrayLength]; - for(var i = 0; i < dataArrayLength; i++) + this.data = new sbyte[dataArrayLength]; + for (var i = 0; i < dataArrayLength; i++) { this.data[i] = (sbyte)data[offset]; offset += 1; diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Nav/msg/MPath.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Nav/msg/MPath.cs index 6d5c8d5e..cc057cf7 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Nav/msg/MPath.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Nav/msg/MPath.cs @@ -31,9 +31,9 @@ public override List SerializationStatements() { var listOfSerializations = new List(); listOfSerializations.AddRange(header.SerializationStatements()); - + listOfSerializations.Add(BitConverter.GetBytes(poses.Length)); - foreach(var entry in poses) + foreach (var entry in poses) listOfSerializations.Add(entry.Serialize()); return listOfSerializations; @@ -42,11 +42,11 @@ public override List SerializationStatements() public override int Deserialize(byte[] data, int offset) { offset = this.header.Deserialize(data, offset); - + var posesArrayLength = DeserializeLength(data, offset); offset += 4; - this.poses= new Geometry.MPoseStamped[posesArrayLength]; - for(var i = 0; i < posesArrayLength; i++) + this.poses = new Geometry.MPoseStamped[posesArrayLength]; + for (var i = 0; i < posesArrayLength; i++) { this.poses[i] = new Geometry.MPoseStamped(); offset = this.poses[i].Deserialize(data, offset); diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Nav/srv/MLoadMapResponse.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Nav/srv/MLoadMapResponse.cs index 3337e69b..916d19ca 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Nav/srv/MLoadMapResponse.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Nav/srv/MLoadMapResponse.cs @@ -36,7 +36,7 @@ public override List SerializationStatements() { var listOfSerializations = new List(); listOfSerializations.AddRange(map.SerializationStatements()); - listOfSerializations.Add(new[]{this.result}); + listOfSerializations.Add(new[] { this.result }); return listOfSerializations; } @@ -44,7 +44,7 @@ public override List SerializationStatements() public override int Deserialize(byte[] data, int offset) { offset = this.map.Deserialize(data, offset); - this.result = data[offset];; + this.result = data[offset]; ; offset += 1; return offset; diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/ObjectRecognition/action/MObjectRecognitionGoal.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/ObjectRecognition/action/MObjectRecognitionGoal.cs index 2606c581..6367144a 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/ObjectRecognition/action/MObjectRecognitionGoal.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/ObjectRecognition/action/MObjectRecognitionGoal.cs @@ -30,9 +30,9 @@ public override List SerializationStatements() { var listOfSerializations = new List(); listOfSerializations.Add(BitConverter.GetBytes(this.use_roi)); - + listOfSerializations.Add(BitConverter.GetBytes(filter_limits.Length)); - foreach(var entry in filter_limits) + foreach (var entry in filter_limits) listOfSerializations.Add(BitConverter.GetBytes(entry)); return listOfSerializations; @@ -42,11 +42,11 @@ public override int Deserialize(byte[] data, int offset) { this.use_roi = BitConverter.ToBoolean(data, offset); offset += 1; - + var filter_limitsArrayLength = DeserializeLength(data, offset); offset += 4; - this.filter_limits= new float[filter_limitsArrayLength]; - for(var i = 0; i < filter_limitsArrayLength; i++) + this.filter_limits = new float[filter_limitsArrayLength]; + for (var i = 0; i < filter_limitsArrayLength; i++) { this.filter_limits[i] = BitConverter.ToSingle(data, offset); offset += 4; diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/ObjectRecognition/msg/MRecognizedObject.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/ObjectRecognition/msg/MRecognizedObject.cs index ad5c497c..486ba5bd 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/ObjectRecognition/msg/MRecognizedObject.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/ObjectRecognition/msg/MRecognizedObject.cs @@ -66,14 +66,14 @@ public override List SerializationStatements() listOfSerializations.AddRange(header.SerializationStatements()); listOfSerializations.AddRange(type.SerializationStatements()); listOfSerializations.Add(BitConverter.GetBytes(this.confidence)); - + listOfSerializations.Add(BitConverter.GetBytes(point_clouds.Length)); - foreach(var entry in point_clouds) + foreach (var entry in point_clouds) listOfSerializations.Add(entry.Serialize()); listOfSerializations.AddRange(bounding_mesh.SerializationStatements()); - + listOfSerializations.Add(BitConverter.GetBytes(bounding_contours.Length)); - foreach(var entry in bounding_contours) + foreach (var entry in bounding_contours) listOfSerializations.Add(entry.Serialize()); listOfSerializations.AddRange(pose.SerializationStatements()); @@ -86,21 +86,21 @@ public override int Deserialize(byte[] data, int offset) offset = this.type.Deserialize(data, offset); this.confidence = BitConverter.ToSingle(data, offset); offset += 4; - + var point_cloudsArrayLength = DeserializeLength(data, offset); offset += 4; - this.point_clouds= new Sensor.MPointCloud2[point_cloudsArrayLength]; - for(var i = 0; i < point_cloudsArrayLength; i++) + this.point_clouds = new Sensor.MPointCloud2[point_cloudsArrayLength]; + for (var i = 0; i < point_cloudsArrayLength; i++) { this.point_clouds[i] = new Sensor.MPointCloud2(); offset = this.point_clouds[i].Deserialize(data, offset); } offset = this.bounding_mesh.Deserialize(data, offset); - + var bounding_contoursArrayLength = DeserializeLength(data, offset); offset += 4; - this.bounding_contours= new Geometry.MPoint[bounding_contoursArrayLength]; - for(var i = 0; i < bounding_contoursArrayLength; i++) + this.bounding_contours = new Geometry.MPoint[bounding_contoursArrayLength]; + for (var i = 0; i < bounding_contoursArrayLength; i++) { this.bounding_contours[i] = new Geometry.MPoint(); offset = this.bounding_contours[i].Deserialize(data, offset); diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/ObjectRecognition/msg/MRecognizedObjectArray.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/ObjectRecognition/msg/MRecognizedObjectArray.cs index 12e7a1a6..8c2f981a 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/ObjectRecognition/msg/MRecognizedObjectArray.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/ObjectRecognition/msg/MRecognizedObjectArray.cs @@ -37,13 +37,13 @@ public override List SerializationStatements() { var listOfSerializations = new List(); listOfSerializations.AddRange(header.SerializationStatements()); - + listOfSerializations.Add(BitConverter.GetBytes(objects.Length)); - foreach(var entry in objects) + foreach (var entry in objects) listOfSerializations.Add(entry.Serialize()); - + listOfSerializations.Add(BitConverter.GetBytes(cooccurrence.Length)); - foreach(var entry in cooccurrence) + foreach (var entry in cooccurrence) listOfSerializations.Add(BitConverter.GetBytes(entry)); return listOfSerializations; @@ -52,20 +52,20 @@ public override List SerializationStatements() public override int Deserialize(byte[] data, int offset) { offset = this.header.Deserialize(data, offset); - + var objectsArrayLength = DeserializeLength(data, offset); offset += 4; - this.objects= new MRecognizedObject[objectsArrayLength]; - for(var i = 0; i < objectsArrayLength; i++) + this.objects = new MRecognizedObject[objectsArrayLength]; + for (var i = 0; i < objectsArrayLength; i++) { this.objects[i] = new MRecognizedObject(); offset = this.objects[i].Deserialize(data, offset); } - + var cooccurrenceArrayLength = DeserializeLength(data, offset); offset += 4; - this.cooccurrence= new float[cooccurrenceArrayLength]; - for(var i = 0; i < cooccurrenceArrayLength; i++) + this.cooccurrence = new float[cooccurrenceArrayLength]; + for (var i = 0; i < cooccurrenceArrayLength; i++) { this.cooccurrence[i] = BitConverter.ToSingle(data, offset); offset += 4; diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/ObjectRecognition/msg/MTable.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/ObjectRecognition/msg/MTable.cs index 38c60a1c..3996bd68 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/ObjectRecognition/msg/MTable.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/ObjectRecognition/msg/MTable.cs @@ -42,9 +42,9 @@ public override List SerializationStatements() var listOfSerializations = new List(); listOfSerializations.AddRange(header.SerializationStatements()); listOfSerializations.AddRange(pose.SerializationStatements()); - + listOfSerializations.Add(BitConverter.GetBytes(convex_hull.Length)); - foreach(var entry in convex_hull) + foreach (var entry in convex_hull) listOfSerializations.Add(entry.Serialize()); return listOfSerializations; @@ -54,11 +54,11 @@ public override int Deserialize(byte[] data, int offset) { offset = this.header.Deserialize(data, offset); offset = this.pose.Deserialize(data, offset); - + var convex_hullArrayLength = DeserializeLength(data, offset); offset += 4; - this.convex_hull= new Geometry.MPoint[convex_hullArrayLength]; - for(var i = 0; i < convex_hullArrayLength; i++) + this.convex_hull = new Geometry.MPoint[convex_hullArrayLength]; + for (var i = 0; i < convex_hullArrayLength; i++) { this.convex_hull[i] = new Geometry.MPoint(); offset = this.convex_hull[i].Deserialize(data, offset); diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/ObjectRecognition/msg/MTableArray.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/ObjectRecognition/msg/MTableArray.cs index 2ff21a76..d553624b 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/ObjectRecognition/msg/MTableArray.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/ObjectRecognition/msg/MTableArray.cs @@ -31,9 +31,9 @@ public override List SerializationStatements() { var listOfSerializations = new List(); listOfSerializations.AddRange(header.SerializationStatements()); - + listOfSerializations.Add(BitConverter.GetBytes(tables.Length)); - foreach(var entry in tables) + foreach (var entry in tables) listOfSerializations.Add(entry.Serialize()); return listOfSerializations; @@ -42,11 +42,11 @@ public override List SerializationStatements() public override int Deserialize(byte[] data, int offset) { offset = this.header.Deserialize(data, offset); - + var tablesArrayLength = DeserializeLength(data, offset); offset += 4; - this.tables= new MTable[tablesArrayLength]; - for(var i = 0; i < tablesArrayLength; i++) + this.tables = new MTable[tablesArrayLength]; + for (var i = 0; i < tablesArrayLength; i++) { this.tables[i] = new MTable(); offset = this.tables[i].Deserialize(data, offset); diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Octomap/msg/MOctomap.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Octomap/msg/MOctomap.cs index 5fbe7340..f9a1b3b4 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Octomap/msg/MOctomap.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Octomap/msg/MOctomap.cs @@ -47,9 +47,9 @@ public override List SerializationStatements() listOfSerializations.Add(BitConverter.GetBytes(this.binary)); listOfSerializations.Add(SerializeString(this.id)); listOfSerializations.Add(BitConverter.GetBytes(this.resolution)); - + listOfSerializations.Add(BitConverter.GetBytes(data.Length)); - listOfSerializations.Add((byte[]) (Array)this.data); + listOfSerializations.Add((byte[])(Array)this.data); return listOfSerializations; } @@ -65,11 +65,11 @@ public override int Deserialize(byte[] data, int offset) offset += idStringBytesLength; this.resolution = BitConverter.ToDouble(data, offset); offset += 8; - + var dataArrayLength = DeserializeLength(data, offset); offset += 4; - this.data= new sbyte[dataArrayLength]; - for(var i = 0; i < dataArrayLength; i++) + this.data = new sbyte[dataArrayLength]; + for (var i = 0; i < dataArrayLength; i++) { this.data[i] = (sbyte)data[offset]; offset += 1; diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/RosTcpEndpoint/msg/MRosUnitySrvMessage.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/RosTcpEndpoint/msg/MRosUnitySrvMessage.cs index 163288fc..b320bd17 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/RosTcpEndpoint/msg/MRosUnitySrvMessage.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/RosTcpEndpoint/msg/MRosUnitySrvMessage.cs @@ -37,7 +37,7 @@ public override List SerializationStatements() listOfSerializations.Add(BitConverter.GetBytes(this.srv_id)); listOfSerializations.Add(BitConverter.GetBytes(this.is_request)); listOfSerializations.Add(SerializeString(this.topic)); - + listOfSerializations.Add(BitConverter.GetBytes(payload.Length)); listOfSerializations.Add(this.payload); @@ -54,11 +54,11 @@ public override int Deserialize(byte[] data, int offset) offset += 4; this.topic = DeserializeString(data, offset, topicStringBytesLength); offset += topicStringBytesLength; - + var payloadArrayLength = DeserializeLength(data, offset); offset += 4; - this.payload= new byte[payloadArrayLength]; - for(var i = 0; i < payloadArrayLength; i++) + this.payload = new byte[payloadArrayLength]; + for (var i = 0; i < payloadArrayLength; i++) { this.payload[i] = data[offset]; offset += 1; diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/RosTcpEndpoint/srv/MRosUnityTopicListResponse.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/RosTcpEndpoint/srv/MRosUnityTopicListResponse.cs index edeb1534..43ac91ba 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/RosTcpEndpoint/srv/MRosUnityTopicListResponse.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/RosTcpEndpoint/srv/MRosUnityTopicListResponse.cs @@ -25,9 +25,9 @@ public MRosUnityTopicListResponse(string[] topics) public override List SerializationStatements() { var listOfSerializations = new List(); - + listOfSerializations.Add(BitConverter.GetBytes(topics.Length)); - foreach(var entry in topics) + foreach (var entry in topics) listOfSerializations.Add(SerializeString(entry)); return listOfSerializations; @@ -35,11 +35,11 @@ public override List SerializationStatements() public override int Deserialize(byte[] data, int offset) { - + var topicsArrayLength = DeserializeLength(data, offset); offset += 4; - this.topics= new string[topicsArrayLength]; - for(var i = 0; i < topicsArrayLength; i++) + this.topics = new string[topicsArrayLength]; + for (var i = 0; i < topicsArrayLength; i++) { var topicsStringBytesLength = DeserializeLength(data, offset); offset += 4; diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MBatteryState.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MBatteryState.cs index 8c1a6b7b..a9fcefc5 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MBatteryState.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MBatteryState.cs @@ -124,17 +124,17 @@ public override List SerializationStatements() listOfSerializations.Add(BitConverter.GetBytes(this.capacity)); listOfSerializations.Add(BitConverter.GetBytes(this.design_capacity)); listOfSerializations.Add(BitConverter.GetBytes(this.percentage)); - listOfSerializations.Add(new[]{this.power_supply_status}); - listOfSerializations.Add(new[]{this.power_supply_health}); - listOfSerializations.Add(new[]{this.power_supply_technology}); + listOfSerializations.Add(new[] { this.power_supply_status }); + listOfSerializations.Add(new[] { this.power_supply_health }); + listOfSerializations.Add(new[] { this.power_supply_technology }); listOfSerializations.Add(BitConverter.GetBytes(this.present)); - + listOfSerializations.Add(BitConverter.GetBytes(cell_voltage.Length)); - foreach(var entry in cell_voltage) + foreach (var entry in cell_voltage) listOfSerializations.Add(BitConverter.GetBytes(entry)); - + listOfSerializations.Add(BitConverter.GetBytes(cell_temperature.Length)); - foreach(var entry in cell_temperature) + foreach (var entry in cell_temperature) listOfSerializations.Add(BitConverter.GetBytes(entry)); listOfSerializations.Add(SerializeString(this.location)); listOfSerializations.Add(SerializeString(this.serial_number)); @@ -159,28 +159,28 @@ public override int Deserialize(byte[] data, int offset) offset += 4; this.percentage = BitConverter.ToSingle(data, offset); offset += 4; - this.power_supply_status = data[offset];; + this.power_supply_status = data[offset]; ; offset += 1; - this.power_supply_health = data[offset];; + this.power_supply_health = data[offset]; ; offset += 1; - this.power_supply_technology = data[offset];; + this.power_supply_technology = data[offset]; ; offset += 1; this.present = BitConverter.ToBoolean(data, offset); offset += 1; - + var cell_voltageArrayLength = DeserializeLength(data, offset); offset += 4; - this.cell_voltage= new float[cell_voltageArrayLength]; - for(var i = 0; i < cell_voltageArrayLength; i++) + this.cell_voltage = new float[cell_voltageArrayLength]; + for (var i = 0; i < cell_voltageArrayLength; i++) { this.cell_voltage[i] = BitConverter.ToSingle(data, offset); offset += 4; } - + var cell_temperatureArrayLength = DeserializeLength(data, offset); offset += 4; - this.cell_temperature= new float[cell_temperatureArrayLength]; - for(var i = 0; i < cell_temperatureArrayLength; i++) + this.cell_temperature = new float[cell_temperatureArrayLength]; + for (var i = 0; i < cell_temperatureArrayLength; i++) { this.cell_temperature[i] = BitConverter.ToSingle(data, offset); offset += 4; diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MCameraInfo.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MCameraInfo.cs index d46fd0c7..e67d2532 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MCameraInfo.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MCameraInfo.cs @@ -170,21 +170,21 @@ public override List SerializationStatements() listOfSerializations.Add(BitConverter.GetBytes(this.height)); listOfSerializations.Add(BitConverter.GetBytes(this.width)); listOfSerializations.Add(SerializeString(this.distortion_model)); - + listOfSerializations.Add(BitConverter.GetBytes(D.Length)); - foreach(var entry in D) + foreach (var entry in D) listOfSerializations.Add(BitConverter.GetBytes(entry)); - + Array.Resize(ref K, 9); - foreach(var entry in K) + foreach (var entry in K) listOfSerializations.Add(BitConverter.GetBytes(entry)); - + Array.Resize(ref R, 9); - foreach(var entry in R) + foreach (var entry in R) listOfSerializations.Add(BitConverter.GetBytes(entry)); - + Array.Resize(ref P, 12); - foreach(var entry in P) + foreach (var entry in P) listOfSerializations.Add(BitConverter.GetBytes(entry)); listOfSerializations.Add(BitConverter.GetBytes(this.binning_x)); listOfSerializations.Add(BitConverter.GetBytes(this.binning_y)); @@ -204,32 +204,32 @@ public override int Deserialize(byte[] data, int offset) offset += 4; this.distortion_model = DeserializeString(data, offset, distortion_modelStringBytesLength); offset += distortion_modelStringBytesLength; - + var DArrayLength = DeserializeLength(data, offset); offset += 4; - this.D= new double[DArrayLength]; - for(var i = 0; i < DArrayLength; i++) + this.D = new double[DArrayLength]; + for (var i = 0; i < DArrayLength; i++) { this.D[i] = BitConverter.ToDouble(data, offset); offset += 8; } - - this.K= new double[9]; - for(var i = 0; i < 9; i++) + + this.K = new double[9]; + for (var i = 0; i < 9; i++) { this.K[i] = BitConverter.ToDouble(data, offset); offset += 8; } - - this.R= new double[9]; - for(var i = 0; i < 9; i++) + + this.R = new double[9]; + for (var i = 0; i < 9; i++) { this.R[i] = BitConverter.ToDouble(data, offset); offset += 8; } - - this.P= new double[12]; - for(var i = 0; i < 12; i++) + + this.P = new double[12]; + for (var i = 0; i < 12; i++) { this.P[i] = BitConverter.ToDouble(data, offset); offset += 8; diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MChannelFloat32.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MChannelFloat32.cs index 27522a90..a2e01a11 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MChannelFloat32.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MChannelFloat32.cs @@ -48,9 +48,9 @@ public override List SerializationStatements() { var listOfSerializations = new List(); listOfSerializations.Add(SerializeString(this.name)); - + listOfSerializations.Add(BitConverter.GetBytes(values.Length)); - foreach(var entry in values) + foreach (var entry in values) listOfSerializations.Add(BitConverter.GetBytes(entry)); return listOfSerializations; @@ -62,11 +62,11 @@ public override int Deserialize(byte[] data, int offset) offset += 4; this.name = DeserializeString(data, offset, nameStringBytesLength); offset += nameStringBytesLength; - + var valuesArrayLength = DeserializeLength(data, offset); offset += 4; - this.values= new float[valuesArrayLength]; - for(var i = 0; i < valuesArrayLength; i++) + this.values = new float[valuesArrayLength]; + for (var i = 0; i < valuesArrayLength; i++) { this.values[i] = BitConverter.ToSingle(data, offset); offset += 4; diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MCompressedImage.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MCompressedImage.cs index 81dd6ec9..a493c7d6 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MCompressedImage.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MCompressedImage.cs @@ -45,7 +45,7 @@ public override List SerializationStatements() var listOfSerializations = new List(); listOfSerializations.AddRange(header.SerializationStatements()); listOfSerializations.Add(SerializeString(this.format)); - + listOfSerializations.Add(BitConverter.GetBytes(data.Length)); listOfSerializations.Add(this.data); @@ -59,11 +59,11 @@ public override int Deserialize(byte[] data, int offset) offset += 4; this.format = DeserializeString(data, offset, formatStringBytesLength); offset += formatStringBytesLength; - + var dataArrayLength = DeserializeLength(data, offset); offset += 4; - this.data= new byte[dataArrayLength]; - for(var i = 0; i < dataArrayLength; i++) + this.data = new byte[dataArrayLength]; + for (var i = 0; i < dataArrayLength; i++) { this.data[i] = data[offset]; offset += 1; diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MImage.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MImage.cs index a1ece9da..ccd4d0fd 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MImage.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MImage.cs @@ -70,9 +70,9 @@ public override List SerializationStatements() listOfSerializations.Add(BitConverter.GetBytes(this.height)); listOfSerializations.Add(BitConverter.GetBytes(this.width)); listOfSerializations.Add(SerializeString(this.encoding)); - listOfSerializations.Add(new[]{this.is_bigendian}); + listOfSerializations.Add(new[] { this.is_bigendian }); listOfSerializations.Add(BitConverter.GetBytes(this.step)); - + listOfSerializations.Add(BitConverter.GetBytes(data.Length)); listOfSerializations.Add(this.data); @@ -90,15 +90,15 @@ public override int Deserialize(byte[] data, int offset) offset += 4; this.encoding = DeserializeString(data, offset, encodingStringBytesLength); offset += encodingStringBytesLength; - this.is_bigendian = data[offset];; + this.is_bigendian = data[offset]; ; offset += 1; this.step = BitConverter.ToUInt32(data, offset); offset += 4; - + var dataArrayLength = DeserializeLength(data, offset); offset += 4; - this.data= new byte[dataArrayLength]; - for(var i = 0; i < dataArrayLength; i++) + this.data = new byte[dataArrayLength]; + for (var i = 0; i < dataArrayLength; i++) { this.data[i] = data[offset]; offset += 1; diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MImu.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MImu.cs index a7f0230f..484250e8 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MImu.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MImu.cs @@ -62,19 +62,19 @@ public override List SerializationStatements() var listOfSerializations = new List(); listOfSerializations.AddRange(header.SerializationStatements()); listOfSerializations.AddRange(orientation.SerializationStatements()); - + Array.Resize(ref orientation_covariance, 9); - foreach(var entry in orientation_covariance) + foreach (var entry in orientation_covariance) listOfSerializations.Add(BitConverter.GetBytes(entry)); listOfSerializations.AddRange(angular_velocity.SerializationStatements()); - + Array.Resize(ref angular_velocity_covariance, 9); - foreach(var entry in angular_velocity_covariance) + foreach (var entry in angular_velocity_covariance) listOfSerializations.Add(BitConverter.GetBytes(entry)); listOfSerializations.AddRange(linear_acceleration.SerializationStatements()); - + Array.Resize(ref linear_acceleration_covariance, 9); - foreach(var entry in linear_acceleration_covariance) + foreach (var entry in linear_acceleration_covariance) listOfSerializations.Add(BitConverter.GetBytes(entry)); return listOfSerializations; @@ -84,25 +84,25 @@ public override int Deserialize(byte[] data, int offset) { offset = this.header.Deserialize(data, offset); offset = this.orientation.Deserialize(data, offset); - - this.orientation_covariance= new double[9]; - for(var i = 0; i < 9; i++) + + this.orientation_covariance = new double[9]; + for (var i = 0; i < 9; i++) { this.orientation_covariance[i] = BitConverter.ToDouble(data, offset); offset += 8; } offset = this.angular_velocity.Deserialize(data, offset); - - this.angular_velocity_covariance= new double[9]; - for(var i = 0; i < 9; i++) + + this.angular_velocity_covariance = new double[9]; + for (var i = 0; i < 9; i++) { this.angular_velocity_covariance[i] = BitConverter.ToDouble(data, offset); offset += 8; } offset = this.linear_acceleration.Deserialize(data, offset); - - this.linear_acceleration_covariance= new double[9]; - for(var i = 0; i < 9; i++) + + this.linear_acceleration_covariance = new double[9]; + for (var i = 0; i < 9; i++) { this.linear_acceleration_covariance[i] = BitConverter.ToDouble(data, offset); offset += 8; diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MJointState.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MJointState.cs index aab8158a..57d5f2b1 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MJointState.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MJointState.cs @@ -57,21 +57,21 @@ public override List SerializationStatements() { var listOfSerializations = new List(); listOfSerializations.AddRange(header.SerializationStatements()); - + listOfSerializations.Add(BitConverter.GetBytes(name.Length)); - foreach(var entry in name) + foreach (var entry in name) listOfSerializations.Add(SerializeString(entry)); - + listOfSerializations.Add(BitConverter.GetBytes(position.Length)); - foreach(var entry in position) + foreach (var entry in position) listOfSerializations.Add(BitConverter.GetBytes(entry)); - + listOfSerializations.Add(BitConverter.GetBytes(velocity.Length)); - foreach(var entry in velocity) + foreach (var entry in velocity) listOfSerializations.Add(BitConverter.GetBytes(entry)); - + listOfSerializations.Add(BitConverter.GetBytes(effort.Length)); - foreach(var entry in effort) + foreach (var entry in effort) listOfSerializations.Add(BitConverter.GetBytes(entry)); return listOfSerializations; @@ -80,40 +80,40 @@ public override List SerializationStatements() public override int Deserialize(byte[] data, int offset) { offset = this.header.Deserialize(data, offset); - + var nameArrayLength = DeserializeLength(data, offset); offset += 4; - this.name= new string[nameArrayLength]; - for(var i = 0; i < nameArrayLength; i++) + this.name = new string[nameArrayLength]; + for (var i = 0; i < nameArrayLength; i++) { var nameStringBytesLength = DeserializeLength(data, offset); offset += 4; this.name[i] = DeserializeString(data, offset, nameStringBytesLength); offset += nameStringBytesLength; } - + var positionArrayLength = DeserializeLength(data, offset); offset += 4; - this.position= new double[positionArrayLength]; - for(var i = 0; i < positionArrayLength; i++) + this.position = new double[positionArrayLength]; + for (var i = 0; i < positionArrayLength; i++) { this.position[i] = BitConverter.ToDouble(data, offset); offset += 8; } - + var velocityArrayLength = DeserializeLength(data, offset); offset += 4; - this.velocity= new double[velocityArrayLength]; - for(var i = 0; i < velocityArrayLength; i++) + this.velocity = new double[velocityArrayLength]; + for (var i = 0; i < velocityArrayLength; i++) { this.velocity[i] = BitConverter.ToDouble(data, offset); offset += 8; } - + var effortArrayLength = DeserializeLength(data, offset); offset += 4; - this.effort= new double[effortArrayLength]; - for(var i = 0; i < effortArrayLength; i++) + this.effort = new double[effortArrayLength]; + for (var i = 0; i < effortArrayLength; i++) { this.effort[i] = BitConverter.ToDouble(data, offset); offset += 8; diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MJoy.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MJoy.cs index f1650c54..9fcc129a 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MJoy.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MJoy.cs @@ -37,13 +37,13 @@ public override List SerializationStatements() { var listOfSerializations = new List(); listOfSerializations.AddRange(header.SerializationStatements()); - + listOfSerializations.Add(BitConverter.GetBytes(axes.Length)); - foreach(var entry in axes) + foreach (var entry in axes) listOfSerializations.Add(BitConverter.GetBytes(entry)); - + listOfSerializations.Add(BitConverter.GetBytes(buttons.Length)); - foreach(var entry in buttons) + foreach (var entry in buttons) listOfSerializations.Add(BitConverter.GetBytes(entry)); return listOfSerializations; @@ -52,20 +52,20 @@ public override List SerializationStatements() public override int Deserialize(byte[] data, int offset) { offset = this.header.Deserialize(data, offset); - + var axesArrayLength = DeserializeLength(data, offset); offset += 4; - this.axes= new float[axesArrayLength]; - for(var i = 0; i < axesArrayLength; i++) + this.axes = new float[axesArrayLength]; + for (var i = 0; i < axesArrayLength; i++) { this.axes[i] = BitConverter.ToSingle(data, offset); offset += 4; } - + var buttonsArrayLength = DeserializeLength(data, offset); offset += 4; - this.buttons= new int[buttonsArrayLength]; - for(var i = 0; i < buttonsArrayLength; i++) + this.buttons = new int[buttonsArrayLength]; + for (var i = 0; i < buttonsArrayLength; i++) { this.buttons[i] = BitConverter.ToInt32(data, offset); offset += 4; diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MJoyFeedback.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MJoyFeedback.cs index 8bd1e278..7afad5c2 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MJoyFeedback.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MJoyFeedback.cs @@ -39,8 +39,8 @@ public MJoyFeedback(byte type, byte id, float intensity) public override List SerializationStatements() { var listOfSerializations = new List(); - listOfSerializations.Add(new[]{this.type}); - listOfSerializations.Add(new[]{this.id}); + listOfSerializations.Add(new[] { this.type }); + listOfSerializations.Add(new[] { this.id }); listOfSerializations.Add(BitConverter.GetBytes(this.intensity)); return listOfSerializations; @@ -48,9 +48,9 @@ public override List SerializationStatements() public override int Deserialize(byte[] data, int offset) { - this.type = data[offset];; + this.type = data[offset]; ; offset += 1; - this.id = data[offset];; + this.id = data[offset]; ; offset += 1; this.intensity = BitConverter.ToSingle(data, offset); offset += 4; diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MJoyFeedbackArray.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MJoyFeedbackArray.cs index 1db66d13..9c298da6 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MJoyFeedbackArray.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MJoyFeedbackArray.cs @@ -26,9 +26,9 @@ public MJoyFeedbackArray(MJoyFeedback[] array) public override List SerializationStatements() { var listOfSerializations = new List(); - + listOfSerializations.Add(BitConverter.GetBytes(array.Length)); - foreach(var entry in array) + foreach (var entry in array) listOfSerializations.Add(entry.Serialize()); return listOfSerializations; @@ -36,11 +36,11 @@ public override List SerializationStatements() public override int Deserialize(byte[] data, int offset) { - + var arrayArrayLength = DeserializeLength(data, offset); offset += 4; - this.array= new MJoyFeedback[arrayArrayLength]; - for(var i = 0; i < arrayArrayLength; i++) + this.array = new MJoyFeedback[arrayArrayLength]; + for (var i = 0; i < arrayArrayLength; i++) { this.array[i] = new MJoyFeedback(); offset = this.array[i].Deserialize(data, offset); diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MLaserEcho.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MLaserEcho.cs index 81f40a41..8a9b6fe4 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MLaserEcho.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MLaserEcho.cs @@ -29,9 +29,9 @@ public MLaserEcho(float[] echoes) public override List SerializationStatements() { var listOfSerializations = new List(); - + listOfSerializations.Add(BitConverter.GetBytes(echoes.Length)); - foreach(var entry in echoes) + foreach (var entry in echoes) listOfSerializations.Add(BitConverter.GetBytes(entry)); return listOfSerializations; @@ -39,11 +39,11 @@ public override List SerializationStatements() public override int Deserialize(byte[] data, int offset) { - + var echoesArrayLength = DeserializeLength(data, offset); offset += 4; - this.echoes= new float[echoesArrayLength]; - for(var i = 0; i < echoesArrayLength; i++) + this.echoes = new float[echoesArrayLength]; + for (var i = 0; i < echoesArrayLength; i++) { this.echoes[i] = BitConverter.ToSingle(data, offset); offset += 4; diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MLaserScan.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MLaserScan.cs index 85ef5a99..8e5d7e04 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MLaserScan.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MLaserScan.cs @@ -85,13 +85,13 @@ public override List SerializationStatements() listOfSerializations.Add(BitConverter.GetBytes(this.scan_time)); listOfSerializations.Add(BitConverter.GetBytes(this.range_min)); listOfSerializations.Add(BitConverter.GetBytes(this.range_max)); - + listOfSerializations.Add(BitConverter.GetBytes(ranges.Length)); - foreach(var entry in ranges) + foreach (var entry in ranges) listOfSerializations.Add(BitConverter.GetBytes(entry)); - + listOfSerializations.Add(BitConverter.GetBytes(intensities.Length)); - foreach(var entry in intensities) + foreach (var entry in intensities) listOfSerializations.Add(BitConverter.GetBytes(entry)); return listOfSerializations; @@ -114,20 +114,20 @@ public override int Deserialize(byte[] data, int offset) offset += 4; this.range_max = BitConverter.ToSingle(data, offset); offset += 4; - + var rangesArrayLength = DeserializeLength(data, offset); offset += 4; - this.ranges= new float[rangesArrayLength]; - for(var i = 0; i < rangesArrayLength; i++) + this.ranges = new float[rangesArrayLength]; + for (var i = 0; i < rangesArrayLength; i++) { this.ranges[i] = BitConverter.ToSingle(data, offset); offset += 4; } - + var intensitiesArrayLength = DeserializeLength(data, offset); offset += 4; - this.intensities= new float[intensitiesArrayLength]; - for(var i = 0; i < intensitiesArrayLength; i++) + this.intensities = new float[intensitiesArrayLength]; + for (var i = 0; i < intensitiesArrayLength; i++) { this.intensities[i] = BitConverter.ToSingle(data, offset); offset += 4; diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MMagneticField.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MMagneticField.cs index bd122da1..0c78ffda 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MMagneticField.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MMagneticField.cs @@ -51,9 +51,9 @@ public override List SerializationStatements() var listOfSerializations = new List(); listOfSerializations.AddRange(header.SerializationStatements()); listOfSerializations.AddRange(magnetic_field.SerializationStatements()); - + Array.Resize(ref magnetic_field_covariance, 9); - foreach(var entry in magnetic_field_covariance) + foreach (var entry in magnetic_field_covariance) listOfSerializations.Add(BitConverter.GetBytes(entry)); return listOfSerializations; @@ -63,9 +63,9 @@ public override int Deserialize(byte[] data, int offset) { offset = this.header.Deserialize(data, offset); offset = this.magnetic_field.Deserialize(data, offset); - - this.magnetic_field_covariance= new double[9]; - for(var i = 0; i < 9; i++) + + this.magnetic_field_covariance = new double[9]; + for (var i = 0; i < 9; i++) { this.magnetic_field_covariance[i] = BitConverter.ToDouble(data, offset); offset += 8; diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MMultiDOFJointState.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MMultiDOFJointState.cs index 382a03b5..61b119c0 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MMultiDOFJointState.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MMultiDOFJointState.cs @@ -58,21 +58,21 @@ public override List SerializationStatements() { var listOfSerializations = new List(); listOfSerializations.AddRange(header.SerializationStatements()); - + listOfSerializations.Add(BitConverter.GetBytes(joint_names.Length)); - foreach(var entry in joint_names) + foreach (var entry in joint_names) listOfSerializations.Add(SerializeString(entry)); - + listOfSerializations.Add(BitConverter.GetBytes(transforms.Length)); - foreach(var entry in transforms) + foreach (var entry in transforms) listOfSerializations.Add(entry.Serialize()); - + listOfSerializations.Add(BitConverter.GetBytes(twist.Length)); - foreach(var entry in twist) + foreach (var entry in twist) listOfSerializations.Add(entry.Serialize()); - + listOfSerializations.Add(BitConverter.GetBytes(wrench.Length)); - foreach(var entry in wrench) + foreach (var entry in wrench) listOfSerializations.Add(entry.Serialize()); return listOfSerializations; @@ -81,40 +81,40 @@ public override List SerializationStatements() public override int Deserialize(byte[] data, int offset) { offset = this.header.Deserialize(data, offset); - + var joint_namesArrayLength = DeserializeLength(data, offset); offset += 4; - this.joint_names= new string[joint_namesArrayLength]; - for(var i = 0; i < joint_namesArrayLength; i++) + this.joint_names = new string[joint_namesArrayLength]; + for (var i = 0; i < joint_namesArrayLength; i++) { var joint_namesStringBytesLength = DeserializeLength(data, offset); offset += 4; this.joint_names[i] = DeserializeString(data, offset, joint_namesStringBytesLength); offset += joint_namesStringBytesLength; } - + var transformsArrayLength = DeserializeLength(data, offset); offset += 4; - this.transforms= new Geometry.MTransform[transformsArrayLength]; - for(var i = 0; i < transformsArrayLength; i++) + this.transforms = new Geometry.MTransform[transformsArrayLength]; + for (var i = 0; i < transformsArrayLength; i++) { this.transforms[i] = new Geometry.MTransform(); offset = this.transforms[i].Deserialize(data, offset); } - + var twistArrayLength = DeserializeLength(data, offset); offset += 4; - this.twist= new Geometry.MTwist[twistArrayLength]; - for(var i = 0; i < twistArrayLength; i++) + this.twist = new Geometry.MTwist[twistArrayLength]; + for (var i = 0; i < twistArrayLength; i++) { this.twist[i] = new Geometry.MTwist(); offset = this.twist[i].Deserialize(data, offset); } - + var wrenchArrayLength = DeserializeLength(data, offset); offset += 4; - this.wrench= new Geometry.MWrench[wrenchArrayLength]; - for(var i = 0; i < wrenchArrayLength; i++) + this.wrench = new Geometry.MWrench[wrenchArrayLength]; + for (var i = 0; i < wrenchArrayLength; i++) { this.wrench[i] = new Geometry.MWrench(); offset = this.wrench[i].Deserialize(data, offset); diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MMultiEchoLaserScan.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MMultiEchoLaserScan.cs index 2586fe85..c929ab84 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MMultiEchoLaserScan.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MMultiEchoLaserScan.cs @@ -87,13 +87,13 @@ public override List SerializationStatements() listOfSerializations.Add(BitConverter.GetBytes(this.scan_time)); listOfSerializations.Add(BitConverter.GetBytes(this.range_min)); listOfSerializations.Add(BitConverter.GetBytes(this.range_max)); - + listOfSerializations.Add(BitConverter.GetBytes(ranges.Length)); - foreach(var entry in ranges) + foreach (var entry in ranges) listOfSerializations.Add(entry.Serialize()); - + listOfSerializations.Add(BitConverter.GetBytes(intensities.Length)); - foreach(var entry in intensities) + foreach (var entry in intensities) listOfSerializations.Add(entry.Serialize()); return listOfSerializations; @@ -116,20 +116,20 @@ public override int Deserialize(byte[] data, int offset) offset += 4; this.range_max = BitConverter.ToSingle(data, offset); offset += 4; - + var rangesArrayLength = DeserializeLength(data, offset); offset += 4; - this.ranges= new MLaserEcho[rangesArrayLength]; - for(var i = 0; i < rangesArrayLength; i++) + this.ranges = new MLaserEcho[rangesArrayLength]; + for (var i = 0; i < rangesArrayLength; i++) { this.ranges[i] = new MLaserEcho(); offset = this.ranges[i].Deserialize(data, offset); } - + var intensitiesArrayLength = DeserializeLength(data, offset); offset += 4; - this.intensities= new MLaserEcho[intensitiesArrayLength]; - for(var i = 0; i < intensitiesArrayLength; i++) + this.intensities = new MLaserEcho[intensitiesArrayLength]; + for (var i = 0; i < intensitiesArrayLength; i++) { this.intensities[i] = new MLaserEcho(); offset = this.intensities[i].Deserialize(data, offset); diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MNavSatFix.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MNavSatFix.cs index 0f4c65b5..c9e83863 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MNavSatFix.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MNavSatFix.cs @@ -78,11 +78,11 @@ public override List SerializationStatements() listOfSerializations.Add(BitConverter.GetBytes(this.latitude)); listOfSerializations.Add(BitConverter.GetBytes(this.longitude)); listOfSerializations.Add(BitConverter.GetBytes(this.altitude)); - + Array.Resize(ref position_covariance, 9); - foreach(var entry in position_covariance) + foreach (var entry in position_covariance) listOfSerializations.Add(BitConverter.GetBytes(entry)); - listOfSerializations.Add(new[]{this.position_covariance_type}); + listOfSerializations.Add(new[] { this.position_covariance_type }); return listOfSerializations; } @@ -97,14 +97,14 @@ public override int Deserialize(byte[] data, int offset) offset += 8; this.altitude = BitConverter.ToDouble(data, offset); offset += 8; - - this.position_covariance= new double[9]; - for(var i = 0; i < 9; i++) + + this.position_covariance = new double[9]; + for (var i = 0; i < 9; i++) { this.position_covariance[i] = BitConverter.ToDouble(data, offset); offset += 8; } - this.position_covariance_type = data[offset];; + this.position_covariance_type = data[offset]; ; offset += 1; return offset; diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MNavSatStatus.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MNavSatStatus.cs index 9f3a6a1b..02b4b7a9 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MNavSatStatus.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MNavSatStatus.cs @@ -42,7 +42,7 @@ public MNavSatStatus(sbyte status, ushort service) public override List SerializationStatements() { var listOfSerializations = new List(); - listOfSerializations.Add(new[]{(byte)this.status}); + listOfSerializations.Add(new[] { (byte)this.status }); listOfSerializations.Add(BitConverter.GetBytes(this.service)); return listOfSerializations; @@ -50,7 +50,7 @@ public override List SerializationStatements() public override int Deserialize(byte[] data, int offset) { - this.status = (sbyte)data[offset];; + this.status = (sbyte)data[offset]; ; offset += 1; this.service = BitConverter.ToUInt16(data, offset); offset += 2; diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MPointCloud.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MPointCloud.cs index 5d1b5971..1c06073c 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MPointCloud.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MPointCloud.cs @@ -41,13 +41,13 @@ public override List SerializationStatements() { var listOfSerializations = new List(); listOfSerializations.AddRange(header.SerializationStatements()); - + listOfSerializations.Add(BitConverter.GetBytes(points.Length)); - foreach(var entry in points) + foreach (var entry in points) listOfSerializations.Add(entry.Serialize()); - + listOfSerializations.Add(BitConverter.GetBytes(channels.Length)); - foreach(var entry in channels) + foreach (var entry in channels) listOfSerializations.Add(entry.Serialize()); return listOfSerializations; @@ -56,20 +56,20 @@ public override List SerializationStatements() public override int Deserialize(byte[] data, int offset) { offset = this.header.Deserialize(data, offset); - + var pointsArrayLength = DeserializeLength(data, offset); offset += 4; - this.points= new Geometry.MPoint32[pointsArrayLength]; - for(var i = 0; i < pointsArrayLength; i++) + this.points = new Geometry.MPoint32[pointsArrayLength]; + for (var i = 0; i < pointsArrayLength; i++) { this.points[i] = new Geometry.MPoint32(); offset = this.points[i].Deserialize(data, offset); } - + var channelsArrayLength = DeserializeLength(data, offset); offset += 4; - this.channels= new MChannelFloat32[channelsArrayLength]; - for(var i = 0; i < channelsArrayLength; i++) + this.channels = new MChannelFloat32[channelsArrayLength]; + for (var i = 0; i < channelsArrayLength; i++) { this.channels[i] = new MChannelFloat32(); offset = this.channels[i].Deserialize(data, offset); diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MPointCloud2.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MPointCloud2.cs index 9055b4d2..61df82d8 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MPointCloud2.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MPointCloud2.cs @@ -70,14 +70,14 @@ public override List SerializationStatements() listOfSerializations.AddRange(header.SerializationStatements()); listOfSerializations.Add(BitConverter.GetBytes(this.height)); listOfSerializations.Add(BitConverter.GetBytes(this.width)); - + listOfSerializations.Add(BitConverter.GetBytes(fields.Length)); - foreach(var entry in fields) + foreach (var entry in fields) listOfSerializations.Add(entry.Serialize()); listOfSerializations.Add(BitConverter.GetBytes(this.is_bigendian)); listOfSerializations.Add(BitConverter.GetBytes(this.point_step)); listOfSerializations.Add(BitConverter.GetBytes(this.row_step)); - + listOfSerializations.Add(BitConverter.GetBytes(data.Length)); listOfSerializations.Add(this.data); listOfSerializations.Add(BitConverter.GetBytes(this.is_dense)); @@ -92,11 +92,11 @@ public override int Deserialize(byte[] data, int offset) offset += 4; this.width = BitConverter.ToUInt32(data, offset); offset += 4; - + var fieldsArrayLength = DeserializeLength(data, offset); offset += 4; - this.fields= new MPointField[fieldsArrayLength]; - for(var i = 0; i < fieldsArrayLength; i++) + this.fields = new MPointField[fieldsArrayLength]; + for (var i = 0; i < fieldsArrayLength; i++) { this.fields[i] = new MPointField(); offset = this.fields[i].Deserialize(data, offset); @@ -107,11 +107,11 @@ public override int Deserialize(byte[] data, int offset) offset += 4; this.row_step = BitConverter.ToUInt32(data, offset); offset += 4; - + var dataArrayLength = DeserializeLength(data, offset); offset += 4; - this.data= new byte[dataArrayLength]; - for(var i = 0; i < dataArrayLength; i++) + this.data = new byte[dataArrayLength]; + for (var i = 0; i < dataArrayLength; i++) { this.data[i] = data[offset]; offset += 1; diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MPointField.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MPointField.cs index e5cea6cb..e498334d 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MPointField.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MPointField.cs @@ -50,7 +50,7 @@ public override List SerializationStatements() var listOfSerializations = new List(); listOfSerializations.Add(SerializeString(this.name)); listOfSerializations.Add(BitConverter.GetBytes(this.offset)); - listOfSerializations.Add(new[]{this.datatype}); + listOfSerializations.Add(new[] { this.datatype }); listOfSerializations.Add(BitConverter.GetBytes(this.count)); return listOfSerializations; @@ -64,7 +64,7 @@ public override int Deserialize(byte[] data, int offset) offset += nameStringBytesLength; this.offset = BitConverter.ToUInt32(data, offset); offset += 4; - this.datatype = data[offset];; + this.datatype = data[offset]; ; offset += 1; this.count = BitConverter.ToUInt32(data, offset); offset += 4; diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MRange.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MRange.cs index 6d6f5c67..1c3138bd 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MRange.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Sensor/msg/MRange.cs @@ -75,7 +75,7 @@ public override List SerializationStatements() { var listOfSerializations = new List(); listOfSerializations.AddRange(header.SerializationStatements()); - listOfSerializations.Add(new[]{this.radiation_type}); + listOfSerializations.Add(new[] { this.radiation_type }); listOfSerializations.Add(BitConverter.GetBytes(this.field_of_view)); listOfSerializations.Add(BitConverter.GetBytes(this.min_range)); listOfSerializations.Add(BitConverter.GetBytes(this.max_range)); @@ -87,7 +87,7 @@ public override List SerializationStatements() public override int Deserialize(byte[] data, int offset) { offset = this.header.Deserialize(data, offset); - this.radiation_type = data[offset];; + this.radiation_type = data[offset]; ; offset += 1; this.field_of_view = BitConverter.ToSingle(data, offset); offset += 4; diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Shape/msg/MMesh.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Shape/msg/MMesh.cs index ad3d20cb..f41ec827 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Shape/msg/MMesh.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Shape/msg/MMesh.cs @@ -31,13 +31,13 @@ public MMesh(MMeshTriangle[] triangles, Geometry.MPoint[] vertices) public override List SerializationStatements() { var listOfSerializations = new List(); - + listOfSerializations.Add(BitConverter.GetBytes(triangles.Length)); - foreach(var entry in triangles) + foreach (var entry in triangles) listOfSerializations.Add(entry.Serialize()); - + listOfSerializations.Add(BitConverter.GetBytes(vertices.Length)); - foreach(var entry in vertices) + foreach (var entry in vertices) listOfSerializations.Add(entry.Serialize()); return listOfSerializations; @@ -45,20 +45,20 @@ public override List SerializationStatements() public override int Deserialize(byte[] data, int offset) { - + var trianglesArrayLength = DeserializeLength(data, offset); offset += 4; - this.triangles= new MMeshTriangle[trianglesArrayLength]; - for(var i = 0; i < trianglesArrayLength; i++) + this.triangles = new MMeshTriangle[trianglesArrayLength]; + for (var i = 0; i < trianglesArrayLength; i++) { this.triangles[i] = new MMeshTriangle(); offset = this.triangles[i].Deserialize(data, offset); } - + var verticesArrayLength = DeserializeLength(data, offset); offset += 4; - this.vertices= new Geometry.MPoint[verticesArrayLength]; - for(var i = 0; i < verticesArrayLength; i++) + this.vertices = new Geometry.MPoint[verticesArrayLength]; + for (var i = 0; i < verticesArrayLength; i++) { this.vertices[i] = new Geometry.MPoint(); offset = this.vertices[i].Deserialize(data, offset); diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Shape/msg/MMeshTriangle.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Shape/msg/MMeshTriangle.cs index 673a158f..6984b891 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Shape/msg/MMeshTriangle.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Shape/msg/MMeshTriangle.cs @@ -26,9 +26,9 @@ public MMeshTriangle(uint[] vertex_indices) public override List SerializationStatements() { var listOfSerializations = new List(); - + Array.Resize(ref vertex_indices, 3); - foreach(var entry in vertex_indices) + foreach (var entry in vertex_indices) listOfSerializations.Add(BitConverter.GetBytes(entry)); return listOfSerializations; @@ -36,9 +36,9 @@ public override List SerializationStatements() public override int Deserialize(byte[] data, int offset) { - - this.vertex_indices= new uint[3]; - for(var i = 0; i < 3; i++) + + this.vertex_indices = new uint[3]; + for (var i = 0; i < 3; i++) { this.vertex_indices[i] = BitConverter.ToUInt32(data, offset); offset += 4; diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Shape/msg/MPlane.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Shape/msg/MPlane.cs index 7bf045f2..b7304ee1 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Shape/msg/MPlane.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Shape/msg/MPlane.cs @@ -30,9 +30,9 @@ public MPlane(double[] coef) public override List SerializationStatements() { var listOfSerializations = new List(); - + Array.Resize(ref coef, 4); - foreach(var entry in coef) + foreach (var entry in coef) listOfSerializations.Add(BitConverter.GetBytes(entry)); return listOfSerializations; @@ -40,9 +40,9 @@ public override List SerializationStatements() public override int Deserialize(byte[] data, int offset) { - - this.coef= new double[4]; - for(var i = 0; i < 4; i++) + + this.coef = new double[4]; + for (var i = 0; i < 4; i++) { this.coef[i] = BitConverter.ToDouble(data, offset); offset += 8; diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Shape/msg/MSolidPrimitive.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Shape/msg/MSolidPrimitive.cs index cbeca26b..ec706374 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Shape/msg/MSolidPrimitive.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Shape/msg/MSolidPrimitive.cs @@ -56,10 +56,10 @@ public MSolidPrimitive(byte type, double[] dimensions) public override List SerializationStatements() { var listOfSerializations = new List(); - listOfSerializations.Add(new[]{this.type}); - + listOfSerializations.Add(new[] { this.type }); + listOfSerializations.Add(BitConverter.GetBytes(dimensions.Length)); - foreach(var entry in dimensions) + foreach (var entry in dimensions) listOfSerializations.Add(BitConverter.GetBytes(entry)); return listOfSerializations; @@ -67,13 +67,13 @@ public override List SerializationStatements() public override int Deserialize(byte[] data, int offset) { - this.type = data[offset];; + this.type = data[offset]; ; offset += 1; - + var dimensionsArrayLength = DeserializeLength(data, offset); offset += 4; - this.dimensions= new double[dimensionsArrayLength]; - for(var i = 0; i < dimensionsArrayLength; i++) + this.dimensions = new double[dimensionsArrayLength]; + for (var i = 0; i < dimensionsArrayLength; i++) { this.dimensions[i] = BitConverter.ToDouble(data, offset); offset += 8; diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MByte.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MByte.cs index 1fd9156d..4d088580 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MByte.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MByte.cs @@ -25,14 +25,14 @@ public MByte(sbyte data) public override List SerializationStatements() { var listOfSerializations = new List(); - listOfSerializations.Add(new[]{(byte)this.data}); + listOfSerializations.Add(new[] { (byte)this.data }); return listOfSerializations; } public override int Deserialize(byte[] data, int offset) { - this.data = (sbyte)data[offset];; + this.data = (sbyte)data[offset]; ; offset += 1; return offset; diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MByteMultiArray.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MByteMultiArray.cs index e49b1743..dd4ac2a6 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MByteMultiArray.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MByteMultiArray.cs @@ -33,9 +33,9 @@ public override List SerializationStatements() { var listOfSerializations = new List(); listOfSerializations.AddRange(layout.SerializationStatements()); - + listOfSerializations.Add(BitConverter.GetBytes(data.Length)); - listOfSerializations.Add((byte[]) (Array)this.data); + listOfSerializations.Add((byte[])(Array)this.data); return listOfSerializations; } @@ -43,11 +43,11 @@ public override List SerializationStatements() public override int Deserialize(byte[] data, int offset) { offset = this.layout.Deserialize(data, offset); - + var dataArrayLength = DeserializeLength(data, offset); offset += 4; - this.data= new sbyte[dataArrayLength]; - for(var i = 0; i < dataArrayLength; i++) + this.data = new sbyte[dataArrayLength]; + for (var i = 0; i < dataArrayLength; i++) { this.data[i] = (sbyte)data[offset]; offset += 1; diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MChar.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MChar.cs index 3f3e2832..b637d08c 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MChar.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MChar.cs @@ -25,14 +25,14 @@ public MChar(byte data) public override List SerializationStatements() { var listOfSerializations = new List(); - listOfSerializations.Add(new[]{this.data}); + listOfSerializations.Add(new[] { this.data }); return listOfSerializations; } public override int Deserialize(byte[] data, int offset) { - this.data = data[offset];; + this.data = data[offset]; ; offset += 1; return offset; diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MDuration.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MDuration.cs index 1791cb9a..6bb48b20 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MDuration.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MDuration.cs @@ -45,4 +45,4 @@ public override int Deserialize(byte[] data, int offset) return offset; } } -} \ No newline at end of file +} diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MFloat32MultiArray.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MFloat32MultiArray.cs index 87a3e143..7ab8a5cb 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MFloat32MultiArray.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MFloat32MultiArray.cs @@ -33,9 +33,9 @@ public override List SerializationStatements() { var listOfSerializations = new List(); listOfSerializations.AddRange(layout.SerializationStatements()); - + listOfSerializations.Add(BitConverter.GetBytes(data.Length)); - foreach(var entry in data) + foreach (var entry in data) listOfSerializations.Add(BitConverter.GetBytes(entry)); return listOfSerializations; @@ -44,11 +44,11 @@ public override List SerializationStatements() public override int Deserialize(byte[] data, int offset) { offset = this.layout.Deserialize(data, offset); - + var dataArrayLength = DeserializeLength(data, offset); offset += 4; - this.data= new float[dataArrayLength]; - for(var i = 0; i < dataArrayLength; i++) + this.data = new float[dataArrayLength]; + for (var i = 0; i < dataArrayLength; i++) { this.data[i] = BitConverter.ToSingle(data, offset); offset += 4; diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MFloat64MultiArray.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MFloat64MultiArray.cs index b60ebeba..2a96b774 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MFloat64MultiArray.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MFloat64MultiArray.cs @@ -33,9 +33,9 @@ public override List SerializationStatements() { var listOfSerializations = new List(); listOfSerializations.AddRange(layout.SerializationStatements()); - + listOfSerializations.Add(BitConverter.GetBytes(data.Length)); - foreach(var entry in data) + foreach (var entry in data) listOfSerializations.Add(BitConverter.GetBytes(entry)); return listOfSerializations; @@ -44,11 +44,11 @@ public override List SerializationStatements() public override int Deserialize(byte[] data, int offset) { offset = this.layout.Deserialize(data, offset); - + var dataArrayLength = DeserializeLength(data, offset); offset += 4; - this.data= new double[dataArrayLength]; - for(var i = 0; i < dataArrayLength; i++) + this.data = new double[dataArrayLength]; + for (var i = 0; i < dataArrayLength; i++) { this.data[i] = BitConverter.ToDouble(data, offset); offset += 8; diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MInt16MultiArray.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MInt16MultiArray.cs index 791f4cde..bd4d2850 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MInt16MultiArray.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MInt16MultiArray.cs @@ -33,9 +33,9 @@ public override List SerializationStatements() { var listOfSerializations = new List(); listOfSerializations.AddRange(layout.SerializationStatements()); - + listOfSerializations.Add(BitConverter.GetBytes(data.Length)); - foreach(var entry in data) + foreach (var entry in data) listOfSerializations.Add(BitConverter.GetBytes(entry)); return listOfSerializations; @@ -44,11 +44,11 @@ public override List SerializationStatements() public override int Deserialize(byte[] data, int offset) { offset = this.layout.Deserialize(data, offset); - + var dataArrayLength = DeserializeLength(data, offset); offset += 4; - this.data= new short[dataArrayLength]; - for(var i = 0; i < dataArrayLength; i++) + this.data = new short[dataArrayLength]; + for (var i = 0; i < dataArrayLength; i++) { this.data[i] = BitConverter.ToInt16(data, offset); offset += 2; diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MInt32MultiArray.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MInt32MultiArray.cs index 1c44214d..e9004c1a 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MInt32MultiArray.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MInt32MultiArray.cs @@ -33,9 +33,9 @@ public override List SerializationStatements() { var listOfSerializations = new List(); listOfSerializations.AddRange(layout.SerializationStatements()); - + listOfSerializations.Add(BitConverter.GetBytes(data.Length)); - foreach(var entry in data) + foreach (var entry in data) listOfSerializations.Add(BitConverter.GetBytes(entry)); return listOfSerializations; @@ -44,11 +44,11 @@ public override List SerializationStatements() public override int Deserialize(byte[] data, int offset) { offset = this.layout.Deserialize(data, offset); - + var dataArrayLength = DeserializeLength(data, offset); offset += 4; - this.data= new int[dataArrayLength]; - for(var i = 0; i < dataArrayLength; i++) + this.data = new int[dataArrayLength]; + for (var i = 0; i < dataArrayLength; i++) { this.data[i] = BitConverter.ToInt32(data, offset); offset += 4; diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MInt64MultiArray.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MInt64MultiArray.cs index 4aa1943f..4934cf2e 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MInt64MultiArray.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MInt64MultiArray.cs @@ -33,9 +33,9 @@ public override List SerializationStatements() { var listOfSerializations = new List(); listOfSerializations.AddRange(layout.SerializationStatements()); - + listOfSerializations.Add(BitConverter.GetBytes(data.Length)); - foreach(var entry in data) + foreach (var entry in data) listOfSerializations.Add(BitConverter.GetBytes(entry)); return listOfSerializations; @@ -44,11 +44,11 @@ public override List SerializationStatements() public override int Deserialize(byte[] data, int offset) { offset = this.layout.Deserialize(data, offset); - + var dataArrayLength = DeserializeLength(data, offset); offset += 4; - this.data= new long[dataArrayLength]; - for(var i = 0; i < dataArrayLength; i++) + this.data = new long[dataArrayLength]; + for (var i = 0; i < dataArrayLength; i++) { this.data[i] = BitConverter.ToInt64(data, offset); offset += 8; diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MInt8.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MInt8.cs index c6883c0d..a311f6c8 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MInt8.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MInt8.cs @@ -25,14 +25,14 @@ public MInt8(sbyte data) public override List SerializationStatements() { var listOfSerializations = new List(); - listOfSerializations.Add(new[]{(byte)this.data}); + listOfSerializations.Add(new[] { (byte)this.data }); return listOfSerializations; } public override int Deserialize(byte[] data, int offset) { - this.data = (sbyte)data[offset];; + this.data = (sbyte)data[offset]; ; offset += 1; return offset; diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MInt8MultiArray.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MInt8MultiArray.cs index 024dc5ac..2f667acb 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MInt8MultiArray.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MInt8MultiArray.cs @@ -33,9 +33,9 @@ public override List SerializationStatements() { var listOfSerializations = new List(); listOfSerializations.AddRange(layout.SerializationStatements()); - + listOfSerializations.Add(BitConverter.GetBytes(data.Length)); - listOfSerializations.Add((byte[]) (Array)this.data); + listOfSerializations.Add((byte[])(Array)this.data); return listOfSerializations; } @@ -43,11 +43,11 @@ public override List SerializationStatements() public override int Deserialize(byte[] data, int offset) { offset = this.layout.Deserialize(data, offset); - + var dataArrayLength = DeserializeLength(data, offset); offset += 4; - this.data= new sbyte[dataArrayLength]; - for(var i = 0; i < dataArrayLength; i++) + this.data = new sbyte[dataArrayLength]; + for (var i = 0; i < dataArrayLength; i++) { this.data[i] = (sbyte)data[offset]; offset += 1; diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MMultiArrayLayout.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MMultiArrayLayout.cs index 53dc197d..1d775b16 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MMultiArrayLayout.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MMultiArrayLayout.cs @@ -52,9 +52,9 @@ public MMultiArrayLayout(MMultiArrayDimension[] dim, uint data_offset) public override List SerializationStatements() { var listOfSerializations = new List(); - + listOfSerializations.Add(BitConverter.GetBytes(dim.Length)); - foreach(var entry in dim) + foreach (var entry in dim) listOfSerializations.Add(entry.Serialize()); listOfSerializations.Add(BitConverter.GetBytes(this.data_offset)); @@ -63,11 +63,11 @@ public override List SerializationStatements() public override int Deserialize(byte[] data, int offset) { - + var dimArrayLength = DeserializeLength(data, offset); offset += 4; - this.dim= new MMultiArrayDimension[dimArrayLength]; - for(var i = 0; i < dimArrayLength; i++) + this.dim = new MMultiArrayDimension[dimArrayLength]; + for (var i = 0; i < dimArrayLength; i++) { this.dim[i] = new MMultiArrayDimension(); offset = this.dim[i].Deserialize(data, offset); diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MTime.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MTime.cs index 901ddea2..1ab263fa 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MTime.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MTime.cs @@ -10,7 +10,7 @@ namespace RosMessageTypes.Std public class MTime : Message { public const string RosMessageName = "std_msgs/Time"; - + public uint secs; public uint nsecs; diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MUInt16MultiArray.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MUInt16MultiArray.cs index 548afe55..382450c7 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MUInt16MultiArray.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MUInt16MultiArray.cs @@ -33,9 +33,9 @@ public override List SerializationStatements() { var listOfSerializations = new List(); listOfSerializations.AddRange(layout.SerializationStatements()); - + listOfSerializations.Add(BitConverter.GetBytes(data.Length)); - foreach(var entry in data) + foreach (var entry in data) listOfSerializations.Add(BitConverter.GetBytes(entry)); return listOfSerializations; @@ -44,11 +44,11 @@ public override List SerializationStatements() public override int Deserialize(byte[] data, int offset) { offset = this.layout.Deserialize(data, offset); - + var dataArrayLength = DeserializeLength(data, offset); offset += 4; - this.data= new ushort[dataArrayLength]; - for(var i = 0; i < dataArrayLength; i++) + this.data = new ushort[dataArrayLength]; + for (var i = 0; i < dataArrayLength; i++) { this.data[i] = BitConverter.ToUInt16(data, offset); offset += 2; diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MUInt32MultiArray.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MUInt32MultiArray.cs index 3c8218c5..c3a2d866 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MUInt32MultiArray.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MUInt32MultiArray.cs @@ -33,9 +33,9 @@ public override List SerializationStatements() { var listOfSerializations = new List(); listOfSerializations.AddRange(layout.SerializationStatements()); - + listOfSerializations.Add(BitConverter.GetBytes(data.Length)); - foreach(var entry in data) + foreach (var entry in data) listOfSerializations.Add(BitConverter.GetBytes(entry)); return listOfSerializations; @@ -44,11 +44,11 @@ public override List SerializationStatements() public override int Deserialize(byte[] data, int offset) { offset = this.layout.Deserialize(data, offset); - + var dataArrayLength = DeserializeLength(data, offset); offset += 4; - this.data= new uint[dataArrayLength]; - for(var i = 0; i < dataArrayLength; i++) + this.data = new uint[dataArrayLength]; + for (var i = 0; i < dataArrayLength; i++) { this.data[i] = BitConverter.ToUInt32(data, offset); offset += 4; diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MUInt64MultiArray.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MUInt64MultiArray.cs index 5cb11403..edcda4b4 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MUInt64MultiArray.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MUInt64MultiArray.cs @@ -33,9 +33,9 @@ public override List SerializationStatements() { var listOfSerializations = new List(); listOfSerializations.AddRange(layout.SerializationStatements()); - + listOfSerializations.Add(BitConverter.GetBytes(data.Length)); - foreach(var entry in data) + foreach (var entry in data) listOfSerializations.Add(BitConverter.GetBytes(entry)); return listOfSerializations; @@ -44,11 +44,11 @@ public override List SerializationStatements() public override int Deserialize(byte[] data, int offset) { offset = this.layout.Deserialize(data, offset); - + var dataArrayLength = DeserializeLength(data, offset); offset += 4; - this.data= new ulong[dataArrayLength]; - for(var i = 0; i < dataArrayLength; i++) + this.data = new ulong[dataArrayLength]; + for (var i = 0; i < dataArrayLength; i++) { this.data[i] = BitConverter.ToUInt64(data, offset); offset += 8; diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MUInt8.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MUInt8.cs index 1cc9a73b..7f91ab61 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MUInt8.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MUInt8.cs @@ -25,14 +25,14 @@ public MUInt8(byte data) public override List SerializationStatements() { var listOfSerializations = new List(); - listOfSerializations.Add(new[]{this.data}); + listOfSerializations.Add(new[] { this.data }); return listOfSerializations; } public override int Deserialize(byte[] data, int offset) { - this.data = data[offset];; + this.data = data[offset]; ; offset += 1; return offset; diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MUInt8MultiArray.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MUInt8MultiArray.cs index ba4ff24b..2660e0f9 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MUInt8MultiArray.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Std/msg/MUInt8MultiArray.cs @@ -33,7 +33,7 @@ public override List SerializationStatements() { var listOfSerializations = new List(); listOfSerializations.AddRange(layout.SerializationStatements()); - + listOfSerializations.Add(BitConverter.GetBytes(data.Length)); listOfSerializations.Add(this.data); @@ -43,11 +43,11 @@ public override List SerializationStatements() public override int Deserialize(byte[] data, int offset) { offset = this.layout.Deserialize(data, offset); - + var dataArrayLength = DeserializeLength(data, offset); offset += 4; - this.data= new byte[dataArrayLength]; - for(var i = 0; i < dataArrayLength; i++) + this.data = new byte[dataArrayLength]; + for (var i = 0; i < dataArrayLength; i++) { this.data[i] = data[offset]; offset += 1; diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Trajectory/msg/MJointTrajectory.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Trajectory/msg/MJointTrajectory.cs index 0b1f60e6..6727d713 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Trajectory/msg/MJointTrajectory.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Trajectory/msg/MJointTrajectory.cs @@ -33,13 +33,13 @@ public override List SerializationStatements() { var listOfSerializations = new List(); listOfSerializations.AddRange(header.SerializationStatements()); - + listOfSerializations.Add(BitConverter.GetBytes(joint_names.Length)); - foreach(var entry in joint_names) + foreach (var entry in joint_names) listOfSerializations.Add(SerializeString(entry)); - + listOfSerializations.Add(BitConverter.GetBytes(points.Length)); - foreach(var entry in points) + foreach (var entry in points) listOfSerializations.Add(entry.Serialize()); return listOfSerializations; @@ -48,22 +48,22 @@ public override List SerializationStatements() public override int Deserialize(byte[] data, int offset) { offset = this.header.Deserialize(data, offset); - + var joint_namesArrayLength = DeserializeLength(data, offset); offset += 4; - this.joint_names= new string[joint_namesArrayLength]; - for(var i = 0; i < joint_namesArrayLength; i++) + this.joint_names = new string[joint_namesArrayLength]; + for (var i = 0; i < joint_namesArrayLength; i++) { var joint_namesStringBytesLength = DeserializeLength(data, offset); offset += 4; this.joint_names[i] = DeserializeString(data, offset, joint_namesStringBytesLength); offset += joint_namesStringBytesLength; } - + var pointsArrayLength = DeserializeLength(data, offset); offset += 4; - this.points= new MJointTrajectoryPoint[pointsArrayLength]; - for(var i = 0; i < pointsArrayLength; i++) + this.points = new MJointTrajectoryPoint[pointsArrayLength]; + for (var i = 0; i < pointsArrayLength; i++) { this.points[i] = new MJointTrajectoryPoint(); offset = this.points[i].Deserialize(data, offset); diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Trajectory/msg/MJointTrajectoryPoint.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Trajectory/msg/MJointTrajectoryPoint.cs index 022df286..c5f03731 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Trajectory/msg/MJointTrajectoryPoint.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Trajectory/msg/MJointTrajectoryPoint.cs @@ -41,21 +41,21 @@ public MJointTrajectoryPoint(double[] positions, double[] velocities, double[] a public override List SerializationStatements() { var listOfSerializations = new List(); - + listOfSerializations.Add(BitConverter.GetBytes(positions.Length)); - foreach(var entry in positions) + foreach (var entry in positions) listOfSerializations.Add(BitConverter.GetBytes(entry)); - + listOfSerializations.Add(BitConverter.GetBytes(velocities.Length)); - foreach(var entry in velocities) + foreach (var entry in velocities) listOfSerializations.Add(BitConverter.GetBytes(entry)); - + listOfSerializations.Add(BitConverter.GetBytes(accelerations.Length)); - foreach(var entry in accelerations) + foreach (var entry in accelerations) listOfSerializations.Add(BitConverter.GetBytes(entry)); - + listOfSerializations.Add(BitConverter.GetBytes(effort.Length)); - foreach(var entry in effort) + foreach (var entry in effort) listOfSerializations.Add(BitConverter.GetBytes(entry)); listOfSerializations.AddRange(time_from_start.SerializationStatements()); @@ -64,38 +64,38 @@ public override List SerializationStatements() public override int Deserialize(byte[] data, int offset) { - + var positionsArrayLength = DeserializeLength(data, offset); offset += 4; - this.positions= new double[positionsArrayLength]; - for(var i = 0; i < positionsArrayLength; i++) + this.positions = new double[positionsArrayLength]; + for (var i = 0; i < positionsArrayLength; i++) { this.positions[i] = BitConverter.ToDouble(data, offset); offset += 8; } - + var velocitiesArrayLength = DeserializeLength(data, offset); offset += 4; - this.velocities= new double[velocitiesArrayLength]; - for(var i = 0; i < velocitiesArrayLength; i++) + this.velocities = new double[velocitiesArrayLength]; + for (var i = 0; i < velocitiesArrayLength; i++) { this.velocities[i] = BitConverter.ToDouble(data, offset); offset += 8; } - + var accelerationsArrayLength = DeserializeLength(data, offset); offset += 4; - this.accelerations= new double[accelerationsArrayLength]; - for(var i = 0; i < accelerationsArrayLength; i++) + this.accelerations = new double[accelerationsArrayLength]; + for (var i = 0; i < accelerationsArrayLength; i++) { this.accelerations[i] = BitConverter.ToDouble(data, offset); offset += 8; } - + var effortArrayLength = DeserializeLength(data, offset); offset += 4; - this.effort= new double[effortArrayLength]; - for(var i = 0; i < effortArrayLength; i++) + this.effort = new double[effortArrayLength]; + for (var i = 0; i < effortArrayLength; i++) { this.effort[i] = BitConverter.ToDouble(data, offset); offset += 8; diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Trajectory/msg/MMultiDOFJointTrajectory.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Trajectory/msg/MMultiDOFJointTrajectory.cs index 3b2778bd..52d729d1 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Trajectory/msg/MMultiDOFJointTrajectory.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Trajectory/msg/MMultiDOFJointTrajectory.cs @@ -38,13 +38,13 @@ public override List SerializationStatements() { var listOfSerializations = new List(); listOfSerializations.AddRange(header.SerializationStatements()); - + listOfSerializations.Add(BitConverter.GetBytes(joint_names.Length)); - foreach(var entry in joint_names) + foreach (var entry in joint_names) listOfSerializations.Add(SerializeString(entry)); - + listOfSerializations.Add(BitConverter.GetBytes(points.Length)); - foreach(var entry in points) + foreach (var entry in points) listOfSerializations.Add(entry.Serialize()); return listOfSerializations; @@ -53,22 +53,22 @@ public override List SerializationStatements() public override int Deserialize(byte[] data, int offset) { offset = this.header.Deserialize(data, offset); - + var joint_namesArrayLength = DeserializeLength(data, offset); offset += 4; - this.joint_names= new string[joint_namesArrayLength]; - for(var i = 0; i < joint_namesArrayLength; i++) + this.joint_names = new string[joint_namesArrayLength]; + for (var i = 0; i < joint_namesArrayLength; i++) { var joint_namesStringBytesLength = DeserializeLength(data, offset); offset += 4; this.joint_names[i] = DeserializeString(data, offset, joint_namesStringBytesLength); offset += joint_namesStringBytesLength; } - + var pointsArrayLength = DeserializeLength(data, offset); offset += 4; - this.points= new MMultiDOFJointTrajectoryPoint[pointsArrayLength]; - for(var i = 0; i < pointsArrayLength; i++) + this.points = new MMultiDOFJointTrajectoryPoint[pointsArrayLength]; + for (var i = 0; i < pointsArrayLength; i++) { this.points[i] = new MMultiDOFJointTrajectoryPoint(); offset = this.points[i].Deserialize(data, offset); diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Trajectory/msg/MMultiDOFJointTrajectoryPoint.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Trajectory/msg/MMultiDOFJointTrajectoryPoint.cs index 2e2b5e64..e91e2fb3 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Trajectory/msg/MMultiDOFJointTrajectoryPoint.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Trajectory/msg/MMultiDOFJointTrajectoryPoint.cs @@ -38,17 +38,17 @@ public MMultiDOFJointTrajectoryPoint(Geometry.MTransform[] transforms, Geometry. public override List SerializationStatements() { var listOfSerializations = new List(); - + listOfSerializations.Add(BitConverter.GetBytes(transforms.Length)); - foreach(var entry in transforms) + foreach (var entry in transforms) listOfSerializations.Add(entry.Serialize()); - + listOfSerializations.Add(BitConverter.GetBytes(velocities.Length)); - foreach(var entry in velocities) + foreach (var entry in velocities) listOfSerializations.Add(entry.Serialize()); - + listOfSerializations.Add(BitConverter.GetBytes(accelerations.Length)); - foreach(var entry in accelerations) + foreach (var entry in accelerations) listOfSerializations.Add(entry.Serialize()); listOfSerializations.AddRange(time_from_start.SerializationStatements()); @@ -57,29 +57,29 @@ public override List SerializationStatements() public override int Deserialize(byte[] data, int offset) { - + var transformsArrayLength = DeserializeLength(data, offset); offset += 4; - this.transforms= new Geometry.MTransform[transformsArrayLength]; - for(var i = 0; i < transformsArrayLength; i++) + this.transforms = new Geometry.MTransform[transformsArrayLength]; + for (var i = 0; i < transformsArrayLength; i++) { this.transforms[i] = new Geometry.MTransform(); offset = this.transforms[i].Deserialize(data, offset); } - + var velocitiesArrayLength = DeserializeLength(data, offset); offset += 4; - this.velocities= new Geometry.MTwist[velocitiesArrayLength]; - for(var i = 0; i < velocitiesArrayLength; i++) + this.velocities = new Geometry.MTwist[velocitiesArrayLength]; + for (var i = 0; i < velocitiesArrayLength; i++) { this.velocities[i] = new Geometry.MTwist(); offset = this.velocities[i].Deserialize(data, offset); } - + var accelerationsArrayLength = DeserializeLength(data, offset); offset += 4; - this.accelerations= new Geometry.MTwist[accelerationsArrayLength]; - for(var i = 0; i < accelerationsArrayLength; i++) + this.accelerations = new Geometry.MTwist[accelerationsArrayLength]; + for (var i = 0; i < accelerationsArrayLength; i++) { this.accelerations[i] = new Geometry.MTwist(); offset = this.accelerations[i].Deserialize(data, offset); diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Visualization/msg/MImageMarker.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Visualization/msg/MImageMarker.cs index 80619a94..8bf320e5 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Visualization/msg/MImageMarker.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Visualization/msg/MImageMarker.cs @@ -88,16 +88,16 @@ public override List SerializationStatements() listOfSerializations.AddRange(position.SerializationStatements()); listOfSerializations.Add(BitConverter.GetBytes(this.scale)); listOfSerializations.AddRange(outline_color.SerializationStatements()); - listOfSerializations.Add(new[]{this.filled}); + listOfSerializations.Add(new[] { this.filled }); listOfSerializations.AddRange(fill_color.SerializationStatements()); listOfSerializations.AddRange(lifetime.SerializationStatements()); - + listOfSerializations.Add(BitConverter.GetBytes(points.Length)); - foreach(var entry in points) + foreach (var entry in points) listOfSerializations.Add(entry.Serialize()); - + listOfSerializations.Add(BitConverter.GetBytes(outline_colors.Length)); - foreach(var entry in outline_colors) + foreach (var entry in outline_colors) listOfSerializations.Add(entry.Serialize()); return listOfSerializations; @@ -120,24 +120,24 @@ public override int Deserialize(byte[] data, int offset) this.scale = BitConverter.ToSingle(data, offset); offset += 4; offset = this.outline_color.Deserialize(data, offset); - this.filled = data[offset];; + this.filled = data[offset]; ; offset += 1; offset = this.fill_color.Deserialize(data, offset); offset = this.lifetime.Deserialize(data, offset); - + var pointsArrayLength = DeserializeLength(data, offset); offset += 4; - this.points= new Geometry.MPoint[pointsArrayLength]; - for(var i = 0; i < pointsArrayLength; i++) + this.points = new Geometry.MPoint[pointsArrayLength]; + for (var i = 0; i < pointsArrayLength; i++) { this.points[i] = new Geometry.MPoint(); offset = this.points[i].Deserialize(data, offset); } - + var outline_colorsArrayLength = DeserializeLength(data, offset); offset += 4; - this.outline_colors= new Std.MColorRGBA[outline_colorsArrayLength]; - for(var i = 0; i < outline_colorsArrayLength; i++) + this.outline_colors = new Std.MColorRGBA[outline_colorsArrayLength]; + for (var i = 0; i < outline_colorsArrayLength; i++) { this.outline_colors[i] = new Std.MColorRGBA(); offset = this.outline_colors[i].Deserialize(data, offset); diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Visualization/msg/MInteractiveMarker.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Visualization/msg/MInteractiveMarker.cs index a7752a7a..ea315a7d 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Visualization/msg/MInteractiveMarker.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Visualization/msg/MInteractiveMarker.cs @@ -62,13 +62,13 @@ public override List SerializationStatements() listOfSerializations.Add(SerializeString(this.name)); listOfSerializations.Add(SerializeString(this.description)); listOfSerializations.Add(BitConverter.GetBytes(this.scale)); - + listOfSerializations.Add(BitConverter.GetBytes(menu_entries.Length)); - foreach(var entry in menu_entries) + foreach (var entry in menu_entries) listOfSerializations.Add(entry.Serialize()); - + listOfSerializations.Add(BitConverter.GetBytes(controls.Length)); - foreach(var entry in controls) + foreach (var entry in controls) listOfSerializations.Add(entry.Serialize()); return listOfSerializations; @@ -88,20 +88,20 @@ public override int Deserialize(byte[] data, int offset) offset += descriptionStringBytesLength; this.scale = BitConverter.ToSingle(data, offset); offset += 4; - + var menu_entriesArrayLength = DeserializeLength(data, offset); offset += 4; - this.menu_entries= new MMenuEntry[menu_entriesArrayLength]; - for(var i = 0; i < menu_entriesArrayLength; i++) + this.menu_entries = new MMenuEntry[menu_entriesArrayLength]; + for (var i = 0; i < menu_entriesArrayLength; i++) { this.menu_entries[i] = new MMenuEntry(); offset = this.menu_entries[i].Deserialize(data, offset); } - + var controlsArrayLength = DeserializeLength(data, offset); offset += 4; - this.controls= new MInteractiveMarkerControl[controlsArrayLength]; - for(var i = 0; i < controlsArrayLength; i++) + this.controls = new MInteractiveMarkerControl[controlsArrayLength]; + for (var i = 0; i < controlsArrayLength; i++) { this.controls[i] = new MInteractiveMarkerControl(); offset = this.controls[i].Deserialize(data, offset); diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Visualization/msg/MInteractiveMarkerControl.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Visualization/msg/MInteractiveMarkerControl.cs index 5cbeb153..4dc86b39 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Visualization/msg/MInteractiveMarkerControl.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Visualization/msg/MInteractiveMarkerControl.cs @@ -101,12 +101,12 @@ public override List SerializationStatements() var listOfSerializations = new List(); listOfSerializations.Add(SerializeString(this.name)); listOfSerializations.AddRange(orientation.SerializationStatements()); - listOfSerializations.Add(new[]{this.orientation_mode}); - listOfSerializations.Add(new[]{this.interaction_mode}); + listOfSerializations.Add(new[] { this.orientation_mode }); + listOfSerializations.Add(new[] { this.interaction_mode }); listOfSerializations.Add(BitConverter.GetBytes(this.always_visible)); - + listOfSerializations.Add(BitConverter.GetBytes(markers.Length)); - foreach(var entry in markers) + foreach (var entry in markers) listOfSerializations.Add(entry.Serialize()); listOfSerializations.Add(BitConverter.GetBytes(this.independent_marker_orientation)); listOfSerializations.Add(SerializeString(this.description)); @@ -121,17 +121,17 @@ public override int Deserialize(byte[] data, int offset) this.name = DeserializeString(data, offset, nameStringBytesLength); offset += nameStringBytesLength; offset = this.orientation.Deserialize(data, offset); - this.orientation_mode = data[offset];; + this.orientation_mode = data[offset]; ; offset += 1; - this.interaction_mode = data[offset];; + this.interaction_mode = data[offset]; ; offset += 1; this.always_visible = BitConverter.ToBoolean(data, offset); offset += 1; - + var markersArrayLength = DeserializeLength(data, offset); offset += 4; - this.markers= new MMarker[markersArrayLength]; - for(var i = 0; i < markersArrayLength; i++) + this.markers = new MMarker[markersArrayLength]; + for (var i = 0; i < markersArrayLength; i++) { this.markers[i] = new MMarker(); offset = this.markers[i].Deserialize(data, offset); diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Visualization/msg/MInteractiveMarkerFeedback.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Visualization/msg/MInteractiveMarkerFeedback.cs index 63442dec..6ec3df84 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Visualization/msg/MInteractiveMarkerFeedback.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Visualization/msg/MInteractiveMarkerFeedback.cs @@ -78,7 +78,7 @@ public override List SerializationStatements() listOfSerializations.Add(SerializeString(this.client_id)); listOfSerializations.Add(SerializeString(this.marker_name)); listOfSerializations.Add(SerializeString(this.control_name)); - listOfSerializations.Add(new[]{this.event_type}); + listOfSerializations.Add(new[] { this.event_type }); listOfSerializations.AddRange(pose.SerializationStatements()); listOfSerializations.Add(BitConverter.GetBytes(this.menu_entry_id)); listOfSerializations.AddRange(mouse_point.SerializationStatements()); @@ -102,7 +102,7 @@ public override int Deserialize(byte[] data, int offset) offset += 4; this.control_name = DeserializeString(data, offset, control_nameStringBytesLength); offset += control_nameStringBytesLength; - this.event_type = data[offset];; + this.event_type = data[offset]; ; offset += 1; offset = this.pose.Deserialize(data, offset); this.menu_entry_id = BitConverter.ToUInt32(data, offset); diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Visualization/msg/MInteractiveMarkerInit.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Visualization/msg/MInteractiveMarkerInit.cs index fe8e70f0..8411e347 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Visualization/msg/MInteractiveMarkerInit.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Visualization/msg/MInteractiveMarkerInit.cs @@ -42,9 +42,9 @@ public override List SerializationStatements() var listOfSerializations = new List(); listOfSerializations.Add(SerializeString(this.server_id)); listOfSerializations.Add(BitConverter.GetBytes(this.seq_num)); - + listOfSerializations.Add(BitConverter.GetBytes(markers.Length)); - foreach(var entry in markers) + foreach (var entry in markers) listOfSerializations.Add(entry.Serialize()); return listOfSerializations; @@ -58,11 +58,11 @@ public override int Deserialize(byte[] data, int offset) offset += server_idStringBytesLength; this.seq_num = BitConverter.ToUInt64(data, offset); offset += 8; - + var markersArrayLength = DeserializeLength(data, offset); offset += 4; - this.markers= new MInteractiveMarker[markersArrayLength]; - for(var i = 0; i < markersArrayLength; i++) + this.markers = new MInteractiveMarker[markersArrayLength]; + for (var i = 0; i < markersArrayLength; i++) { this.markers[i] = new MInteractiveMarker(); offset = this.markers[i].Deserialize(data, offset); diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Visualization/msg/MInteractiveMarkerUpdate.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Visualization/msg/MInteractiveMarkerUpdate.cs index a73649ee..08daa6f8 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Visualization/msg/MInteractiveMarkerUpdate.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Visualization/msg/MInteractiveMarkerUpdate.cs @@ -60,18 +60,18 @@ public override List SerializationStatements() var listOfSerializations = new List(); listOfSerializations.Add(SerializeString(this.server_id)); listOfSerializations.Add(BitConverter.GetBytes(this.seq_num)); - listOfSerializations.Add(new[]{this.type}); - + listOfSerializations.Add(new[] { this.type }); + listOfSerializations.Add(BitConverter.GetBytes(markers.Length)); - foreach(var entry in markers) + foreach (var entry in markers) listOfSerializations.Add(entry.Serialize()); - + listOfSerializations.Add(BitConverter.GetBytes(poses.Length)); - foreach(var entry in poses) + foreach (var entry in poses) listOfSerializations.Add(entry.Serialize()); - + listOfSerializations.Add(BitConverter.GetBytes(erases.Length)); - foreach(var entry in erases) + foreach (var entry in erases) listOfSerializations.Add(SerializeString(entry)); return listOfSerializations; @@ -85,31 +85,31 @@ public override int Deserialize(byte[] data, int offset) offset += server_idStringBytesLength; this.seq_num = BitConverter.ToUInt64(data, offset); offset += 8; - this.type = data[offset];; + this.type = data[offset]; ; offset += 1; - + var markersArrayLength = DeserializeLength(data, offset); offset += 4; - this.markers= new MInteractiveMarker[markersArrayLength]; - for(var i = 0; i < markersArrayLength; i++) + this.markers = new MInteractiveMarker[markersArrayLength]; + for (var i = 0; i < markersArrayLength; i++) { this.markers[i] = new MInteractiveMarker(); offset = this.markers[i].Deserialize(data, offset); } - + var posesArrayLength = DeserializeLength(data, offset); offset += 4; - this.poses= new MInteractiveMarkerPose[posesArrayLength]; - for(var i = 0; i < posesArrayLength; i++) + this.poses = new MInteractiveMarkerPose[posesArrayLength]; + for (var i = 0; i < posesArrayLength; i++) { this.poses[i] = new MInteractiveMarkerPose(); offset = this.poses[i].Deserialize(data, offset); } - + var erasesArrayLength = DeserializeLength(data, offset); offset += 4; - this.erases= new string[erasesArrayLength]; - for(var i = 0; i < erasesArrayLength; i++) + this.erases = new string[erasesArrayLength]; + for (var i = 0; i < erasesArrayLength; i++) { var erasesStringBytesLength = DeserializeLength(data, offset); offset += 4; diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Visualization/msg/MMarker.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Visualization/msg/MMarker.cs index e0533a45..23216362 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Visualization/msg/MMarker.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Visualization/msg/MMarker.cs @@ -111,13 +111,13 @@ public override List SerializationStatements() listOfSerializations.AddRange(color.SerializationStatements()); listOfSerializations.AddRange(lifetime.SerializationStatements()); listOfSerializations.Add(BitConverter.GetBytes(this.frame_locked)); - + listOfSerializations.Add(BitConverter.GetBytes(points.Length)); - foreach(var entry in points) + foreach (var entry in points) listOfSerializations.Add(entry.Serialize()); - + listOfSerializations.Add(BitConverter.GetBytes(colors.Length)); - foreach(var entry in colors) + foreach (var entry in colors) listOfSerializations.Add(entry.Serialize()); listOfSerializations.Add(SerializeString(this.text)); listOfSerializations.Add(SerializeString(this.mesh_resource)); @@ -145,20 +145,20 @@ public override int Deserialize(byte[] data, int offset) offset = this.lifetime.Deserialize(data, offset); this.frame_locked = BitConverter.ToBoolean(data, offset); offset += 1; - + var pointsArrayLength = DeserializeLength(data, offset); offset += 4; - this.points= new Geometry.MPoint[pointsArrayLength]; - for(var i = 0; i < pointsArrayLength; i++) + this.points = new Geometry.MPoint[pointsArrayLength]; + for (var i = 0; i < pointsArrayLength; i++) { this.points[i] = new Geometry.MPoint(); offset = this.points[i].Deserialize(data, offset); } - + var colorsArrayLength = DeserializeLength(data, offset); offset += 4; - this.colors= new Std.MColorRGBA[colorsArrayLength]; - for(var i = 0; i < colorsArrayLength; i++) + this.colors = new Std.MColorRGBA[colorsArrayLength]; + for (var i = 0; i < colorsArrayLength; i++) { this.colors[i] = new Std.MColorRGBA(); offset = this.colors[i].Deserialize(data, offset); diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Visualization/msg/MMarkerArray.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Visualization/msg/MMarkerArray.cs index d1c51ec1..114caa6e 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Visualization/msg/MMarkerArray.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Visualization/msg/MMarkerArray.cs @@ -25,9 +25,9 @@ public MMarkerArray(MMarker[] markers) public override List SerializationStatements() { var listOfSerializations = new List(); - + listOfSerializations.Add(BitConverter.GetBytes(markers.Length)); - foreach(var entry in markers) + foreach (var entry in markers) listOfSerializations.Add(entry.Serialize()); return listOfSerializations; @@ -35,11 +35,11 @@ public override List SerializationStatements() public override int Deserialize(byte[] data, int offset) { - + var markersArrayLength = DeserializeLength(data, offset); offset += 4; - this.markers= new MMarker[markersArrayLength]; - for(var i = 0; i < markersArrayLength; i++) + this.markers = new MMarker[markersArrayLength]; + for (var i = 0; i < markersArrayLength; i++) { this.markers[i] = new MMarker(); offset = this.markers[i].Deserialize(data, offset); diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Visualization/msg/MMenuEntry.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Visualization/msg/MMenuEntry.cs index a66b4813..726594e5 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Visualization/msg/MMenuEntry.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/PregeneratedMessages/Visualization/msg/MMenuEntry.cs @@ -83,7 +83,7 @@ public override List SerializationStatements() listOfSerializations.Add(BitConverter.GetBytes(this.parent_id)); listOfSerializations.Add(SerializeString(this.title)); listOfSerializations.Add(SerializeString(this.command)); - listOfSerializations.Add(new[]{this.command_type}); + listOfSerializations.Add(new[] { this.command_type }); return listOfSerializations; } @@ -102,7 +102,7 @@ public override int Deserialize(byte[] data, int offset) offset += 4; this.command = DeserializeString(data, offset, commandStringBytesLength); offset += commandStringBytesLength; - this.command_type = data[offset];; + this.command_type = data[offset]; ; offset += 1; return offset; diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/ServiceAutoGen.cs b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/ServiceAutoGen.cs index f4b8ba0d..c3fea46e 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/ServiceAutoGen.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/MessageGeneration/ServiceAutoGen.cs @@ -1,4 +1,4 @@ -/* +/* © Siemens AG, 2019 Author: Sifan Ye (sifan.ye@siemens.com) Licensed under the Apache License, Version 2.0 (the "License"); @@ -20,7 +20,7 @@ namespace Unity.Robotics.ROSTCPConnector.MessageGeneration { public class ServiceAutoGen { - private static readonly string[] types = {"Request", "Response"}; + private static readonly string[] types = { "Request", "Response" }; public static string[] GetServiceClassPaths(string inFilePath, string outPath) { @@ -79,7 +79,8 @@ public static List GenerateSingleService(string inPath, string outPath, return warnings; } - public static List GeneratePackageServices(string inPath, string outPath, string rosPackageName = "", bool verbose = false) { + public static List GeneratePackageServices(string inPath, string outPath, string rosPackageName = "", bool verbose = false) + { List warnings = new List(); string[] files = Directory.GetFiles(Path.Combine(inPath, "srv"), "*.srv"); @@ -89,7 +90,8 @@ public static List GeneratePackageServices(string inPath, string outPath Console.Error.WriteLine("No service files found!"); return warnings; } - else { + else + { if (verbose) { Console.WriteLine("Found " + files.Length + " service files."); @@ -103,7 +105,8 @@ public static List GeneratePackageServices(string inPath, string outPath return warnings; } - public static List GenerateDirectoryServices(string inPath, string outPath, bool verbose = false) { + public static List GenerateDirectoryServices(string inPath, string outPath, bool verbose = false) + { List warnings = new List(); if (inPath.EndsWith("/") || inPath.EndsWith("\\")) diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/ROSGeometry/CoordinateSpaces.cs b/com.unity.robotics.ros-tcp-connector/Runtime/ROSGeometry/CoordinateSpaces.cs index 18fa7805..708d26f8 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/ROSGeometry/CoordinateSpaces.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/ROSGeometry/CoordinateSpaces.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; using UnityEngine; -namespace Unity.Robotics.ROSTCPConnector.ROSGeometry +namespace Unity.Robotics.ROSTCPConnector.ROSGeometry { public interface ICoordinateSpace { diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/ROSGeometry/ROSVector3.cs b/com.unity.robotics.ros-tcp-connector/Runtime/ROSGeometry/ROSVector3.cs index 89d14d73..f6f86832 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/ROSGeometry/ROSVector3.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/ROSGeometry/ROSVector3.cs @@ -73,7 +73,7 @@ private static Vector3 MakeInternal(Vector3 vec) public float sqrMagnitude => internalVector.sqrMagnitude; public static float Angle(Vector3 from, Vector3 to) => Vector3.Angle(from.internalVector, to.internalVector); - + public static Vector3 ClampMagnitude(Vector3 vector, float maxLength) { return MakeInternal(Vector3.ClampMagnitude(vector.internalVector, maxLength)); @@ -85,102 +85,102 @@ public static Vector3 Cross(Vector3 lhs, Vector3 rhs) } public static float Distance(Vector3 a, Vector3 b) => Vector3.Distance(a.internalVector, b.internalVector); - + public static float Dot(Vector3 lhs, Vector3 rhs) => Vector3.Dot(lhs.internalVector, rhs.internalVector); - + public static Vector3 Lerp(Vector3 a, Vector3 b, float t) { return MakeInternal(Vector3.Lerp(a.internalVector, b.internalVector, t)); } - + public static Vector3 LerpUnclamped(Vector3 a, Vector3 b, float t) { return MakeInternal(Vector3.LerpUnclamped(a.internalVector, b.internalVector, t)); } - + public static float Magnitude(Vector3 vector) => Vector3.Magnitude(vector.internalVector); - + public static Vector3 Max(Vector3 lhs, Vector3 rhs) => MakeInternal(Vector3.Max(lhs.internalVector, rhs.internalVector)); - + public static Vector3 Min(Vector3 lhs, Vector3 rhs) => MakeInternal(Vector3.Min(lhs.internalVector, rhs.internalVector)); - + public static Vector3 MoveTowards(Vector3 current, Vector3 target, float maxDistanceDelta) { return MakeInternal(Vector3.MoveTowards(current.internalVector, target.internalVector, maxDistanceDelta)); } - + public static Vector3 Normalize(Vector3 value) => MakeInternal(Vector3.Normalize(value.internalVector)); - + public static void OrthoNormalize(ref Vector3 normal, ref Vector3 tangent, ref Vector3 binormal) { Vector3.OrthoNormalize(ref normal.internalVector, ref tangent.internalVector, ref binormal.internalVector); } - + public static void OrthoNormalize(ref Vector3 normal, ref Vector3 tangent) { Vector3.OrthoNormalize(ref normal.internalVector, ref tangent.internalVector); } - + public static Vector3 Project(Vector3 vector, Vector3 onNormal) { return MakeInternal(Vector3.Project(vector.internalVector, onNormal.internalVector)); } - + public static Vector3 ProjectOnPlane(Vector3 vector, Vector3 planeNormal) { return MakeInternal(Vector3.ProjectOnPlane(vector.internalVector, planeNormal.internalVector)); } - + public static Vector3 Reflect(Vector3 inDirection, Vector3 inNormal) { return MakeInternal(Vector3.Reflect(inDirection.internalVector, inNormal.internalVector)); } - + public static Vector3 RotateTowards(Vector3 current, Vector3 target, float maxRadiansDelta, float maxMagnitudeDelta) { return MakeInternal(Vector3.RotateTowards(current.internalVector, target.internalVector, maxRadiansDelta, maxMagnitudeDelta)); } - + public static Vector3 Scale(Vector3 a, Vector3 b) => MakeInternal(Vector3.Scale(a.internalVector, b.internalVector)); - + public static float SignedAngle(Vector3 from, Vector3 to, Vector3 axis) { return Vector3.SignedAngle(from.internalVector, to.internalVector, axis.internalVector); } - + public static Vector3 Slerp(Vector3 a, Vector3 b, float t) { return MakeInternal(Vector3.Slerp(a.internalVector, b.internalVector, t)); } - + public static Vector3 SlerpUnclamped(Vector3 a, Vector3 b, float t) { return MakeInternal(Vector3.SlerpUnclamped(a.internalVector, b.internalVector, t)); } - + public static Vector3 SmoothDamp(Vector3 current, Vector3 target, ref Vector3 currentVelocity, float smoothTime) { return MakeInternal(Vector3.SmoothDamp(current.internalVector, target.internalVector, ref currentVelocity.internalVector, smoothTime)); } - + public static Vector3 SmoothDamp(Vector3 current, Vector3 target, ref Vector3 currentVelocity, float smoothTime, float maxSpeed) { return MakeInternal(Vector3.SmoothDamp(current.internalVector, target.internalVector, ref currentVelocity.internalVector, smoothTime, maxSpeed)); } - + public static float SqrMagnitude(Vector3 vector) => Vector3.SqrMagnitude(vector.internalVector); - + public override bool Equals(object other) { if (other is Vector3) return internalVector == ((Vector3)other).internalVector; return false; } - + public bool Equals(Vector3 other) => internalVector == other.internalVector; - + public override int GetHashCode() => internalVector.GetHashCode(); - + public void Normalize() { internalVector.Normalize(); @@ -190,12 +190,12 @@ public void Scale(Vector3 scale) { internalVector.Scale(scale.internalVector); } - + public void Set(float newX, float newY, float newZ) { internalVector.Set(newX, newY, newZ); } - + public string ToString(string format) => internalVector.ToString(format); public override string ToString() => internalVector.ToString(); public string ToString(string format, System.IFormatProvider formatProvider) => internalVector.ToString(format, formatProvider); @@ -204,7 +204,7 @@ public void Set(float newX, float newY, float newZ) { return MakeInternal(a.internalVector + b.internalVector); } - + public static Vector3 operator -(Vector3 a) { return MakeInternal(-a.internalVector); @@ -214,22 +214,22 @@ public void Set(float newX, float newY, float newZ) { return MakeInternal(a.internalVector - b.internalVector); } - + public static Vector3 operator *(float d, Vector3 a) { return MakeInternal(d * a.internalVector); } - + public static Vector3 operator *(Vector3 a, float d) { return MakeInternal(a.internalVector * d); } - + public static Vector3 operator /(Vector3 a, float d) { return MakeInternal(a.internalVector / d); } - + public static bool operator ==(Vector3 lhs, Vector3 rhs) { return lhs.internalVector == rhs.internalVector; diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/TcpConnector/HUDPanel.cs b/com.unity.robotics.ros-tcp-connector/Runtime/TcpConnector/HUDPanel.cs index 3c928d8d..4a4e5343 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/TcpConnector/HUDPanel.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/TcpConnector/HUDPanel.cs @@ -125,7 +125,7 @@ Color GetConnectionColor(float elapsedTime) if (elapsedTime <= brightDuration) return bright; else - return Color.Lerp(mid, dark, elapsedTime/fadeToDarkDuration); + return Color.Lerp(mid, dark, elapsedTime / fadeToDarkDuration); } void OnGUI() @@ -264,4 +264,4 @@ float ShowMessage(MessageViewState msgView, float y, bool showElapsedTime = fals return panelRect.yMax; } } -} \ No newline at end of file +} diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/TcpConnector/ROSConnection.cs b/com.unity.robotics.ros-tcp-connector/Runtime/TcpConnector/ROSConnection.cs index 66575fdc..540822b3 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/TcpConnector/ROSConnection.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/TcpConnector/ROSConnection.cs @@ -243,12 +243,12 @@ public void Connect() m_HudPanel.host = $"{m_RosIPAddress}:{m_RosPort}"; m_ConnectionThreadCancellation = new CancellationTokenSource(); - Task.Run(() => ConnectionThread(m_RosIPAddress, m_RosPort, m_NetworkTimeoutSeconds, m_KeepaliveTime, (int)(m_SleepTimeSeconds*1000.0f), m_OutgoingMessages, m_IncomingMessages, m_ConnectionThreadCancellation.Token)); + Task.Run(() => ConnectionThread(m_RosIPAddress, m_RosPort, m_NetworkTimeoutSeconds, m_KeepaliveTime, (int)(m_SleepTimeSeconds * 1000.0f), m_OutgoingMessages, m_IncomingMessages, m_ConnectionThreadCancellation.Token)); } public void Disconnect() { - if(m_ConnectionThreadCancellation != null) + if (m_ConnectionThreadCancellation != null) m_ConnectionThreadCancellation.Cancel(); m_ConnectionThreadCancellation = null; } @@ -430,7 +430,7 @@ static async Task ReaderThread(int readerIdx, NetworkStream networkStream, Concu //Debug.Log($"Message {content.Item1} received"); ROSConnection.m_HasConnectionError = false; - if(content.Item1 != "") // ignore keepalive messages + if (content.Item1 != "") // ignore keepalive messages queue.Enqueue(content); } catch (OperationCanceledException) @@ -622,4 +622,4 @@ public static bool IPFormatIsCorrect(string ipAddress) return IPAddress.TryParse(ipAddress, out parsedipAddress); } } -} \ No newline at end of file +} diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/TcpConnector/TaskPauser.cs b/com.unity.robotics.ros-tcp-connector/Runtime/TcpConnector/TaskPauser.cs index adff2d09..c72fdc7e 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/TcpConnector/TaskPauser.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/TcpConnector/TaskPauser.cs @@ -1,4 +1,4 @@ -using System.Collections; +using System.Collections; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; @@ -33,4 +33,4 @@ public void Resume(object result) m_Source.Cancel(); } } -} \ No newline at end of file +} From b63a3d394dcf46a216063b68954c637375adb987 Mon Sep 17 00:00:00 2001 From: Shuo Diao Date: Thu, 20 May 2021 16:37:30 -0700 Subject: [PATCH 3/5] Add pre-commit hook --- .github/workflows/pre-commit.yml | 22 ++++++++++++++++++++++ .pre-commit-config.yaml | 28 ++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 .github/workflows/pre-commit.yml create mode 100644 .pre-commit-config.yaml diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 00000000..a3b890c3 --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,22 @@ +name: pre-commit + +on: + pull_request: + push: + branches: [dev] + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: 3.7.x + - uses: actions/setup-ruby@v1 + with: + ruby-version: '2.6' + - uses: actions/setup-dotnet@v1 + with: + dotnet-version: '3.1.x' + - uses: pre-commit/action@v2.0.0 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..1ba31ae7 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,28 @@ +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v2.5.0 + hooks: + - id: mixed-line-ending + exclude: > + (?x)^( + .*cs.meta| + .*.css| + .*.meta + )$ + args: [--fix=lf] + + - id: trailing-whitespace + name: trailing-whitespace-markdown + types: [markdown] + - id: check-merge-conflict + args: [--assume-in-merge] + - id: check-yaml + # Won't handle the templating in yamato + exclude: \.yamato/.* + + +- repo: https://github.com/dotnet/format + rev: "7e343070a0355c86f72bdee226b5e19ffcbac931" + hooks: + - id: dotnet-format + args: [--folder, --include] From e3e04934f9067a2cee605a1b1a2e60e339806de0 Mon Sep 17 00:00:00 2001 From: Shuo Diao Date: Thu, 20 May 2021 17:05:17 -0700 Subject: [PATCH 4/5] Fix line endings for markdown Fix trailing-whitespace --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- .pre-commit-config.yaml | 7 +- CONTRIBUTING.md | 14 ++-- MessageGeneration.md | 26 +++---- README.md | 10 +-- ROSGeometry.md | 112 +++++++++++++++---------------- 6 files changed, 87 insertions(+), 84 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 0eb14216..e2f22bd1 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -16,7 +16,7 @@ Provide any relevant links here. ## Testing and Verification -Please describe the tests that you ran to verify your changes. Please also provide instructions, ROS packages, and Unity project files as appropriate so we can reproduce the test environment. +Please describe the tests that you ran to verify your changes. Please also provide instructions, ROS packages, and Unity project files as appropriate so we can reproduce the test environment. ### Test Configuration: - Unity Version: [e.g. Unity 2020.2.0f1] diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1ba31ae7..785adfce 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,13 +1,16 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v2.5.0 + rev: v4.0.1 hooks: - id: mixed-line-ending exclude: > (?x)^( .*cs.meta| .*.css| - .*.meta + .*.meta| + .*.mat| + .*.preset| + .*.lighting )$ args: [--fix=lf] diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4b649214..cb9522e8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,7 +1,7 @@ # Contribution Guidelines -Thank you for your interest in contributing to Unity Robotics! To facilitate your -contributions, we've outlined a brief set of guidelines to ensure that your extensions +Thank you for your interest in contributing to Unity Robotics! To facilitate your +contributions, we've outlined a brief set of guidelines to ensure that your extensions can be easily integrated. ## Communication @@ -40,10 +40,10 @@ We run continuous integration on all PRs; all tests must be passing before the P All Python code should follow the [PEP 8 style guidelines](https://pep8.org/). -All C# code should follow the [Microsoft C# Coding Conventions](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/inside-a-program/coding-conventions). -Additionally, the [Unity Coding package](https://docs.unity3d.com/Packages/com.unity.coding@0.1/manual/index.html) -can be used to format, encode, and lint your code according to the standard Unity -development conventions. Be aware that these Unity conventions will supersede the +All C# code should follow the [Microsoft C# Coding Conventions](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/inside-a-program/coding-conventions). +Additionally, the [Unity Coding package](https://docs.unity3d.com/Packages/com.unity.coding@0.1/manual/index.html) +can be used to format, encode, and lint your code according to the standard Unity +development conventions. Be aware that these Unity conventions will supersede the Microsoft C# Coding Conventions where applicable. Please note that even if the code you are changing does not adhere to these guidelines, @@ -60,5 +60,5 @@ email us at [unity-robotics@unity3d.com](mailto:unity-robotics@unity3d.com). ## Contribution review -Once you have a change ready following the above ground rules, simply make a +Once you have a change ready following the above ground rules, simply make a pull request in GitHub. \ No newline at end of file diff --git a/MessageGeneration.md b/MessageGeneration.md index 32c6c9b8..89662789 100644 --- a/MessageGeneration.md +++ b/MessageGeneration.md @@ -1,13 +1,13 @@ -# Message Generation - -To work with a ROS message in Unity, you first need to generate the corresponding C# message class. Select the menu option "RosMessageGeneration->Browse..." to open the message browser. - -![](images~/MessageBrowser.png) - -Select your ROS message folder at the top, then you can navigate through the folder structure to find the .msg files. Click the "Build msg" button to build the messages you want. - -# Message importers - -For a more automated workflow, you may find it useful to simply drag an entire ROS module folder into your Unity project. Unity will automatically find any .msg and .srv files in the folder structure, and convert them into C# message classes for you. And the classes will be updated if the .msg or .srv files change on disk. - -NB: The message generation system looks for a ROS package.xml to determine what code to generate, so if you're working this way it's recommended to import an entire ROS module, rather than individual .msg files, into your Unity project. \ No newline at end of file +# Message Generation + +To work with a ROS message in Unity, you first need to generate the corresponding C# message class. Select the menu option "RosMessageGeneration->Browse..." to open the message browser. + +![](images~/MessageBrowser.png) + +Select your ROS message folder at the top, then you can navigate through the folder structure to find the .msg files. Click the "Build msg" button to build the messages you want. + +# Message importers + +For a more automated workflow, you may find it useful to simply drag an entire ROS module folder into your Unity project. Unity will automatically find any .msg and .srv files in the folder structure, and convert them into C# message classes for you. And the classes will be updated if the .msg or .srv files change on disk. + +NB: The message generation system looks for a ROS package.xml to determine what code to generate, so if you're working this way it's recommended to import an entire ROS module, rather than individual .msg files, into your Unity project. diff --git a/README.md b/README.md index 8471072e..e45c16d0 100644 --- a/README.md +++ b/README.md @@ -3,14 +3,14 @@ [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) ## Installation -1. Using Unity 2020.2 or later, open the package manager from `Window` -> `Package Manager` and select "Add package from git URL..." +1. Using Unity 2020.2 or later, open the package manager from `Window` -> `Package Manager` and select "Add package from git URL..." ![image](https://user-images.githubusercontent.com/29758400/110989310-8ea36180-8326-11eb-8318-f67ee200a23d.png) 2. Enter the following URL. If you don't want to use the latest version, substitute your desired version tag where we've put `v0.3.0` in this example: `https://github.com/Unity-Technologies/ROS-TCP-Connector.git?path=/com.unity.robotics.ros-tcp-connector#v0.3.0` 3. Click `Add`. -## Tutorials +## Tutorials Scripts used to send [ROS](https://www.ros.org/) messages to an [TCP endpoint](https://github.com/Unity-Technologies/ROS_TCP_Endpoint) running as a ROS node. This Unity package provides three main features: @@ -27,8 +27,8 @@ Special thanks to the Siemens [ROS# Project Team]( https://github.com/siemens/ro ## Community and Feedback -The Unity Robotics projects are open-source and we encourage and welcome contributions. -If you wish to contribute, be sure to review our [contribution guidelines](CONTRIBUTING.md) +The Unity Robotics projects are open-source and we encourage and welcome contributions. +If you wish to contribute, be sure to review our [contribution guidelines](CONTRIBUTING.md) and [code of conduct](CODE_OF_CONDUCT.md). ## Support @@ -36,7 +36,7 @@ For questions or discussions about Unity Robotics package installations or how t For feature requests, bugs, or other issues, please file a [GitHub issue](https://github.com/Unity-Technologies/ROS-TCP-Connector/issues) using the provided templates and the Robotics team will investigate as soon as possible. -For any other questions or feedback, connect directly with the +For any other questions or feedback, connect directly with the Robotics team at [unity-robotics@unity3d.com](mailto:unity-robotics@unity3d.com). ## License diff --git a/ROSGeometry.md b/ROSGeometry.md index dd888e56..41357942 100644 --- a/ROSGeometry.md +++ b/ROSGeometry.md @@ -1,56 +1,56 @@ -# ROSGeometry component - -In Unity, the X axis points right, Y up, and Z forward. ROS, on the other hand, supports various coordinate frames: in the most commonly-used one, X points forward, Y left, and Z up. In ROS terminology, this frame is called "FLU" (forward, left, up), whereas the Unity coordinate frame would be "RUF" (right, up, forward). - -The ROSGeometry namespace contains code to make it easier to work with these various coordinate frames - letting you be explicit about what coordinates a given value is in at compile time, and managing the conversions for you. It does this with two generic structs, `Vector3` and `Quaternion`. The type parameter C indicates the coordinate frame you're working in - either FLU, or RUF, or perhaps a more exotic frame such as NED (north, east, down) or ENU (east, north, up), commonly used in aviation. - - -# Converting between frames: - -For example, if you need to convert an object's position into the FLU coordinate frame, you might write: - - Vector3 rosPos = obj.transform.position.To(); - -An explicit cast, or calling the constructor, would also produce the same result. - - Vector3 rosPos2 = (Vector3)obj.transform.position; - Vector3 rosPos3 = new Vector3(obj.transform.position); - -To convert back, just access the "toUnity" property on the vector. - - Vector3 unityPos = rosPos.toUnity; - -And the same functions apply for converting Quaternions. - -# Ros Message conversions: - -For convenience, `Vector3` has an implicit conversion into all three of the main ROS position message types: Point, Point32 and Vector3. Similarly, `Quaternion` has an implicit conversion to the ROS Quaternion message. Hence, writing 3d data into a message can often be as simple as writing: - - Imu msg = new Imu(); - msg.linear_acceleration = acceleration.To(); - msg.orientation = rigidbody.transform.rotation.To(); - msg.angular_velocity = rigidbody.angularVelocity.To(); - ros.Send("imu", msg); - -Note, the calls to `To()` above are essential. Normal Unity Vector3s or Quaternions do NOT have these conversions. You need to explicitly select a coordinate frame before converting to a ROS message. - -Unity's standard Transform class also has a `To()` extension method that returns a ROS Transform message. So sending a Transform message typically looks like: - - ros.Send("topic", obj.transform.To()); - -# Converting incoming messages - -You can also convert Points, Point32s and Vector3s back into Unity coordinates. To convert a Point in coordinate space C directly into a Unity Vector3, you can write `From`. For example: - - void SubscriberCallback(Point p) - { - transform.position = p.From(); - } - -Or, if you need to work with them in the FLU coordinate space for now, you can write: - - Vector3 rosPos = p.As(); - -(Note that this does NOT do any coordinate conversion. It simply assumes the point is in the FLU coordinate frame already, and transfers it into an appropriate container.) - -And again, the same goes for converting a Quaternion message into a Unity Quaternion or `Quaternion`. \ No newline at end of file +# ROSGeometry component + +In Unity, the X axis points right, Y up, and Z forward. ROS, on the other hand, supports various coordinate frames: in the most commonly-used one, X points forward, Y left, and Z up. In ROS terminology, this frame is called "FLU" (forward, left, up), whereas the Unity coordinate frame would be "RUF" (right, up, forward). + +The ROSGeometry namespace contains code to make it easier to work with these various coordinate frames - letting you be explicit about what coordinates a given value is in at compile time, and managing the conversions for you. It does this with two generic structs, `Vector3` and `Quaternion`. The type parameter C indicates the coordinate frame you're working in - either FLU, or RUF, or perhaps a more exotic frame such as NED (north, east, down) or ENU (east, north, up), commonly used in aviation. + + +# Converting between frames: + +For example, if you need to convert an object's position into the FLU coordinate frame, you might write: + + Vector3 rosPos = obj.transform.position.To(); + +An explicit cast, or calling the constructor, would also produce the same result. + + Vector3 rosPos2 = (Vector3)obj.transform.position; + Vector3 rosPos3 = new Vector3(obj.transform.position); + +To convert back, just access the "toUnity" property on the vector. + + Vector3 unityPos = rosPos.toUnity; + +And the same functions apply for converting Quaternions. + +# Ros Message conversions: + +For convenience, `Vector3` has an implicit conversion into all three of the main ROS position message types: Point, Point32 and Vector3. Similarly, `Quaternion` has an implicit conversion to the ROS Quaternion message. Hence, writing 3d data into a message can often be as simple as writing: + + Imu msg = new Imu(); + msg.linear_acceleration = acceleration.To(); + msg.orientation = rigidbody.transform.rotation.To(); + msg.angular_velocity = rigidbody.angularVelocity.To(); + ros.Send("imu", msg); + +Note, the calls to `To()` above are essential. Normal Unity Vector3s or Quaternions do NOT have these conversions. You need to explicitly select a coordinate frame before converting to a ROS message. + +Unity's standard Transform class also has a `To()` extension method that returns a ROS Transform message. So sending a Transform message typically looks like: + + ros.Send("topic", obj.transform.To()); + +# Converting incoming messages + +You can also convert Points, Point32s and Vector3s back into Unity coordinates. To convert a Point in coordinate space C directly into a Unity Vector3, you can write `From`. For example: + + void SubscriberCallback(Point p) + { + transform.position = p.From(); + } + +Or, if you need to work with them in the FLU coordinate space for now, you can write: + + Vector3 rosPos = p.As(); + +(Note that this does NOT do any coordinate conversion. It simply assumes the point is in the FLU coordinate frame already, and transfers it into an appropriate container.) + +And again, the same goes for converting a Quaternion message into a Unity Quaternion or `Quaternion`. From 418c7cddb82eee0549749d31b4e23568179e2efe Mon Sep 17 00:00:00 2001 From: Shuo Diao Date: Mon, 24 May 2021 15:38:30 -0700 Subject: [PATCH 5/5] Remove ruby setup; Change to run pre-commit only on pull-requests --- .github/workflows/pre-commit.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index a3b890c3..8aa9a716 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -2,8 +2,6 @@ name: pre-commit on: pull_request: - push: - branches: [dev] jobs: pre-commit: @@ -13,9 +11,6 @@ jobs: - uses: actions/setup-python@v2 with: python-version: 3.7.x - - uses: actions/setup-ruby@v1 - with: - ruby-version: '2.6' - uses: actions/setup-dotnet@v1 with: dotnet-version: '3.1.x'