* Add editorconfig for formatting

* Use linter to format the package code

* Add pre-commit hook

* Fix line endings for markdown

Fix trailing-whitespace

* Remove ruby setup; Change to run pre-commit only on pull-requests
This commit is contained in:
Shuo Diao 2021-05-25 12:00:57 -07:00 коммит произвёл GitHub
Родитель 0810c0d286
Коммит a8d7f53d49
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
107 изменённых файлов: 831 добавлений и 698 удалений

75
.editorconfig Normal file
Просмотреть файл

@ -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|<auto-generated>
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

17
.github/workflows/pre-commit.yml поставляемый Normal file
Просмотреть файл

@ -0,0 +1,17 @@
name: pre-commit
on:
pull_request:
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-dotnet@v1
with:
dotnet-version: '3.1.x'
- uses: pre-commit/action@v2.0.0

31
.pre-commit-config.yaml Normal file
Просмотреть файл

@ -0,0 +1,31 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: mixed-line-ending
exclude: >
(?x)^(
.*cs.meta|
.*.css|
.*.meta|
.*.mat|
.*.preset|
.*.lighting
)$
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]

Просмотреть файл

@ -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 @@ namespace Unity.Robotics.ROSTCPConnector.Editor.MessageGeneration
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 @@ namespace Unity.Robotics.ROSTCPConnector.Editor.MessageGeneration
case ".action":
string[] builtActionPaths = ActionAutoGen.GetActionClassPaths(path, MessageGenBrowserSettings.Get().outputPath);
return builtActionPaths.All(file => File.Exists(file)) ? CachedEntryStatus.BuiltActionFile : CachedEntryStatus.UnbuiltActionFile;
}
}
return CachedEntryStatus.Ignored;
}

Просмотреть файл

@ -48,7 +48,7 @@ namespace Unity.Robotics.ROSTCPConnector.Editor.MessageGeneration
if (!fullPath.StartsWith(dataPath))
return "";
return fullPath.Substring(dataPath.Length+1);
return fullPath.Substring(dataPath.Length + 1);
}
}
}

Просмотреть файл

@ -15,7 +15,7 @@ namespace Unity.Robotics.ROSTCPConnector.Editor.MessageGeneration
{
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);
@ -23,7 +23,7 @@ namespace Unity.Robotics.ROSTCPConnector.Editor.MessageGeneration
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);
}
}

Просмотреть файл

@ -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<TActionGoal, TActionResult, TActionFeedback, TGoal, TResult, TFeedback> : Message
where TActionGoal: ActionGoal<TGoal>
where TActionResult: ActionResult<TResult>
where TActionGoal : ActionGoal<TGoal>
where TActionResult : ActionResult<TResult>
where TActionFeedback : ActionFeedback<TFeedback>
where TGoal : Message
where TResult : Message
@ -29,7 +29,8 @@ namespace Unity.Robotics.ROSTCPConnector.MessageGeneration
public Action() { }
public Action(TActionGoal action_goal, TActionResult action_result, TActionFeedback action_feedback) {
public Action(TActionGoal action_goal, TActionResult action_result, TActionFeedback action_feedback)
{
this.action_goal = action_goal;
this.action_result = action_result;
this.action_feedback = action_feedback;

Просмотреть файл

@ -1,4 +1,4 @@
/*
/*
© Siemens AG, 2019
Author: Sifan Ye (sifan.ye@siemens.com)
Licensed under the Apache License, Version 2.0 (the "License");
@ -240,12 +240,12 @@ namespace Unity.Robotics.ROSTCPConnector.MessageGeneration
// Inherited params
if (msgType.Equals("Goal"))
{
inheritedParams = new[] {"header", "goal_id"};
inheritedParams = new[] { "header", "goal_id" };
}
else if (msgType.Equals("Result") || msgType.Equals("Feedback"))
{
inheritedParams = new[] {"header", "status"};
inheritedParams = new[] { "header", "status" };
}
foreach (string paramName in inheritedParams)
@ -258,7 +258,7 @@ namespace Unity.Robotics.ROSTCPConnector.MessageGeneration
function += TWO_TABS + ONE_TAB + "listOfSerializations.AddRange(this." + identifier + ".SerializationStatements());\n";
}
function += "\n" + MsgAutoGenUtilities.TWO_TABS + MsgAutoGenUtilities.ONE_TAB +"return listOfSerializations;\n";
function += "\n" + MsgAutoGenUtilities.TWO_TABS + MsgAutoGenUtilities.ONE_TAB + "return listOfSerializations;\n";
function += MsgAutoGenUtilities.TWO_TABS + "}\n\n";
return function;
@ -275,12 +275,12 @@ namespace Unity.Robotics.ROSTCPConnector.MessageGeneration
// Inherited params
if (msgType.Equals("Goal"))
{
inheritedParams = new[] {"header", "goal_id"};
inheritedParams = new[] { "header", "goal_id" };
}
else if (msgType.Equals("Result") || msgType.Equals("Feedback"))
{
inheritedParams = new[] {"header", "status"};
inheritedParams = new[] { "header", "status" };
}
foreach (string paramName in inheritedParams)
@ -293,7 +293,7 @@ namespace Unity.Robotics.ROSTCPConnector.MessageGeneration
function += TWO_TABS + ONE_TAB + "offset = this." + identifier + ".Deserialize(data, offset);\n";
}
function += "\n" + MsgAutoGenUtilities.TWO_TABS + MsgAutoGenUtilities.ONE_TAB +"return offset;\n";
function += "\n" + MsgAutoGenUtilities.TWO_TABS + MsgAutoGenUtilities.ONE_TAB + "return offset;\n";
function += MsgAutoGenUtilities.TWO_TABS + "}\n\n";
return function;
@ -307,7 +307,7 @@ namespace Unity.Robotics.ROSTCPConnector.MessageGeneration
string outPath = Path.Combine(this.outPath, wrapperName + ".cs");
string imports =
"using System.Collections.Generic;\n"+
"using System.Collections.Generic;\n" +
"using Unity.Robotics.ROSTCPConnector.MessageGeneration;\n" +
"using RosMessageTypes.Std;\n" +
"using RosMessageTypes.Actionlib;\n\n";
@ -366,7 +366,7 @@ namespace Unity.Robotics.ROSTCPConnector.MessageGeneration
string outPath = Path.Combine(this.outPath, className + ".cs");
string imports =
"using System.Collections.Generic;\n"+
"using System.Collections.Generic;\n" +
"using Unity.Robotics.ROSTCPConnector.MessageGeneration;\n" +
"\n\n";

Просмотреть файл

@ -1,4 +1,4 @@
/*
/*
© Siemens AG, 2019
Author: Sifan Ye (sifan.ye@siemens.com)
@ -30,7 +30,8 @@ namespace Unity.Robotics.ROSTCPConnector.MessageGeneration
status = new MGoalStatus();
}
public ActionFeedback(MHeader header, MGoalStatus status) {
public ActionFeedback(MHeader header, MGoalStatus status)
{
this.header = header;
this.status = status;
}

Просмотреть файл

@ -1,4 +1,4 @@
/*
/*
© Siemens AG, 2019
Author: Sifan Ye (sifan.ye@siemens.com)
@ -24,12 +24,14 @@ namespace Unity.Robotics.ROSTCPConnector.MessageGeneration
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;
}

Просмотреть файл

@ -1,4 +1,4 @@
/*
/*
© Siemens AG, 2019
Author: Sifan Ye (sifan.ye@siemens.com)
@ -25,12 +25,14 @@ namespace Unity.Robotics.ROSTCPConnector.MessageGeneration
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;
}

Просмотреть файл

@ -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 @@ namespace Unity.Robotics.ROSTCPConnector.MessageGeneration
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 @@ namespace Unity.Robotics.ROSTCPConnector.MessageGeneration
public static List<string> 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);

Просмотреть файл

@ -1,4 +1,4 @@
/*
/*
© Siemens AG, 2019
Author: Sifan Ye (sifan.ye@siemens.com)
Licensed under the Apache License, Version 2.0 (the "License");

Просмотреть файл

@ -1,4 +1,4 @@
/*
/*
© Siemens AG, 2019
Author: Sifan Ye (sifan.ye@siemens.com)
Licensed under the Apache License, Version 2.0 (the "License");

Просмотреть файл

@ -1,4 +1,4 @@
/*
/*
© Siemens AG, 2019
Author: Sifan Ye (sifan.ye@siemens.com)
Licensed under the Apache License, Version 2.0 (the "License");

Просмотреть файл

@ -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 @@ namespace Unity.Robotics.ROSTCPConnector.MessageGeneration
{"Duration", "new Duration()"}
};
public static readonly Dictionary<string, string> numericTypeDeserializationFunctions = new Dictionary<string, string>
public static readonly Dictionary<string, string> numericTypeDeserializationFunctions = new Dictionary<string, string>
{
{"sbyte", "(sbyte)data[offset];"},
{"byte", "data[offset];"},
@ -79,7 +79,7 @@ namespace Unity.Robotics.ROSTCPConnector.MessageGeneration
{"ulong", "BitConverter.ToUInt64(data, offset)"}
};
public static readonly Dictionary<string, int> numericTypeByteSize = new Dictionary<string, int>
public static readonly Dictionary<string, int> numericTypeByteSize = new Dictionary<string, int>
{
{"sbyte", 1},
{"byte", 1},
@ -115,7 +115,8 @@ namespace Unity.Robotics.ROSTCPConnector.MessageGeneration
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);
}

Просмотреть файл

@ -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 @@ namespace Unity.Robotics.ROSTCPConnector.MessageGeneration
return warnings;
}
public static List<string> GeneratePackageServices(string inPath, string outPath, string rosPackageName = "", bool verbose = false) {
public static List<string> GeneratePackageServices(string inPath, string outPath, string rosPackageName = "", bool verbose = false)
{
List<string> warnings = new List<string>();
string[] files = Directory.GetFiles(Path.Combine(inPath, "srv"), "*.srv");
@ -89,7 +90,8 @@ namespace Unity.Robotics.ROSTCPConnector.MessageGeneration
Console.Error.WriteLine("No service files found!");
return warnings;
}
else {
else
{
if (verbose)
{
Console.WriteLine("Found " + files.Length + " service files.");
@ -103,7 +105,8 @@ namespace Unity.Robotics.ROSTCPConnector.MessageGeneration
return warnings;
}
public static List<string> GenerateDirectoryServices(string inPath, string outPath, bool verbose = false) {
public static List<string> GenerateDirectoryServices(string inPath, string outPath, bool verbose = false)
{
List<string> warnings = new List<string>();
if (inPath.EndsWith("/") || inPath.EndsWith("\\"))

Просмотреть файл

@ -50,7 +50,7 @@ namespace RosMessageTypes.Actionlib
{
var listOfSerializations = new List<byte[]>();
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 @@ namespace RosMessageTypes.Actionlib
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;

Просмотреть файл

@ -34,7 +34,7 @@ namespace RosMessageTypes.Actionlib
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;
@ -46,8 +46,8 @@ namespace RosMessageTypes.Actionlib
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);

Просмотреть файл

@ -35,7 +35,7 @@ namespace RosMessageTypes.Diagnostic
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;
@ -47,8 +47,8 @@ namespace RosMessageTypes.Diagnostic
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);

Просмотреть файл

@ -49,13 +49,13 @@ namespace RosMessageTypes.Diagnostic
public override List<byte[]> SerializationStatements()
{
var listOfSerializations = new List<byte[]>();
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 @@ namespace RosMessageTypes.Diagnostic
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;
@ -80,8 +80,8 @@ namespace RosMessageTypes.Diagnostic
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);

Просмотреть файл

@ -32,10 +32,10 @@ namespace RosMessageTypes.Diagnostic
{
var listOfSerializations = new List<byte[]>();
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 @@ namespace RosMessageTypes.Diagnostic
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);

Просмотреть файл

@ -36,7 +36,7 @@ namespace RosMessageTypes.Geometry
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;
@ -46,8 +46,8 @@ namespace RosMessageTypes.Geometry
{
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;

Просмотреть файл

@ -28,7 +28,7 @@ namespace RosMessageTypes.Geometry
var listOfSerializations = new List<byte[]>();
listOfSerializations.Add(BitConverter.GetBytes(points.Length));
foreach(var entry in points)
foreach (var entry in points)
listOfSerializations.Add(entry.Serialize());
return listOfSerializations;
@ -39,8 +39,8 @@ namespace RosMessageTypes.Geometry
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);

Просмотреть файл

@ -33,7 +33,7 @@ namespace RosMessageTypes.Geometry
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;
@ -45,8 +45,8 @@ namespace RosMessageTypes.Geometry
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);

Просмотреть файл

@ -36,7 +36,7 @@ namespace RosMessageTypes.Geometry
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;
@ -46,8 +46,8 @@ namespace RosMessageTypes.Geometry
{
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;

Просмотреть файл

@ -36,7 +36,7 @@ namespace RosMessageTypes.Geometry
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;
@ -46,8 +46,8 @@ namespace RosMessageTypes.Geometry
{
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;

Просмотреть файл

@ -41,7 +41,7 @@ namespace RosMessageTypes.Nav
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;
@ -57,8 +57,8 @@ namespace RosMessageTypes.Nav
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);

Просмотреть файл

@ -41,7 +41,7 @@ namespace RosMessageTypes.Nav
listOfSerializations.AddRange(info.SerializationStatements());
listOfSerializations.Add(BitConverter.GetBytes(data.Length));
listOfSerializations.Add((byte[]) (Array)this.data);
listOfSerializations.Add((byte[])(Array)this.data);
return listOfSerializations;
}
@ -53,8 +53,8 @@ namespace RosMessageTypes.Nav
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;

Просмотреть файл

@ -33,7 +33,7 @@ namespace RosMessageTypes.Nav
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;
@ -45,8 +45,8 @@ namespace RosMessageTypes.Nav
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);

Просмотреть файл

@ -36,7 +36,7 @@ namespace RosMessageTypes.Nav
{
var listOfSerializations = new List<byte[]>();
listOfSerializations.AddRange(map.SerializationStatements());
listOfSerializations.Add(new[]{this.result});
listOfSerializations.Add(new[] { this.result });
return listOfSerializations;
}
@ -44,7 +44,7 @@ namespace RosMessageTypes.Nav
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;

Просмотреть файл

@ -32,7 +32,7 @@ namespace RosMessageTypes.ObjectRecognition
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;
@ -45,8 +45,8 @@ namespace RosMessageTypes.ObjectRecognition
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;

Просмотреть файл

@ -68,12 +68,12 @@ namespace RosMessageTypes.ObjectRecognition
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());
@ -89,8 +89,8 @@ namespace RosMessageTypes.ObjectRecognition
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);
@ -99,8 +99,8 @@ namespace RosMessageTypes.ObjectRecognition
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);

Просмотреть файл

@ -39,11 +39,11 @@ namespace RosMessageTypes.ObjectRecognition
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;
@ -55,8 +55,8 @@ namespace RosMessageTypes.ObjectRecognition
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);
@ -64,8 +64,8 @@ namespace RosMessageTypes.ObjectRecognition
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;

Просмотреть файл

@ -44,7 +44,7 @@ namespace RosMessageTypes.ObjectRecognition
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;
@ -57,8 +57,8 @@ namespace RosMessageTypes.ObjectRecognition
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);

Просмотреть файл

@ -33,7 +33,7 @@ namespace RosMessageTypes.ObjectRecognition
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;
@ -45,8 +45,8 @@ namespace RosMessageTypes.ObjectRecognition
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);

Просмотреть файл

@ -49,7 +49,7 @@ namespace RosMessageTypes.Octomap
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;
}
@ -68,8 +68,8 @@ namespace RosMessageTypes.Octomap
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;

Просмотреть файл

@ -57,8 +57,8 @@ namespace RosMessageTypes.RosTcpEndpoint
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;

Просмотреть файл

@ -27,7 +27,7 @@ namespace RosMessageTypes.RosTcpEndpoint
var listOfSerializations = new List<byte[]>();
listOfSerializations.Add(BitConverter.GetBytes(topics.Length));
foreach(var entry in topics)
foreach (var entry in topics)
listOfSerializations.Add(SerializeString(entry));
return listOfSerializations;
@ -38,8 +38,8 @@ namespace RosMessageTypes.RosTcpEndpoint
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;

Просмотреть файл

@ -124,17 +124,17 @@ namespace RosMessageTypes.Sensor
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,19 +159,19 @@ namespace RosMessageTypes.Sensor
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;
@ -179,8 +179,8 @@ namespace RosMessageTypes.Sensor
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;

Просмотреть файл

@ -172,19 +172,19 @@ namespace RosMessageTypes.Sensor
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));
@ -207,29 +207,29 @@ namespace RosMessageTypes.Sensor
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;

Просмотреть файл

@ -50,7 +50,7 @@ namespace RosMessageTypes.Sensor
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;
@ -65,8 +65,8 @@ namespace RosMessageTypes.Sensor
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;

Просмотреть файл

@ -62,8 +62,8 @@ namespace RosMessageTypes.Sensor
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;

Просмотреть файл

@ -70,7 +70,7 @@ namespace RosMessageTypes.Sensor
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));
@ -90,15 +90,15 @@ namespace RosMessageTypes.Sensor
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;

Просмотреть файл

@ -64,17 +64,17 @@ namespace RosMessageTypes.Sensor
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;
@ -85,24 +85,24 @@ namespace RosMessageTypes.Sensor
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;

Просмотреть файл

@ -59,19 +59,19 @@ namespace RosMessageTypes.Sensor
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;
@ -83,8 +83,8 @@ namespace RosMessageTypes.Sensor
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;
@ -94,8 +94,8 @@ namespace RosMessageTypes.Sensor
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;
@ -103,8 +103,8 @@ namespace RosMessageTypes.Sensor
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;
@ -112,8 +112,8 @@ namespace RosMessageTypes.Sensor
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;

Просмотреть файл

@ -39,11 +39,11 @@ namespace RosMessageTypes.Sensor
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;
@ -55,8 +55,8 @@ namespace RosMessageTypes.Sensor
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;
@ -64,8 +64,8 @@ namespace RosMessageTypes.Sensor
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;

Просмотреть файл

@ -39,8 +39,8 @@ namespace RosMessageTypes.Sensor
public override List<byte[]> SerializationStatements()
{
var listOfSerializations = new List<byte[]>();
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 @@ namespace RosMessageTypes.Sensor
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;

Просмотреть файл

@ -28,7 +28,7 @@ namespace RosMessageTypes.Sensor
var listOfSerializations = new List<byte[]>();
listOfSerializations.Add(BitConverter.GetBytes(array.Length));
foreach(var entry in array)
foreach (var entry in array)
listOfSerializations.Add(entry.Serialize());
return listOfSerializations;
@ -39,8 +39,8 @@ namespace RosMessageTypes.Sensor
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);

Просмотреть файл

@ -31,7 +31,7 @@ namespace RosMessageTypes.Sensor
var listOfSerializations = new List<byte[]>();
listOfSerializations.Add(BitConverter.GetBytes(echoes.Length));
foreach(var entry in echoes)
foreach (var entry in echoes)
listOfSerializations.Add(BitConverter.GetBytes(entry));
return listOfSerializations;
@ -42,8 +42,8 @@ namespace RosMessageTypes.Sensor
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;

Просмотреть файл

@ -87,11 +87,11 @@ namespace RosMessageTypes.Sensor
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;
@ -117,8 +117,8 @@ namespace RosMessageTypes.Sensor
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;
@ -126,8 +126,8 @@ namespace RosMessageTypes.Sensor
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;

Просмотреть файл

@ -53,7 +53,7 @@ namespace RosMessageTypes.Sensor
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;
@ -64,8 +64,8 @@ namespace RosMessageTypes.Sensor
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;

Просмотреть файл

@ -60,19 +60,19 @@ namespace RosMessageTypes.Sensor
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;
@ -84,8 +84,8 @@ namespace RosMessageTypes.Sensor
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;
@ -95,8 +95,8 @@ namespace RosMessageTypes.Sensor
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);
@ -104,8 +104,8 @@ namespace RosMessageTypes.Sensor
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);
@ -113,8 +113,8 @@ namespace RosMessageTypes.Sensor
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);

Просмотреть файл

@ -89,11 +89,11 @@ namespace RosMessageTypes.Sensor
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;
@ -119,8 +119,8 @@ namespace RosMessageTypes.Sensor
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);
@ -128,8 +128,8 @@ namespace RosMessageTypes.Sensor
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);

Просмотреть файл

@ -80,9 +80,9 @@ namespace RosMessageTypes.Sensor
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;
}
@ -98,13 +98,13 @@ namespace RosMessageTypes.Sensor
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;

Просмотреть файл

@ -42,7 +42,7 @@ namespace RosMessageTypes.Sensor
public override List<byte[]> SerializationStatements()
{
var listOfSerializations = new List<byte[]>();
listOfSerializations.Add(new[]{(byte)this.status});
listOfSerializations.Add(new[] { (byte)this.status });
listOfSerializations.Add(BitConverter.GetBytes(this.service));
return listOfSerializations;
@ -50,7 +50,7 @@ namespace RosMessageTypes.Sensor
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;

Просмотреть файл

@ -43,11 +43,11 @@ namespace RosMessageTypes.Sensor
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;
@ -59,8 +59,8 @@ namespace RosMessageTypes.Sensor
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);
@ -68,8 +68,8 @@ namespace RosMessageTypes.Sensor
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);

Просмотреть файл

@ -72,7 +72,7 @@ namespace RosMessageTypes.Sensor
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));
@ -95,8 +95,8 @@ namespace RosMessageTypes.Sensor
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);
@ -110,8 +110,8 @@ namespace RosMessageTypes.Sensor
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;

Просмотреть файл

@ -50,7 +50,7 @@ namespace RosMessageTypes.Sensor
var listOfSerializations = new List<byte[]>();
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 @@ namespace RosMessageTypes.Sensor
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;

Просмотреть файл

@ -75,7 +75,7 @@ namespace RosMessageTypes.Sensor
{
var listOfSerializations = new List<byte[]>();
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 @@ namespace RosMessageTypes.Sensor
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;

Просмотреть файл

@ -33,11 +33,11 @@ namespace RosMessageTypes.Shape
var listOfSerializations = new List<byte[]>();
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;
@ -48,8 +48,8 @@ namespace RosMessageTypes.Shape
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);
@ -57,8 +57,8 @@ namespace RosMessageTypes.Shape
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);

Просмотреть файл

@ -28,7 +28,7 @@ namespace RosMessageTypes.Shape
var listOfSerializations = new List<byte[]>();
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;
@ -37,8 +37,8 @@ namespace RosMessageTypes.Shape
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;

Просмотреть файл

@ -32,7 +32,7 @@ namespace RosMessageTypes.Shape
var listOfSerializations = new List<byte[]>();
Array.Resize(ref coef, 4);
foreach(var entry in coef)
foreach (var entry in coef)
listOfSerializations.Add(BitConverter.GetBytes(entry));
return listOfSerializations;
@ -41,8 +41,8 @@ namespace RosMessageTypes.Shape
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;

Просмотреть файл

@ -56,10 +56,10 @@ namespace RosMessageTypes.Shape
public override List<byte[]> SerializationStatements()
{
var listOfSerializations = new List<byte[]>();
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 @@ namespace RosMessageTypes.Shape
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;

Просмотреть файл

@ -25,14 +25,14 @@ namespace RosMessageTypes.Std
public override List<byte[]> SerializationStatements()
{
var listOfSerializations = new List<byte[]>();
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;

Просмотреть файл

@ -35,7 +35,7 @@ namespace RosMessageTypes.Std
listOfSerializations.AddRange(layout.SerializationStatements());
listOfSerializations.Add(BitConverter.GetBytes(data.Length));
listOfSerializations.Add((byte[]) (Array)this.data);
listOfSerializations.Add((byte[])(Array)this.data);
return listOfSerializations;
}
@ -46,8 +46,8 @@ namespace RosMessageTypes.Std
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;

Просмотреть файл

@ -25,14 +25,14 @@ namespace RosMessageTypes.Std
public override List<byte[]> SerializationStatements()
{
var listOfSerializations = new List<byte[]>();
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;

Просмотреть файл

@ -35,7 +35,7 @@ namespace RosMessageTypes.Std
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;
@ -47,8 +47,8 @@ namespace RosMessageTypes.Std
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;

Просмотреть файл

@ -35,7 +35,7 @@ namespace RosMessageTypes.Std
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;
@ -47,8 +47,8 @@ namespace RosMessageTypes.Std
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;

Просмотреть файл

@ -35,7 +35,7 @@ namespace RosMessageTypes.Std
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;
@ -47,8 +47,8 @@ namespace RosMessageTypes.Std
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;

Просмотреть файл

@ -35,7 +35,7 @@ namespace RosMessageTypes.Std
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;
@ -47,8 +47,8 @@ namespace RosMessageTypes.Std
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;

Просмотреть файл

@ -35,7 +35,7 @@ namespace RosMessageTypes.Std
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;
@ -47,8 +47,8 @@ namespace RosMessageTypes.Std
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;

Просмотреть файл

@ -25,14 +25,14 @@ namespace RosMessageTypes.Std
public override List<byte[]> SerializationStatements()
{
var listOfSerializations = new List<byte[]>();
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;

Просмотреть файл

@ -35,7 +35,7 @@ namespace RosMessageTypes.Std
listOfSerializations.AddRange(layout.SerializationStatements());
listOfSerializations.Add(BitConverter.GetBytes(data.Length));
listOfSerializations.Add((byte[]) (Array)this.data);
listOfSerializations.Add((byte[])(Array)this.data);
return listOfSerializations;
}
@ -46,8 +46,8 @@ namespace RosMessageTypes.Std
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;

Просмотреть файл

@ -54,7 +54,7 @@ namespace RosMessageTypes.Std
var listOfSerializations = new List<byte[]>();
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));
@ -66,8 +66,8 @@ namespace RosMessageTypes.Std
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);

Просмотреть файл

@ -35,7 +35,7 @@ namespace RosMessageTypes.Std
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;
@ -47,8 +47,8 @@ namespace RosMessageTypes.Std
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;

Просмотреть файл

@ -35,7 +35,7 @@ namespace RosMessageTypes.Std
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;
@ -47,8 +47,8 @@ namespace RosMessageTypes.Std
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;

Просмотреть файл

@ -35,7 +35,7 @@ namespace RosMessageTypes.Std
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;
@ -47,8 +47,8 @@ namespace RosMessageTypes.Std
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;

Просмотреть файл

@ -25,14 +25,14 @@ namespace RosMessageTypes.Std
public override List<byte[]> SerializationStatements()
{
var listOfSerializations = new List<byte[]>();
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;

Просмотреть файл

@ -46,8 +46,8 @@ namespace RosMessageTypes.Std
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;

Просмотреть файл

@ -35,11 +35,11 @@ namespace RosMessageTypes.Trajectory
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;
@ -51,8 +51,8 @@ namespace RosMessageTypes.Trajectory
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;
@ -62,8 +62,8 @@ namespace RosMessageTypes.Trajectory
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);

Просмотреть файл

@ -43,19 +43,19 @@ namespace RosMessageTypes.Trajectory
var listOfSerializations = new List<byte[]>();
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());
@ -67,8 +67,8 @@ namespace RosMessageTypes.Trajectory
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;
@ -76,8 +76,8 @@ namespace RosMessageTypes.Trajectory
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;
@ -85,8 +85,8 @@ namespace RosMessageTypes.Trajectory
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;
@ -94,8 +94,8 @@ namespace RosMessageTypes.Trajectory
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;

Просмотреть файл

@ -40,11 +40,11 @@ namespace RosMessageTypes.Trajectory
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;
@ -56,8 +56,8 @@ namespace RosMessageTypes.Trajectory
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;
@ -67,8 +67,8 @@ namespace RosMessageTypes.Trajectory
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);

Просмотреть файл

@ -40,15 +40,15 @@ namespace RosMessageTypes.Trajectory
var listOfSerializations = new List<byte[]>();
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());
@ -60,8 +60,8 @@ namespace RosMessageTypes.Trajectory
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);
@ -69,8 +69,8 @@ namespace RosMessageTypes.Trajectory
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);
@ -78,8 +78,8 @@ namespace RosMessageTypes.Trajectory
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);

Просмотреть файл

@ -88,16 +88,16 @@ namespace RosMessageTypes.Visualization
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,15 +120,15 @@ namespace RosMessageTypes.Visualization
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);
@ -136,8 +136,8 @@ namespace RosMessageTypes.Visualization
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);

Просмотреть файл

@ -64,11 +64,11 @@ namespace RosMessageTypes.Visualization
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;
@ -91,8 +91,8 @@ namespace RosMessageTypes.Visualization
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);
@ -100,8 +100,8 @@ namespace RosMessageTypes.Visualization
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);

Просмотреть файл

@ -101,12 +101,12 @@ namespace RosMessageTypes.Visualization
var listOfSerializations = new List<byte[]>();
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 @@ namespace RosMessageTypes.Visualization
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);

Просмотреть файл

@ -78,7 +78,7 @@ namespace RosMessageTypes.Visualization
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 @@ namespace RosMessageTypes.Visualization
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);

Просмотреть файл

@ -44,7 +44,7 @@ namespace RosMessageTypes.Visualization
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;
@ -61,8 +61,8 @@ namespace RosMessageTypes.Visualization
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);

Просмотреть файл

@ -60,18 +60,18 @@ namespace RosMessageTypes.Visualization
var listOfSerializations = new List<byte[]>();
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,13 +85,13 @@ namespace RosMessageTypes.Visualization
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);
@ -99,8 +99,8 @@ namespace RosMessageTypes.Visualization
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);
@ -108,8 +108,8 @@ namespace RosMessageTypes.Visualization
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;

Просмотреть файл

@ -113,11 +113,11 @@ namespace RosMessageTypes.Visualization
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));
@ -148,8 +148,8 @@ namespace RosMessageTypes.Visualization
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);
@ -157,8 +157,8 @@ namespace RosMessageTypes.Visualization
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);

Просмотреть файл

@ -27,7 +27,7 @@ namespace RosMessageTypes.Visualization
var listOfSerializations = new List<byte[]>();
listOfSerializations.Add(BitConverter.GetBytes(markers.Length));
foreach(var entry in markers)
foreach (var entry in markers)
listOfSerializations.Add(entry.Serialize());
return listOfSerializations;
@ -38,8 +38,8 @@ namespace RosMessageTypes.Visualization
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);

Просмотреть файл

@ -83,7 +83,7 @@ namespace RosMessageTypes.Visualization
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 @@ namespace RosMessageTypes.Visualization
offset += 4;
this.command = DeserializeString(data, offset, commandStringBytesLength);
offset += commandStringBytesLength;
this.command_type = data[offset];;
this.command_type = data[offset]; ;
offset += 1;
return offset;

Просмотреть файл

@ -125,7 +125,7 @@ namespace Unity.Robotics.ROSTCPConnector
if (elapsedTime <= brightDuration)
return bright;
else
return Color.Lerp(mid, dark, elapsedTime/fadeToDarkDuration);
return Color.Lerp(mid, dark, elapsedTime / fadeToDarkDuration);
}
void OnGUI()

Просмотреть файл

@ -243,12 +243,12 @@ namespace Unity.Robotics.ROSTCPConnector
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 @@ namespace Unity.Robotics.ROSTCPConnector
//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)

Просмотреть файл

@ -1,4 +1,4 @@
using System.Collections;
using System.Collections;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;