* 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

2
.github/PULL_REQUEST_TEMPLATE.md поставляемый
Просмотреть файл

@ -16,7 +16,7 @@ Provide any relevant links here.
## Testing and Verification
Please describe the tests that you ran to verify your changes. Please also provide instructions, ROS packages, and Unity project files as appropriate so we can reproduce the test environment.
Please describe the tests that you ran to verify your changes. Please also provide instructions, ROS packages, and Unity project files as appropriate so we can reproduce the test environment.
### Test Configuration:
- Unity Version: [e.g. Unity 2020.2.0f1]

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,7 +1,7 @@
# Contribution Guidelines
Thank you for your interest in contributing to Unity Robotics! To facilitate your
contributions, we've outlined a brief set of guidelines to ensure that your extensions
Thank you for your interest in contributing to Unity Robotics! To facilitate your
contributions, we've outlined a brief set of guidelines to ensure that your extensions
can be easily integrated.
## Communication
@ -40,10 +40,10 @@ We run continuous integration on all PRs; all tests must be passing before the P
All Python code should follow the [PEP 8 style guidelines](https://pep8.org/).
All C# code should follow the [Microsoft C# Coding Conventions](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/inside-a-program/coding-conventions).
Additionally, the [Unity Coding package](https://docs.unity3d.com/Packages/com.unity.coding@0.1/manual/index.html)
can be used to format, encode, and lint your code according to the standard Unity
development conventions. Be aware that these Unity conventions will supersede the
All C# code should follow the [Microsoft C# Coding Conventions](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/inside-a-program/coding-conventions).
Additionally, the [Unity Coding package](https://docs.unity3d.com/Packages/com.unity.coding@0.1/manual/index.html)
can be used to format, encode, and lint your code according to the standard Unity
development conventions. Be aware that these Unity conventions will supersede the
Microsoft C# Coding Conventions where applicable.
Please note that even if the code you are changing does not adhere to these guidelines,
@ -60,5 +60,5 @@ email us at [unity-robotics@unity3d.com](mailto:unity-robotics@unity3d.com).
## Contribution review
Once you have a change ready following the above ground rules, simply make a
Once you have a change ready following the above ground rules, simply make a
pull request in GitHub.

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

@ -1,13 +1,13 @@
# Message Generation
To work with a ROS message in Unity, you first need to generate the corresponding C# message class. Select the menu option "RosMessageGeneration->Browse..." to open the message browser.
![](images~/MessageBrowser.png)
Select your ROS message folder at the top, then you can navigate through the folder structure to find the .msg files. Click the "Build msg" button to build the messages you want.
# Message importers
For a more automated workflow, you may find it useful to simply drag an entire ROS module folder into your Unity project. Unity will automatically find any .msg and .srv files in the folder structure, and convert them into C# message classes for you. And the classes will be updated if the .msg or .srv files change on disk.
NB: The message generation system looks for a ROS package.xml to determine what code to generate, so if you're working this way it's recommended to import an entire ROS module, rather than individual .msg files, into your Unity project.
# Message Generation
To work with a ROS message in Unity, you first need to generate the corresponding C# message class. Select the menu option "RosMessageGeneration->Browse..." to open the message browser.
![](images~/MessageBrowser.png)
Select your ROS message folder at the top, then you can navigate through the folder structure to find the .msg files. Click the "Build msg" button to build the messages you want.
# Message importers
For a more automated workflow, you may find it useful to simply drag an entire ROS module folder into your Unity project. Unity will automatically find any .msg and .srv files in the folder structure, and convert them into C# message classes for you. And the classes will be updated if the .msg or .srv files change on disk.
NB: The message generation system looks for a ROS package.xml to determine what code to generate, so if you're working this way it's recommended to import an entire ROS module, rather than individual .msg files, into your Unity project.

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

@ -3,14 +3,14 @@
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
## Installation
1. Using Unity 2020.2 or later, open the package manager from `Window` -> `Package Manager` and select "Add package from git URL..."
1. Using Unity 2020.2 or later, open the package manager from `Window` -> `Package Manager` and select "Add package from git URL..."
![image](https://user-images.githubusercontent.com/29758400/110989310-8ea36180-8326-11eb-8318-f67ee200a23d.png)
2. Enter the following URL. If you don't want to use the latest version, substitute your desired version tag where we've put `v0.3.0` in this example:
`https://github.com/Unity-Technologies/ROS-TCP-Connector.git?path=/com.unity.robotics.ros-tcp-connector#v0.3.0`
3. Click `Add`.
## Tutorials
## Tutorials
Scripts used to send [ROS](https://www.ros.org/) messages to an [TCP endpoint](https://github.com/Unity-Technologies/ROS_TCP_Endpoint) running as a ROS node.
This Unity package provides three main features:
@ -27,8 +27,8 @@ Special thanks to the Siemens [ROS# Project Team]( https://github.com/siemens/ro
## Community and Feedback
The Unity Robotics projects are open-source and we encourage and welcome contributions.
If you wish to contribute, be sure to review our [contribution guidelines](CONTRIBUTING.md)
The Unity Robotics projects are open-source and we encourage and welcome contributions.
If you wish to contribute, be sure to review our [contribution guidelines](CONTRIBUTING.md)
and [code of conduct](CODE_OF_CONDUCT.md).
## Support
@ -36,7 +36,7 @@ For questions or discussions about Unity Robotics package installations or how t
For feature requests, bugs, or other issues, please file a [GitHub issue](https://github.com/Unity-Technologies/ROS-TCP-Connector/issues) using the provided templates and the Robotics team will investigate as soon as possible.
For any other questions or feedback, connect directly with the
For any other questions or feedback, connect directly with the
Robotics team at [unity-robotics@unity3d.com](mailto:unity-robotics@unity3d.com).
## License

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

@ -1,56 +1,56 @@
# ROSGeometry component
In Unity, the X axis points right, Y up, and Z forward. ROS, on the other hand, supports various coordinate frames: in the most commonly-used one, X points forward, Y left, and Z up. In ROS terminology, this frame is called "FLU" (forward, left, up), whereas the Unity coordinate frame would be "RUF" (right, up, forward).
The ROSGeometry namespace contains code to make it easier to work with these various coordinate frames - letting you be explicit about what coordinates a given value is in at compile time, and managing the conversions for you. It does this with two generic structs, `Vector3<C>` and `Quaternion<C>`. The type parameter C indicates the coordinate frame you're working in - either FLU, or RUF, or perhaps a more exotic frame such as NED (north, east, down) or ENU (east, north, up), commonly used in aviation.
# Converting between frames:
For example, if you need to convert an object's position into the FLU coordinate frame, you might write:
Vector3<FLU> rosPos = obj.transform.position.To<FLU>();
An explicit cast, or calling the constructor, would also produce the same result.
Vector3<FLU> rosPos2 = (Vector3<FLU>)obj.transform.position;
Vector3<FLU> rosPos3 = new Vector3<FLU>(obj.transform.position);
To convert back, just access the "toUnity" property on the vector.
Vector3 unityPos = rosPos.toUnity;
And the same functions apply for converting Quaternions.
# Ros Message conversions:
For convenience, `Vector3<C>` has an implicit conversion into all three of the main ROS position message types: Point, Point32 and Vector3. Similarly, `Quaternion<C>` has an implicit conversion to the ROS Quaternion message. Hence, writing 3d data into a message can often be as simple as writing:
Imu msg = new Imu();
msg.linear_acceleration = acceleration.To<FLU>();
msg.orientation = rigidbody.transform.rotation.To<FLU>();
msg.angular_velocity = rigidbody.angularVelocity.To<FLU>();
ros.Send("imu", msg);
Note, the calls to `To<FLU>()` above are essential. Normal Unity Vector3s or Quaternions do NOT have these conversions. You need to explicitly select a coordinate frame before converting to a ROS message.
Unity's standard Transform class also has a `To<C>()` extension method that returns a ROS Transform message. So sending a Transform message typically looks like:
ros.Send("topic", obj.transform.To<FLU>());
# Converting incoming messages
You can also convert Points, Point32s and Vector3s back into Unity coordinates. To convert a Point in coordinate space C directly into a Unity Vector3, you can write `From<C>`. For example:
void SubscriberCallback(Point p)
{
transform.position = p.From<FLU>();
}
Or, if you need to work with them in the FLU coordinate space for now, you can write:
Vector3<FLU> rosPos = p.As<FLU>();
(Note that this does NOT do any coordinate conversion. It simply assumes the point is in the FLU coordinate frame already, and transfers it into an appropriate container.)
And again, the same goes for converting a Quaternion message into a Unity Quaternion or `Quaternion<C>`.
# ROSGeometry component
In Unity, the X axis points right, Y up, and Z forward. ROS, on the other hand, supports various coordinate frames: in the most commonly-used one, X points forward, Y left, and Z up. In ROS terminology, this frame is called "FLU" (forward, left, up), whereas the Unity coordinate frame would be "RUF" (right, up, forward).
The ROSGeometry namespace contains code to make it easier to work with these various coordinate frames - letting you be explicit about what coordinates a given value is in at compile time, and managing the conversions for you. It does this with two generic structs, `Vector3<C>` and `Quaternion<C>`. The type parameter C indicates the coordinate frame you're working in - either FLU, or RUF, or perhaps a more exotic frame such as NED (north, east, down) or ENU (east, north, up), commonly used in aviation.
# Converting between frames:
For example, if you need to convert an object's position into the FLU coordinate frame, you might write:
Vector3<FLU> rosPos = obj.transform.position.To<FLU>();
An explicit cast, or calling the constructor, would also produce the same result.
Vector3<FLU> rosPos2 = (Vector3<FLU>)obj.transform.position;
Vector3<FLU> rosPos3 = new Vector3<FLU>(obj.transform.position);
To convert back, just access the "toUnity" property on the vector.
Vector3 unityPos = rosPos.toUnity;
And the same functions apply for converting Quaternions.
# Ros Message conversions:
For convenience, `Vector3<C>` has an implicit conversion into all three of the main ROS position message types: Point, Point32 and Vector3. Similarly, `Quaternion<C>` has an implicit conversion to the ROS Quaternion message. Hence, writing 3d data into a message can often be as simple as writing:
Imu msg = new Imu();
msg.linear_acceleration = acceleration.To<FLU>();
msg.orientation = rigidbody.transform.rotation.To<FLU>();
msg.angular_velocity = rigidbody.angularVelocity.To<FLU>();
ros.Send("imu", msg);
Note, the calls to `To<FLU>()` above are essential. Normal Unity Vector3s or Quaternions do NOT have these conversions. You need to explicitly select a coordinate frame before converting to a ROS message.
Unity's standard Transform class also has a `To<C>()` extension method that returns a ROS Transform message. So sending a Transform message typically looks like:
ros.Send("topic", obj.transform.To<FLU>());
# Converting incoming messages
You can also convert Points, Point32s and Vector3s back into Unity coordinates. To convert a Point in coordinate space C directly into a Unity Vector3, you can write `From<C>`. For example:
void SubscriberCallback(Point p)
{
transform.position = p.From<FLU>();
}
Or, if you need to work with them in the FLU coordinate space for now, you can write:
Vector3<FLU> rosPos = p.As<FLU>();
(Note that this does NOT do any coordinate conversion. It simply assumes the point is in the FLU coordinate frame already, and transfers it into an appropriate container.)
And again, the same goes for converting a Quaternion message into a Unity Quaternion or `Quaternion<C>`.

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

@ -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,15 +15,15 @@ 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);
string builtPath = MessageAutoGen.GetMessageClassPath(inputPath, outputPath);
string builtAssetPath = Path.Combine("Assets", MessageGenBrowserSettings.ToRelativePath(builtPath));
AssetDatabase.ImportAsset(builtAssetPath);
Object messageClass = AssetDatabase.LoadAssetAtPath(builtAssetPath, typeof(MonoScript));
if(messageClass != null)
if (messageClass != null)
ctx.AddObjectToAsset("messageClass", messageClass);
}
}

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

@ -78,4 +78,4 @@ namespace Unity.Robotics.ROSTCPConnector.Editor
}
}
}
}
}

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

@ -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;
}

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

@ -90,4 +90,4 @@ namespace Unity.Robotics.ROSTCPConnector.MessageGeneration
/// <returns> The offset which a subsequent Deserialize function can begin reading from. </returns>
public abstract int Deserialize(byte[] data, int offset);
}
}
}

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

@ -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");
@ -49,4 +49,4 @@ namespace Unity.Robotics.ROSTCPConnector.MessageGeneration
Seperator
}
}
}

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

@ -1,4 +1,4 @@
/*
/*
© Siemens AG, 2019
Author: Sifan Ye (sifan.ye@siemens.com)
Licensed under the Apache License, Version 2.0 (the "License");
@ -415,4 +415,4 @@ namespace Unity.Robotics.ROSTCPConnector.MessageGeneration
{
public MessageTokenizerException(string msg) : base(msg) { }
}
}
}

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

@ -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;

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

@ -32,9 +32,9 @@ namespace RosMessageTypes.Actionlib
{
var listOfSerializations = new List<byte[]>();
listOfSerializations.AddRange(header.SerializationStatements());
listOfSerializations.Add(BitConverter.GetBytes(status_list.Length));
foreach(var entry in status_list)
foreach (var entry in status_list)
listOfSerializations.Add(entry.Serialize());
return listOfSerializations;
@ -43,11 +43,11 @@ namespace RosMessageTypes.Actionlib
public override int Deserialize(byte[] data, int offset)
{
offset = this.header.Deserialize(data, offset);
var status_listArrayLength = DeserializeLength(data, offset);
offset += 4;
this.status_list= new MGoalStatus[status_listArrayLength];
for(var i = 0; i < status_listArrayLength; i++)
this.status_list = new MGoalStatus[status_listArrayLength];
for (var i = 0; i < status_listArrayLength; i++)
{
this.status_list[i] = new MGoalStatus();
offset = this.status_list[i].Deserialize(data, offset);

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

@ -33,9 +33,9 @@ namespace RosMessageTypes.Diagnostic
{
var listOfSerializations = new List<byte[]>();
listOfSerializations.AddRange(header.SerializationStatements());
listOfSerializations.Add(BitConverter.GetBytes(status.Length));
foreach(var entry in status)
foreach (var entry in status)
listOfSerializations.Add(entry.Serialize());
return listOfSerializations;
@ -44,11 +44,11 @@ namespace RosMessageTypes.Diagnostic
public override int Deserialize(byte[] data, int offset)
{
offset = this.header.Deserialize(data, offset);
var statusArrayLength = DeserializeLength(data, offset);
offset += 4;
this.status= new MDiagnosticStatus[statusArrayLength];
for(var i = 0; i < statusArrayLength; i++)
this.status = new MDiagnosticStatus[statusArrayLength];
for (var i = 0; i < statusArrayLength; i++)
{
this.status[i] = new MDiagnosticStatus();
offset = this.status[i].Deserialize(data, offset);

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

@ -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;
@ -77,11 +77,11 @@ namespace RosMessageTypes.Diagnostic
offset += 4;
this.hardware_id = DeserializeString(data, offset, hardware_idStringBytesLength);
offset += hardware_idStringBytesLength;
var valuesArrayLength = DeserializeLength(data, offset);
offset += 4;
this.values= new MKeyValue[valuesArrayLength];
for(var i = 0; i < valuesArrayLength; i++)
this.values = new MKeyValue[valuesArrayLength];
for (var i = 0; i < valuesArrayLength; i++)
{
this.values[i] = new MKeyValue();
offset = this.values[i].Deserialize(data, offset);

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

@ -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);

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

@ -34,9 +34,9 @@ namespace RosMessageTypes.Geometry
{
var listOfSerializations = new List<byte[]>();
listOfSerializations.AddRange(accel.SerializationStatements());
Array.Resize(ref covariance, 36);
foreach(var entry in covariance)
foreach (var entry in covariance)
listOfSerializations.Add(BitConverter.GetBytes(entry));
return listOfSerializations;
@ -45,9 +45,9 @@ namespace RosMessageTypes.Geometry
public override int Deserialize(byte[] data, int offset)
{
offset = this.accel.Deserialize(data, offset);
this.covariance= new double[36];
for(var i = 0; i < 36; i++)
this.covariance = new double[36];
for (var i = 0; i < 36; i++)
{
this.covariance[i] = BitConverter.ToDouble(data, offset);
offset += 8;

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

@ -26,9 +26,9 @@ namespace RosMessageTypes.Geometry
public override List<byte[]> SerializationStatements()
{
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;
@ -36,11 +36,11 @@ namespace RosMessageTypes.Geometry
public override int Deserialize(byte[] data, int offset)
{
var pointsArrayLength = DeserializeLength(data, offset);
offset += 4;
this.points= new MPoint32[pointsArrayLength];
for(var i = 0; i < pointsArrayLength; i++)
this.points = new MPoint32[pointsArrayLength];
for (var i = 0; i < pointsArrayLength; i++)
{
this.points[i] = new MPoint32();
offset = this.points[i].Deserialize(data, offset);

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

@ -31,9 +31,9 @@ namespace RosMessageTypes.Geometry
{
var listOfSerializations = new List<byte[]>();
listOfSerializations.AddRange(header.SerializationStatements());
listOfSerializations.Add(BitConverter.GetBytes(poses.Length));
foreach(var entry in poses)
foreach (var entry in poses)
listOfSerializations.Add(entry.Serialize());
return listOfSerializations;
@ -42,11 +42,11 @@ namespace RosMessageTypes.Geometry
public override int Deserialize(byte[] data, int offset)
{
offset = this.header.Deserialize(data, offset);
var posesArrayLength = DeserializeLength(data, offset);
offset += 4;
this.poses= new MPose[posesArrayLength];
for(var i = 0; i < posesArrayLength; i++)
this.poses = new MPose[posesArrayLength];
for (var i = 0; i < posesArrayLength; i++)
{
this.poses[i] = new MPose();
offset = this.poses[i].Deserialize(data, offset);

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

@ -34,9 +34,9 @@ namespace RosMessageTypes.Geometry
{
var listOfSerializations = new List<byte[]>();
listOfSerializations.AddRange(pose.SerializationStatements());
Array.Resize(ref covariance, 36);
foreach(var entry in covariance)
foreach (var entry in covariance)
listOfSerializations.Add(BitConverter.GetBytes(entry));
return listOfSerializations;
@ -45,9 +45,9 @@ namespace RosMessageTypes.Geometry
public override int Deserialize(byte[] data, int offset)
{
offset = this.pose.Deserialize(data, offset);
this.covariance= new double[36];
for(var i = 0; i < 36; i++)
this.covariance = new double[36];
for (var i = 0; i < 36; i++)
{
this.covariance[i] = BitConverter.ToDouble(data, offset);
offset += 8;

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

@ -34,9 +34,9 @@ namespace RosMessageTypes.Geometry
{
var listOfSerializations = new List<byte[]>();
listOfSerializations.AddRange(twist.SerializationStatements());
Array.Resize(ref covariance, 36);
foreach(var entry in covariance)
foreach (var entry in covariance)
listOfSerializations.Add(BitConverter.GetBytes(entry));
return listOfSerializations;
@ -45,9 +45,9 @@ namespace RosMessageTypes.Geometry
public override int Deserialize(byte[] data, int offset)
{
offset = this.twist.Deserialize(data, offset);
this.covariance= new double[36];
for(var i = 0; i < 36; i++)
this.covariance = new double[36];
for (var i = 0; i < 36; i++)
{
this.covariance[i] = BitConverter.ToDouble(data, offset);
offset += 8;

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

@ -39,9 +39,9 @@ namespace RosMessageTypes.Nav
listOfSerializations.AddRange(header.SerializationStatements());
listOfSerializations.Add(BitConverter.GetBytes(this.cell_width));
listOfSerializations.Add(BitConverter.GetBytes(this.cell_height));
listOfSerializations.Add(BitConverter.GetBytes(cells.Length));
foreach(var entry in cells)
foreach (var entry in cells)
listOfSerializations.Add(entry.Serialize());
return listOfSerializations;
@ -54,11 +54,11 @@ namespace RosMessageTypes.Nav
offset += 4;
this.cell_height = BitConverter.ToSingle(data, offset);
offset += 4;
var cellsArrayLength = DeserializeLength(data, offset);
offset += 4;
this.cells= new Geometry.MPoint[cellsArrayLength];
for(var i = 0; i < cellsArrayLength; i++)
this.cells = new Geometry.MPoint[cellsArrayLength];
for (var i = 0; i < cellsArrayLength; i++)
{
this.cells[i] = new Geometry.MPoint();
offset = this.cells[i].Deserialize(data, offset);

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

@ -39,9 +39,9 @@ namespace RosMessageTypes.Nav
var listOfSerializations = new List<byte[]>();
listOfSerializations.AddRange(header.SerializationStatements());
listOfSerializations.AddRange(info.SerializationStatements());
listOfSerializations.Add(BitConverter.GetBytes(data.Length));
listOfSerializations.Add((byte[]) (Array)this.data);
listOfSerializations.Add((byte[])(Array)this.data);
return listOfSerializations;
}
@ -50,11 +50,11 @@ namespace RosMessageTypes.Nav
{
offset = this.header.Deserialize(data, offset);
offset = this.info.Deserialize(data, offset);
var dataArrayLength = DeserializeLength(data, offset);
offset += 4;
this.data= new sbyte[dataArrayLength];
for(var i = 0; i < dataArrayLength; i++)
this.data = new sbyte[dataArrayLength];
for (var i = 0; i < dataArrayLength; i++)
{
this.data[i] = (sbyte)data[offset];
offset += 1;

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

@ -31,9 +31,9 @@ namespace RosMessageTypes.Nav
{
var listOfSerializations = new List<byte[]>();
listOfSerializations.AddRange(header.SerializationStatements());
listOfSerializations.Add(BitConverter.GetBytes(poses.Length));
foreach(var entry in poses)
foreach (var entry in poses)
listOfSerializations.Add(entry.Serialize());
return listOfSerializations;
@ -42,11 +42,11 @@ namespace RosMessageTypes.Nav
public override int Deserialize(byte[] data, int offset)
{
offset = this.header.Deserialize(data, offset);
var posesArrayLength = DeserializeLength(data, offset);
offset += 4;
this.poses= new Geometry.MPoseStamped[posesArrayLength];
for(var i = 0; i < posesArrayLength; i++)
this.poses = new Geometry.MPoseStamped[posesArrayLength];
for (var i = 0; i < posesArrayLength; i++)
{
this.poses[i] = new Geometry.MPoseStamped();
offset = this.poses[i].Deserialize(data, offset);

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

@ -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;

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

@ -30,9 +30,9 @@ namespace RosMessageTypes.ObjectRecognition
{
var listOfSerializations = new List<byte[]>();
listOfSerializations.Add(BitConverter.GetBytes(this.use_roi));
listOfSerializations.Add(BitConverter.GetBytes(filter_limits.Length));
foreach(var entry in filter_limits)
foreach (var entry in filter_limits)
listOfSerializations.Add(BitConverter.GetBytes(entry));
return listOfSerializations;
@ -42,11 +42,11 @@ namespace RosMessageTypes.ObjectRecognition
{
this.use_roi = BitConverter.ToBoolean(data, offset);
offset += 1;
var filter_limitsArrayLength = DeserializeLength(data, offset);
offset += 4;
this.filter_limits= new float[filter_limitsArrayLength];
for(var i = 0; i < filter_limitsArrayLength; i++)
this.filter_limits = new float[filter_limitsArrayLength];
for (var i = 0; i < filter_limitsArrayLength; i++)
{
this.filter_limits[i] = BitConverter.ToSingle(data, offset);
offset += 4;

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

@ -66,14 +66,14 @@ namespace RosMessageTypes.ObjectRecognition
listOfSerializations.AddRange(header.SerializationStatements());
listOfSerializations.AddRange(type.SerializationStatements());
listOfSerializations.Add(BitConverter.GetBytes(this.confidence));
listOfSerializations.Add(BitConverter.GetBytes(point_clouds.Length));
foreach(var entry in point_clouds)
foreach (var entry in point_clouds)
listOfSerializations.Add(entry.Serialize());
listOfSerializations.AddRange(bounding_mesh.SerializationStatements());
listOfSerializations.Add(BitConverter.GetBytes(bounding_contours.Length));
foreach(var entry in bounding_contours)
foreach (var entry in bounding_contours)
listOfSerializations.Add(entry.Serialize());
listOfSerializations.AddRange(pose.SerializationStatements());
@ -86,21 +86,21 @@ namespace RosMessageTypes.ObjectRecognition
offset = this.type.Deserialize(data, offset);
this.confidence = BitConverter.ToSingle(data, offset);
offset += 4;
var point_cloudsArrayLength = DeserializeLength(data, offset);
offset += 4;
this.point_clouds= new Sensor.MPointCloud2[point_cloudsArrayLength];
for(var i = 0; i < point_cloudsArrayLength; i++)
this.point_clouds = new Sensor.MPointCloud2[point_cloudsArrayLength];
for (var i = 0; i < point_cloudsArrayLength; i++)
{
this.point_clouds[i] = new Sensor.MPointCloud2();
offset = this.point_clouds[i].Deserialize(data, offset);
}
offset = this.bounding_mesh.Deserialize(data, offset);
var bounding_contoursArrayLength = DeserializeLength(data, offset);
offset += 4;
this.bounding_contours= new Geometry.MPoint[bounding_contoursArrayLength];
for(var i = 0; i < bounding_contoursArrayLength; i++)
this.bounding_contours = new Geometry.MPoint[bounding_contoursArrayLength];
for (var i = 0; i < bounding_contoursArrayLength; i++)
{
this.bounding_contours[i] = new Geometry.MPoint();
offset = this.bounding_contours[i].Deserialize(data, offset);

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

@ -37,13 +37,13 @@ namespace RosMessageTypes.ObjectRecognition
{
var listOfSerializations = new List<byte[]>();
listOfSerializations.AddRange(header.SerializationStatements());
listOfSerializations.Add(BitConverter.GetBytes(objects.Length));
foreach(var entry in objects)
foreach (var entry in objects)
listOfSerializations.Add(entry.Serialize());
listOfSerializations.Add(BitConverter.GetBytes(cooccurrence.Length));
foreach(var entry in cooccurrence)
foreach (var entry in cooccurrence)
listOfSerializations.Add(BitConverter.GetBytes(entry));
return listOfSerializations;
@ -52,20 +52,20 @@ namespace RosMessageTypes.ObjectRecognition
public override int Deserialize(byte[] data, int offset)
{
offset = this.header.Deserialize(data, offset);
var objectsArrayLength = DeserializeLength(data, offset);
offset += 4;
this.objects= new MRecognizedObject[objectsArrayLength];
for(var i = 0; i < objectsArrayLength; i++)
this.objects = new MRecognizedObject[objectsArrayLength];
for (var i = 0; i < objectsArrayLength; i++)
{
this.objects[i] = new MRecognizedObject();
offset = this.objects[i].Deserialize(data, offset);
}
var cooccurrenceArrayLength = DeserializeLength(data, offset);
offset += 4;
this.cooccurrence= new float[cooccurrenceArrayLength];
for(var i = 0; i < cooccurrenceArrayLength; i++)
this.cooccurrence = new float[cooccurrenceArrayLength];
for (var i = 0; i < cooccurrenceArrayLength; i++)
{
this.cooccurrence[i] = BitConverter.ToSingle(data, offset);
offset += 4;

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

@ -42,9 +42,9 @@ namespace RosMessageTypes.ObjectRecognition
var listOfSerializations = new List<byte[]>();
listOfSerializations.AddRange(header.SerializationStatements());
listOfSerializations.AddRange(pose.SerializationStatements());
listOfSerializations.Add(BitConverter.GetBytes(convex_hull.Length));
foreach(var entry in convex_hull)
foreach (var entry in convex_hull)
listOfSerializations.Add(entry.Serialize());
return listOfSerializations;
@ -54,11 +54,11 @@ namespace RosMessageTypes.ObjectRecognition
{
offset = this.header.Deserialize(data, offset);
offset = this.pose.Deserialize(data, offset);
var convex_hullArrayLength = DeserializeLength(data, offset);
offset += 4;
this.convex_hull= new Geometry.MPoint[convex_hullArrayLength];
for(var i = 0; i < convex_hullArrayLength; i++)
this.convex_hull = new Geometry.MPoint[convex_hullArrayLength];
for (var i = 0; i < convex_hullArrayLength; i++)
{
this.convex_hull[i] = new Geometry.MPoint();
offset = this.convex_hull[i].Deserialize(data, offset);

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

@ -31,9 +31,9 @@ namespace RosMessageTypes.ObjectRecognition
{
var listOfSerializations = new List<byte[]>();
listOfSerializations.AddRange(header.SerializationStatements());
listOfSerializations.Add(BitConverter.GetBytes(tables.Length));
foreach(var entry in tables)
foreach (var entry in tables)
listOfSerializations.Add(entry.Serialize());
return listOfSerializations;
@ -42,11 +42,11 @@ namespace RosMessageTypes.ObjectRecognition
public override int Deserialize(byte[] data, int offset)
{
offset = this.header.Deserialize(data, offset);
var tablesArrayLength = DeserializeLength(data, offset);
offset += 4;
this.tables= new MTable[tablesArrayLength];
for(var i = 0; i < tablesArrayLength; i++)
this.tables = new MTable[tablesArrayLength];
for (var i = 0; i < tablesArrayLength; i++)
{
this.tables[i] = new MTable();
offset = this.tables[i].Deserialize(data, offset);

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

@ -47,9 +47,9 @@ namespace RosMessageTypes.Octomap
listOfSerializations.Add(BitConverter.GetBytes(this.binary));
listOfSerializations.Add(SerializeString(this.id));
listOfSerializations.Add(BitConverter.GetBytes(this.resolution));
listOfSerializations.Add(BitConverter.GetBytes(data.Length));
listOfSerializations.Add((byte[]) (Array)this.data);
listOfSerializations.Add((byte[])(Array)this.data);
return listOfSerializations;
}
@ -65,11 +65,11 @@ namespace RosMessageTypes.Octomap
offset += idStringBytesLength;
this.resolution = BitConverter.ToDouble(data, offset);
offset += 8;
var dataArrayLength = DeserializeLength(data, offset);
offset += 4;
this.data= new sbyte[dataArrayLength];
for(var i = 0; i < dataArrayLength; i++)
this.data = new sbyte[dataArrayLength];
for (var i = 0; i < dataArrayLength; i++)
{
this.data[i] = (sbyte)data[offset];
offset += 1;

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

@ -37,7 +37,7 @@ namespace RosMessageTypes.RosTcpEndpoint
listOfSerializations.Add(BitConverter.GetBytes(this.srv_id));
listOfSerializations.Add(BitConverter.GetBytes(this.is_request));
listOfSerializations.Add(SerializeString(this.topic));
listOfSerializations.Add(BitConverter.GetBytes(payload.Length));
listOfSerializations.Add(this.payload);
@ -54,11 +54,11 @@ namespace RosMessageTypes.RosTcpEndpoint
offset += 4;
this.topic = DeserializeString(data, offset, topicStringBytesLength);
offset += topicStringBytesLength;
var payloadArrayLength = DeserializeLength(data, offset);
offset += 4;
this.payload= new byte[payloadArrayLength];
for(var i = 0; i < payloadArrayLength; i++)
this.payload = new byte[payloadArrayLength];
for (var i = 0; i < payloadArrayLength; i++)
{
this.payload[i] = data[offset];
offset += 1;

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

@ -25,9 +25,9 @@ namespace RosMessageTypes.RosTcpEndpoint
public override List<byte[]> SerializationStatements()
{
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;
@ -35,11 +35,11 @@ namespace RosMessageTypes.RosTcpEndpoint
public override int Deserialize(byte[] data, int offset)
{
var topicsArrayLength = DeserializeLength(data, offset);
offset += 4;
this.topics= new string[topicsArrayLength];
for(var i = 0; i < topicsArrayLength; i++)
this.topics = new string[topicsArrayLength];
for (var i = 0; i < topicsArrayLength; i++)
{
var topicsStringBytesLength = DeserializeLength(data, offset);
offset += 4;

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

@ -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,28 +159,28 @@ 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;
}
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;

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

@ -170,21 +170,21 @@ namespace RosMessageTypes.Sensor
listOfSerializations.Add(BitConverter.GetBytes(this.height));
listOfSerializations.Add(BitConverter.GetBytes(this.width));
listOfSerializations.Add(SerializeString(this.distortion_model));
listOfSerializations.Add(BitConverter.GetBytes(D.Length));
foreach(var entry in D)
foreach (var entry in D)
listOfSerializations.Add(BitConverter.GetBytes(entry));
Array.Resize(ref K, 9);
foreach(var entry in K)
foreach (var entry in K)
listOfSerializations.Add(BitConverter.GetBytes(entry));
Array.Resize(ref R, 9);
foreach(var entry in R)
foreach (var entry in R)
listOfSerializations.Add(BitConverter.GetBytes(entry));
Array.Resize(ref P, 12);
foreach(var entry in P)
foreach (var entry in P)
listOfSerializations.Add(BitConverter.GetBytes(entry));
listOfSerializations.Add(BitConverter.GetBytes(this.binning_x));
listOfSerializations.Add(BitConverter.GetBytes(this.binning_y));
@ -204,32 +204,32 @@ namespace RosMessageTypes.Sensor
offset += 4;
this.distortion_model = DeserializeString(data, offset, distortion_modelStringBytesLength);
offset += distortion_modelStringBytesLength;
var DArrayLength = DeserializeLength(data, offset);
offset += 4;
this.D= new double[DArrayLength];
for(var i = 0; i < DArrayLength; i++)
this.D = new double[DArrayLength];
for (var i = 0; i < DArrayLength; i++)
{
this.D[i] = BitConverter.ToDouble(data, offset);
offset += 8;
}
this.K= new double[9];
for(var i = 0; i < 9; i++)
this.K = new double[9];
for (var i = 0; i < 9; i++)
{
this.K[i] = BitConverter.ToDouble(data, offset);
offset += 8;
}
this.R= new double[9];
for(var i = 0; i < 9; i++)
this.R = new double[9];
for (var i = 0; i < 9; i++)
{
this.R[i] = BitConverter.ToDouble(data, offset);
offset += 8;
}
this.P= new double[12];
for(var i = 0; i < 12; i++)
this.P = new double[12];
for (var i = 0; i < 12; i++)
{
this.P[i] = BitConverter.ToDouble(data, offset);
offset += 8;

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

@ -48,9 +48,9 @@ namespace RosMessageTypes.Sensor
{
var listOfSerializations = new List<byte[]>();
listOfSerializations.Add(SerializeString(this.name));
listOfSerializations.Add(BitConverter.GetBytes(values.Length));
foreach(var entry in values)
foreach (var entry in values)
listOfSerializations.Add(BitConverter.GetBytes(entry));
return listOfSerializations;
@ -62,11 +62,11 @@ namespace RosMessageTypes.Sensor
offset += 4;
this.name = DeserializeString(data, offset, nameStringBytesLength);
offset += nameStringBytesLength;
var valuesArrayLength = DeserializeLength(data, offset);
offset += 4;
this.values= new float[valuesArrayLength];
for(var i = 0; i < valuesArrayLength; i++)
this.values = new float[valuesArrayLength];
for (var i = 0; i < valuesArrayLength; i++)
{
this.values[i] = BitConverter.ToSingle(data, offset);
offset += 4;

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

@ -45,7 +45,7 @@ namespace RosMessageTypes.Sensor
var listOfSerializations = new List<byte[]>();
listOfSerializations.AddRange(header.SerializationStatements());
listOfSerializations.Add(SerializeString(this.format));
listOfSerializations.Add(BitConverter.GetBytes(data.Length));
listOfSerializations.Add(this.data);
@ -59,11 +59,11 @@ namespace RosMessageTypes.Sensor
offset += 4;
this.format = DeserializeString(data, offset, formatStringBytesLength);
offset += formatStringBytesLength;
var dataArrayLength = DeserializeLength(data, offset);
offset += 4;
this.data= new byte[dataArrayLength];
for(var i = 0; i < dataArrayLength; i++)
this.data = new byte[dataArrayLength];
for (var i = 0; i < dataArrayLength; i++)
{
this.data[i] = data[offset];
offset += 1;

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

@ -70,9 +70,9 @@ 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));
listOfSerializations.Add(this.data);
@ -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;

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

@ -62,19 +62,19 @@ namespace RosMessageTypes.Sensor
var listOfSerializations = new List<byte[]>();
listOfSerializations.AddRange(header.SerializationStatements());
listOfSerializations.AddRange(orientation.SerializationStatements());
Array.Resize(ref orientation_covariance, 9);
foreach(var entry in orientation_covariance)
foreach (var entry in orientation_covariance)
listOfSerializations.Add(BitConverter.GetBytes(entry));
listOfSerializations.AddRange(angular_velocity.SerializationStatements());
Array.Resize(ref angular_velocity_covariance, 9);
foreach(var entry in angular_velocity_covariance)
foreach (var entry in angular_velocity_covariance)
listOfSerializations.Add(BitConverter.GetBytes(entry));
listOfSerializations.AddRange(linear_acceleration.SerializationStatements());
Array.Resize(ref linear_acceleration_covariance, 9);
foreach(var entry in linear_acceleration_covariance)
foreach (var entry in linear_acceleration_covariance)
listOfSerializations.Add(BitConverter.GetBytes(entry));
return listOfSerializations;
@ -84,25 +84,25 @@ 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;

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

@ -57,21 +57,21 @@ namespace RosMessageTypes.Sensor
{
var listOfSerializations = new List<byte[]>();
listOfSerializations.AddRange(header.SerializationStatements());
listOfSerializations.Add(BitConverter.GetBytes(name.Length));
foreach(var entry in name)
foreach (var entry in name)
listOfSerializations.Add(SerializeString(entry));
listOfSerializations.Add(BitConverter.GetBytes(position.Length));
foreach(var entry in position)
foreach (var entry in position)
listOfSerializations.Add(BitConverter.GetBytes(entry));
listOfSerializations.Add(BitConverter.GetBytes(velocity.Length));
foreach(var entry in velocity)
foreach (var entry in velocity)
listOfSerializations.Add(BitConverter.GetBytes(entry));
listOfSerializations.Add(BitConverter.GetBytes(effort.Length));
foreach(var entry in effort)
foreach (var entry in effort)
listOfSerializations.Add(BitConverter.GetBytes(entry));
return listOfSerializations;
@ -80,40 +80,40 @@ namespace RosMessageTypes.Sensor
public override int Deserialize(byte[] data, int offset)
{
offset = this.header.Deserialize(data, offset);
var nameArrayLength = DeserializeLength(data, offset);
offset += 4;
this.name= new string[nameArrayLength];
for(var i = 0; i < nameArrayLength; i++)
this.name = new string[nameArrayLength];
for (var i = 0; i < nameArrayLength; i++)
{
var nameStringBytesLength = DeserializeLength(data, offset);
offset += 4;
this.name[i] = DeserializeString(data, offset, nameStringBytesLength);
offset += nameStringBytesLength;
}
var positionArrayLength = DeserializeLength(data, offset);
offset += 4;
this.position= new double[positionArrayLength];
for(var i = 0; i < positionArrayLength; i++)
this.position = new double[positionArrayLength];
for (var i = 0; i < positionArrayLength; i++)
{
this.position[i] = BitConverter.ToDouble(data, offset);
offset += 8;
}
var velocityArrayLength = DeserializeLength(data, offset);
offset += 4;
this.velocity= new double[velocityArrayLength];
for(var i = 0; i < velocityArrayLength; i++)
this.velocity = new double[velocityArrayLength];
for (var i = 0; i < velocityArrayLength; i++)
{
this.velocity[i] = BitConverter.ToDouble(data, offset);
offset += 8;
}
var effortArrayLength = DeserializeLength(data, offset);
offset += 4;
this.effort= new double[effortArrayLength];
for(var i = 0; i < effortArrayLength; i++)
this.effort = new double[effortArrayLength];
for (var i = 0; i < effortArrayLength; i++)
{
this.effort[i] = BitConverter.ToDouble(data, offset);
offset += 8;

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

@ -37,13 +37,13 @@ namespace RosMessageTypes.Sensor
{
var listOfSerializations = new List<byte[]>();
listOfSerializations.AddRange(header.SerializationStatements());
listOfSerializations.Add(BitConverter.GetBytes(axes.Length));
foreach(var entry in axes)
foreach (var entry in axes)
listOfSerializations.Add(BitConverter.GetBytes(entry));
listOfSerializations.Add(BitConverter.GetBytes(buttons.Length));
foreach(var entry in buttons)
foreach (var entry in buttons)
listOfSerializations.Add(BitConverter.GetBytes(entry));
return listOfSerializations;
@ -52,20 +52,20 @@ namespace RosMessageTypes.Sensor
public override int Deserialize(byte[] data, int offset)
{
offset = this.header.Deserialize(data, offset);
var axesArrayLength = DeserializeLength(data, offset);
offset += 4;
this.axes= new float[axesArrayLength];
for(var i = 0; i < axesArrayLength; i++)
this.axes = new float[axesArrayLength];
for (var i = 0; i < axesArrayLength; i++)
{
this.axes[i] = BitConverter.ToSingle(data, offset);
offset += 4;
}
var buttonsArrayLength = DeserializeLength(data, offset);
offset += 4;
this.buttons= new int[buttonsArrayLength];
for(var i = 0; i < buttonsArrayLength; i++)
this.buttons = new int[buttonsArrayLength];
for (var i = 0; i < buttonsArrayLength; i++)
{
this.buttons[i] = BitConverter.ToInt32(data, offset);
offset += 4;

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

@ -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;

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

@ -26,9 +26,9 @@ namespace RosMessageTypes.Sensor
public override List<byte[]> SerializationStatements()
{
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;
@ -36,11 +36,11 @@ namespace RosMessageTypes.Sensor
public override int Deserialize(byte[] data, int offset)
{
var arrayArrayLength = DeserializeLength(data, offset);
offset += 4;
this.array= new MJoyFeedback[arrayArrayLength];
for(var i = 0; i < arrayArrayLength; i++)
this.array = new MJoyFeedback[arrayArrayLength];
for (var i = 0; i < arrayArrayLength; i++)
{
this.array[i] = new MJoyFeedback();
offset = this.array[i].Deserialize(data, offset);

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

@ -29,9 +29,9 @@ namespace RosMessageTypes.Sensor
public override List<byte[]> SerializationStatements()
{
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;
@ -39,11 +39,11 @@ namespace RosMessageTypes.Sensor
public override int Deserialize(byte[] data, int offset)
{
var echoesArrayLength = DeserializeLength(data, offset);
offset += 4;
this.echoes= new float[echoesArrayLength];
for(var i = 0; i < echoesArrayLength; i++)
this.echoes = new float[echoesArrayLength];
for (var i = 0; i < echoesArrayLength; i++)
{
this.echoes[i] = BitConverter.ToSingle(data, offset);
offset += 4;

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

@ -85,13 +85,13 @@ namespace RosMessageTypes.Sensor
listOfSerializations.Add(BitConverter.GetBytes(this.scan_time));
listOfSerializations.Add(BitConverter.GetBytes(this.range_min));
listOfSerializations.Add(BitConverter.GetBytes(this.range_max));
listOfSerializations.Add(BitConverter.GetBytes(ranges.Length));
foreach(var entry in ranges)
foreach (var entry in ranges)
listOfSerializations.Add(BitConverter.GetBytes(entry));
listOfSerializations.Add(BitConverter.GetBytes(intensities.Length));
foreach(var entry in intensities)
foreach (var entry in intensities)
listOfSerializations.Add(BitConverter.GetBytes(entry));
return listOfSerializations;
@ -114,20 +114,20 @@ namespace RosMessageTypes.Sensor
offset += 4;
this.range_max = BitConverter.ToSingle(data, offset);
offset += 4;
var rangesArrayLength = DeserializeLength(data, offset);
offset += 4;
this.ranges= new float[rangesArrayLength];
for(var i = 0; i < rangesArrayLength; i++)
this.ranges = new float[rangesArrayLength];
for (var i = 0; i < rangesArrayLength; i++)
{
this.ranges[i] = BitConverter.ToSingle(data, offset);
offset += 4;
}
var intensitiesArrayLength = DeserializeLength(data, offset);
offset += 4;
this.intensities= new float[intensitiesArrayLength];
for(var i = 0; i < intensitiesArrayLength; i++)
this.intensities = new float[intensitiesArrayLength];
for (var i = 0; i < intensitiesArrayLength; i++)
{
this.intensities[i] = BitConverter.ToSingle(data, offset);
offset += 4;

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

@ -51,9 +51,9 @@ namespace RosMessageTypes.Sensor
var listOfSerializations = new List<byte[]>();
listOfSerializations.AddRange(header.SerializationStatements());
listOfSerializations.AddRange(magnetic_field.SerializationStatements());
Array.Resize(ref magnetic_field_covariance, 9);
foreach(var entry in magnetic_field_covariance)
foreach (var entry in magnetic_field_covariance)
listOfSerializations.Add(BitConverter.GetBytes(entry));
return listOfSerializations;
@ -63,9 +63,9 @@ 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;

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

@ -58,21 +58,21 @@ namespace RosMessageTypes.Sensor
{
var listOfSerializations = new List<byte[]>();
listOfSerializations.AddRange(header.SerializationStatements());
listOfSerializations.Add(BitConverter.GetBytes(joint_names.Length));
foreach(var entry in joint_names)
foreach (var entry in joint_names)
listOfSerializations.Add(SerializeString(entry));
listOfSerializations.Add(BitConverter.GetBytes(transforms.Length));
foreach(var entry in transforms)
foreach (var entry in transforms)
listOfSerializations.Add(entry.Serialize());
listOfSerializations.Add(BitConverter.GetBytes(twist.Length));
foreach(var entry in twist)
foreach (var entry in twist)
listOfSerializations.Add(entry.Serialize());
listOfSerializations.Add(BitConverter.GetBytes(wrench.Length));
foreach(var entry in wrench)
foreach (var entry in wrench)
listOfSerializations.Add(entry.Serialize());
return listOfSerializations;
@ -81,40 +81,40 @@ namespace RosMessageTypes.Sensor
public override int Deserialize(byte[] data, int offset)
{
offset = this.header.Deserialize(data, offset);
var joint_namesArrayLength = DeserializeLength(data, offset);
offset += 4;
this.joint_names= new string[joint_namesArrayLength];
for(var i = 0; i < joint_namesArrayLength; i++)
this.joint_names = new string[joint_namesArrayLength];
for (var i = 0; i < joint_namesArrayLength; i++)
{
var joint_namesStringBytesLength = DeserializeLength(data, offset);
offset += 4;
this.joint_names[i] = DeserializeString(data, offset, joint_namesStringBytesLength);
offset += joint_namesStringBytesLength;
}
var transformsArrayLength = DeserializeLength(data, offset);
offset += 4;
this.transforms= new Geometry.MTransform[transformsArrayLength];
for(var i = 0; i < transformsArrayLength; i++)
this.transforms = new Geometry.MTransform[transformsArrayLength];
for (var i = 0; i < transformsArrayLength; i++)
{
this.transforms[i] = new Geometry.MTransform();
offset = this.transforms[i].Deserialize(data, offset);
}
var twistArrayLength = DeserializeLength(data, offset);
offset += 4;
this.twist= new Geometry.MTwist[twistArrayLength];
for(var i = 0; i < twistArrayLength; i++)
this.twist = new Geometry.MTwist[twistArrayLength];
for (var i = 0; i < twistArrayLength; i++)
{
this.twist[i] = new Geometry.MTwist();
offset = this.twist[i].Deserialize(data, offset);
}
var wrenchArrayLength = DeserializeLength(data, offset);
offset += 4;
this.wrench= new Geometry.MWrench[wrenchArrayLength];
for(var i = 0; i < wrenchArrayLength; i++)
this.wrench = new Geometry.MWrench[wrenchArrayLength];
for (var i = 0; i < wrenchArrayLength; i++)
{
this.wrench[i] = new Geometry.MWrench();
offset = this.wrench[i].Deserialize(data, offset);

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

@ -87,13 +87,13 @@ namespace RosMessageTypes.Sensor
listOfSerializations.Add(BitConverter.GetBytes(this.scan_time));
listOfSerializations.Add(BitConverter.GetBytes(this.range_min));
listOfSerializations.Add(BitConverter.GetBytes(this.range_max));
listOfSerializations.Add(BitConverter.GetBytes(ranges.Length));
foreach(var entry in ranges)
foreach (var entry in ranges)
listOfSerializations.Add(entry.Serialize());
listOfSerializations.Add(BitConverter.GetBytes(intensities.Length));
foreach(var entry in intensities)
foreach (var entry in intensities)
listOfSerializations.Add(entry.Serialize());
return listOfSerializations;
@ -116,20 +116,20 @@ namespace RosMessageTypes.Sensor
offset += 4;
this.range_max = BitConverter.ToSingle(data, offset);
offset += 4;
var rangesArrayLength = DeserializeLength(data, offset);
offset += 4;
this.ranges= new MLaserEcho[rangesArrayLength];
for(var i = 0; i < rangesArrayLength; i++)
this.ranges = new MLaserEcho[rangesArrayLength];
for (var i = 0; i < rangesArrayLength; i++)
{
this.ranges[i] = new MLaserEcho();
offset = this.ranges[i].Deserialize(data, offset);
}
var intensitiesArrayLength = DeserializeLength(data, offset);
offset += 4;
this.intensities= new MLaserEcho[intensitiesArrayLength];
for(var i = 0; i < intensitiesArrayLength; i++)
this.intensities = new MLaserEcho[intensitiesArrayLength];
for (var i = 0; i < intensitiesArrayLength; i++)
{
this.intensities[i] = new MLaserEcho();
offset = this.intensities[i].Deserialize(data, offset);

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

@ -78,11 +78,11 @@ namespace RosMessageTypes.Sensor
listOfSerializations.Add(BitConverter.GetBytes(this.latitude));
listOfSerializations.Add(BitConverter.GetBytes(this.longitude));
listOfSerializations.Add(BitConverter.GetBytes(this.altitude));
Array.Resize(ref position_covariance, 9);
foreach(var entry in position_covariance)
foreach (var entry in position_covariance)
listOfSerializations.Add(BitConverter.GetBytes(entry));
listOfSerializations.Add(new[]{this.position_covariance_type});
listOfSerializations.Add(new[] { this.position_covariance_type });
return listOfSerializations;
}
@ -97,14 +97,14 @@ namespace RosMessageTypes.Sensor
offset += 8;
this.altitude = BitConverter.ToDouble(data, offset);
offset += 8;
this.position_covariance= new double[9];
for(var i = 0; i < 9; i++)
this.position_covariance = new double[9];
for (var i = 0; i < 9; i++)
{
this.position_covariance[i] = BitConverter.ToDouble(data, offset);
offset += 8;
}
this.position_covariance_type = data[offset];;
this.position_covariance_type = data[offset]; ;
offset += 1;
return offset;

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

@ -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;

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

@ -41,13 +41,13 @@ namespace RosMessageTypes.Sensor
{
var listOfSerializations = new List<byte[]>();
listOfSerializations.AddRange(header.SerializationStatements());
listOfSerializations.Add(BitConverter.GetBytes(points.Length));
foreach(var entry in points)
foreach (var entry in points)
listOfSerializations.Add(entry.Serialize());
listOfSerializations.Add(BitConverter.GetBytes(channels.Length));
foreach(var entry in channels)
foreach (var entry in channels)
listOfSerializations.Add(entry.Serialize());
return listOfSerializations;
@ -56,20 +56,20 @@ namespace RosMessageTypes.Sensor
public override int Deserialize(byte[] data, int offset)
{
offset = this.header.Deserialize(data, offset);
var pointsArrayLength = DeserializeLength(data, offset);
offset += 4;
this.points= new Geometry.MPoint32[pointsArrayLength];
for(var i = 0; i < pointsArrayLength; i++)
this.points = new Geometry.MPoint32[pointsArrayLength];
for (var i = 0; i < pointsArrayLength; i++)
{
this.points[i] = new Geometry.MPoint32();
offset = this.points[i].Deserialize(data, offset);
}
var channelsArrayLength = DeserializeLength(data, offset);
offset += 4;
this.channels= new MChannelFloat32[channelsArrayLength];
for(var i = 0; i < channelsArrayLength; i++)
this.channels = new MChannelFloat32[channelsArrayLength];
for (var i = 0; i < channelsArrayLength; i++)
{
this.channels[i] = new MChannelFloat32();
offset = this.channels[i].Deserialize(data, offset);

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

@ -70,14 +70,14 @@ namespace RosMessageTypes.Sensor
listOfSerializations.AddRange(header.SerializationStatements());
listOfSerializations.Add(BitConverter.GetBytes(this.height));
listOfSerializations.Add(BitConverter.GetBytes(this.width));
listOfSerializations.Add(BitConverter.GetBytes(fields.Length));
foreach(var entry in fields)
foreach (var entry in fields)
listOfSerializations.Add(entry.Serialize());
listOfSerializations.Add(BitConverter.GetBytes(this.is_bigendian));
listOfSerializations.Add(BitConverter.GetBytes(this.point_step));
listOfSerializations.Add(BitConverter.GetBytes(this.row_step));
listOfSerializations.Add(BitConverter.GetBytes(data.Length));
listOfSerializations.Add(this.data);
listOfSerializations.Add(BitConverter.GetBytes(this.is_dense));
@ -92,11 +92,11 @@ namespace RosMessageTypes.Sensor
offset += 4;
this.width = BitConverter.ToUInt32(data, offset);
offset += 4;
var fieldsArrayLength = DeserializeLength(data, offset);
offset += 4;
this.fields= new MPointField[fieldsArrayLength];
for(var i = 0; i < fieldsArrayLength; i++)
this.fields = new MPointField[fieldsArrayLength];
for (var i = 0; i < fieldsArrayLength; i++)
{
this.fields[i] = new MPointField();
offset = this.fields[i].Deserialize(data, offset);
@ -107,11 +107,11 @@ namespace RosMessageTypes.Sensor
offset += 4;
this.row_step = BitConverter.ToUInt32(data, offset);
offset += 4;
var dataArrayLength = DeserializeLength(data, offset);
offset += 4;
this.data= new byte[dataArrayLength];
for(var i = 0; i < dataArrayLength; i++)
this.data = new byte[dataArrayLength];
for (var i = 0; i < dataArrayLength; i++)
{
this.data[i] = data[offset];
offset += 1;

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

@ -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;

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

@ -31,13 +31,13 @@ namespace RosMessageTypes.Shape
public override List<byte[]> SerializationStatements()
{
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;
@ -45,20 +45,20 @@ namespace RosMessageTypes.Shape
public override int Deserialize(byte[] data, int offset)
{
var trianglesArrayLength = DeserializeLength(data, offset);
offset += 4;
this.triangles= new MMeshTriangle[trianglesArrayLength];
for(var i = 0; i < trianglesArrayLength; i++)
this.triangles = new MMeshTriangle[trianglesArrayLength];
for (var i = 0; i < trianglesArrayLength; i++)
{
this.triangles[i] = new MMeshTriangle();
offset = this.triangles[i].Deserialize(data, offset);
}
var verticesArrayLength = DeserializeLength(data, offset);
offset += 4;
this.vertices= new Geometry.MPoint[verticesArrayLength];
for(var i = 0; i < verticesArrayLength; i++)
this.vertices = new Geometry.MPoint[verticesArrayLength];
for (var i = 0; i < verticesArrayLength; i++)
{
this.vertices[i] = new Geometry.MPoint();
offset = this.vertices[i].Deserialize(data, offset);

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

@ -26,9 +26,9 @@ namespace RosMessageTypes.Shape
public override List<byte[]> SerializationStatements()
{
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;
@ -36,9 +36,9 @@ 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;

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

@ -30,9 +30,9 @@ namespace RosMessageTypes.Shape
public override List<byte[]> SerializationStatements()
{
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;
@ -40,9 +40,9 @@ 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;

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

@ -33,9 +33,9 @@ namespace RosMessageTypes.Std
{
var listOfSerializations = new List<byte[]>();
listOfSerializations.AddRange(layout.SerializationStatements());
listOfSerializations.Add(BitConverter.GetBytes(data.Length));
listOfSerializations.Add((byte[]) (Array)this.data);
listOfSerializations.Add((byte[])(Array)this.data);
return listOfSerializations;
}
@ -43,11 +43,11 @@ namespace RosMessageTypes.Std
public override int Deserialize(byte[] data, int offset)
{
offset = this.layout.Deserialize(data, offset);
var dataArrayLength = DeserializeLength(data, offset);
offset += 4;
this.data= new sbyte[dataArrayLength];
for(var i = 0; i < dataArrayLength; i++)
this.data = new sbyte[dataArrayLength];
for (var i = 0; i < dataArrayLength; i++)
{
this.data[i] = (sbyte)data[offset];
offset += 1;

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

@ -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;

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

@ -45,4 +45,4 @@ namespace RosMessageTypes.Std
return offset;
}
}
}
}

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

@ -33,9 +33,9 @@ namespace RosMessageTypes.Std
{
var listOfSerializations = new List<byte[]>();
listOfSerializations.AddRange(layout.SerializationStatements());
listOfSerializations.Add(BitConverter.GetBytes(data.Length));
foreach(var entry in data)
foreach (var entry in data)
listOfSerializations.Add(BitConverter.GetBytes(entry));
return listOfSerializations;
@ -44,11 +44,11 @@ namespace RosMessageTypes.Std
public override int Deserialize(byte[] data, int offset)
{
offset = this.layout.Deserialize(data, offset);
var dataArrayLength = DeserializeLength(data, offset);
offset += 4;
this.data= new float[dataArrayLength];
for(var i = 0; i < dataArrayLength; i++)
this.data = new float[dataArrayLength];
for (var i = 0; i < dataArrayLength; i++)
{
this.data[i] = BitConverter.ToSingle(data, offset);
offset += 4;

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

@ -33,9 +33,9 @@ namespace RosMessageTypes.Std
{
var listOfSerializations = new List<byte[]>();
listOfSerializations.AddRange(layout.SerializationStatements());
listOfSerializations.Add(BitConverter.GetBytes(data.Length));
foreach(var entry in data)
foreach (var entry in data)
listOfSerializations.Add(BitConverter.GetBytes(entry));
return listOfSerializations;
@ -44,11 +44,11 @@ namespace RosMessageTypes.Std
public override int Deserialize(byte[] data, int offset)
{
offset = this.layout.Deserialize(data, offset);
var dataArrayLength = DeserializeLength(data, offset);
offset += 4;
this.data= new double[dataArrayLength];
for(var i = 0; i < dataArrayLength; i++)
this.data = new double[dataArrayLength];
for (var i = 0; i < dataArrayLength; i++)
{
this.data[i] = BitConverter.ToDouble(data, offset);
offset += 8;

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

@ -33,9 +33,9 @@ namespace RosMessageTypes.Std
{
var listOfSerializations = new List<byte[]>();
listOfSerializations.AddRange(layout.SerializationStatements());
listOfSerializations.Add(BitConverter.GetBytes(data.Length));
foreach(var entry in data)
foreach (var entry in data)
listOfSerializations.Add(BitConverter.GetBytes(entry));
return listOfSerializations;
@ -44,11 +44,11 @@ namespace RosMessageTypes.Std
public override int Deserialize(byte[] data, int offset)
{
offset = this.layout.Deserialize(data, offset);
var dataArrayLength = DeserializeLength(data, offset);
offset += 4;
this.data= new short[dataArrayLength];
for(var i = 0; i < dataArrayLength; i++)
this.data = new short[dataArrayLength];
for (var i = 0; i < dataArrayLength; i++)
{
this.data[i] = BitConverter.ToInt16(data, offset);
offset += 2;

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

@ -33,9 +33,9 @@ namespace RosMessageTypes.Std
{
var listOfSerializations = new List<byte[]>();
listOfSerializations.AddRange(layout.SerializationStatements());
listOfSerializations.Add(BitConverter.GetBytes(data.Length));
foreach(var entry in data)
foreach (var entry in data)
listOfSerializations.Add(BitConverter.GetBytes(entry));
return listOfSerializations;
@ -44,11 +44,11 @@ namespace RosMessageTypes.Std
public override int Deserialize(byte[] data, int offset)
{
offset = this.layout.Deserialize(data, offset);
var dataArrayLength = DeserializeLength(data, offset);
offset += 4;
this.data= new int[dataArrayLength];
for(var i = 0; i < dataArrayLength; i++)
this.data = new int[dataArrayLength];
for (var i = 0; i < dataArrayLength; i++)
{
this.data[i] = BitConverter.ToInt32(data, offset);
offset += 4;

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

@ -33,9 +33,9 @@ namespace RosMessageTypes.Std
{
var listOfSerializations = new List<byte[]>();
listOfSerializations.AddRange(layout.SerializationStatements());
listOfSerializations.Add(BitConverter.GetBytes(data.Length));
foreach(var entry in data)
foreach (var entry in data)
listOfSerializations.Add(BitConverter.GetBytes(entry));
return listOfSerializations;
@ -44,11 +44,11 @@ namespace RosMessageTypes.Std
public override int Deserialize(byte[] data, int offset)
{
offset = this.layout.Deserialize(data, offset);
var dataArrayLength = DeserializeLength(data, offset);
offset += 4;
this.data= new long[dataArrayLength];
for(var i = 0; i < dataArrayLength; i++)
this.data = new long[dataArrayLength];
for (var i = 0; i < dataArrayLength; i++)
{
this.data[i] = BitConverter.ToInt64(data, offset);
offset += 8;

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

@ -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;

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

@ -33,9 +33,9 @@ namespace RosMessageTypes.Std
{
var listOfSerializations = new List<byte[]>();
listOfSerializations.AddRange(layout.SerializationStatements());
listOfSerializations.Add(BitConverter.GetBytes(data.Length));
listOfSerializations.Add((byte[]) (Array)this.data);
listOfSerializations.Add((byte[])(Array)this.data);
return listOfSerializations;
}
@ -43,11 +43,11 @@ namespace RosMessageTypes.Std
public override int Deserialize(byte[] data, int offset)
{
offset = this.layout.Deserialize(data, offset);
var dataArrayLength = DeserializeLength(data, offset);
offset += 4;
this.data= new sbyte[dataArrayLength];
for(var i = 0; i < dataArrayLength; i++)
this.data = new sbyte[dataArrayLength];
for (var i = 0; i < dataArrayLength; i++)
{
this.data[i] = (sbyte)data[offset];
offset += 1;

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

@ -52,9 +52,9 @@ namespace RosMessageTypes.Std
public override List<byte[]> SerializationStatements()
{
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));
@ -63,11 +63,11 @@ namespace RosMessageTypes.Std
public override int Deserialize(byte[] data, int offset)
{
var dimArrayLength = DeserializeLength(data, offset);
offset += 4;
this.dim= new MMultiArrayDimension[dimArrayLength];
for(var i = 0; i < dimArrayLength; i++)
this.dim = new MMultiArrayDimension[dimArrayLength];
for (var i = 0; i < dimArrayLength; i++)
{
this.dim[i] = new MMultiArrayDimension();
offset = this.dim[i].Deserialize(data, offset);

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

@ -10,7 +10,7 @@ namespace RosMessageTypes.Std
public class MTime : Message
{
public const string RosMessageName = "std_msgs/Time";
public uint secs;
public uint nsecs;

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

@ -33,9 +33,9 @@ namespace RosMessageTypes.Std
{
var listOfSerializations = new List<byte[]>();
listOfSerializations.AddRange(layout.SerializationStatements());
listOfSerializations.Add(BitConverter.GetBytes(data.Length));
foreach(var entry in data)
foreach (var entry in data)
listOfSerializations.Add(BitConverter.GetBytes(entry));
return listOfSerializations;
@ -44,11 +44,11 @@ namespace RosMessageTypes.Std
public override int Deserialize(byte[] data, int offset)
{
offset = this.layout.Deserialize(data, offset);
var dataArrayLength = DeserializeLength(data, offset);
offset += 4;
this.data= new ushort[dataArrayLength];
for(var i = 0; i < dataArrayLength; i++)
this.data = new ushort[dataArrayLength];
for (var i = 0; i < dataArrayLength; i++)
{
this.data[i] = BitConverter.ToUInt16(data, offset);
offset += 2;

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

@ -33,9 +33,9 @@ namespace RosMessageTypes.Std
{
var listOfSerializations = new List<byte[]>();
listOfSerializations.AddRange(layout.SerializationStatements());
listOfSerializations.Add(BitConverter.GetBytes(data.Length));
foreach(var entry in data)
foreach (var entry in data)
listOfSerializations.Add(BitConverter.GetBytes(entry));
return listOfSerializations;
@ -44,11 +44,11 @@ namespace RosMessageTypes.Std
public override int Deserialize(byte[] data, int offset)
{
offset = this.layout.Deserialize(data, offset);
var dataArrayLength = DeserializeLength(data, offset);
offset += 4;
this.data= new uint[dataArrayLength];
for(var i = 0; i < dataArrayLength; i++)
this.data = new uint[dataArrayLength];
for (var i = 0; i < dataArrayLength; i++)
{
this.data[i] = BitConverter.ToUInt32(data, offset);
offset += 4;

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

@ -33,9 +33,9 @@ namespace RosMessageTypes.Std
{
var listOfSerializations = new List<byte[]>();
listOfSerializations.AddRange(layout.SerializationStatements());
listOfSerializations.Add(BitConverter.GetBytes(data.Length));
foreach(var entry in data)
foreach (var entry in data)
listOfSerializations.Add(BitConverter.GetBytes(entry));
return listOfSerializations;
@ -44,11 +44,11 @@ namespace RosMessageTypes.Std
public override int Deserialize(byte[] data, int offset)
{
offset = this.layout.Deserialize(data, offset);
var dataArrayLength = DeserializeLength(data, offset);
offset += 4;
this.data= new ulong[dataArrayLength];
for(var i = 0; i < dataArrayLength; i++)
this.data = new ulong[dataArrayLength];
for (var i = 0; i < dataArrayLength; i++)
{
this.data[i] = BitConverter.ToUInt64(data, offset);
offset += 8;

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

@ -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;

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

@ -33,7 +33,7 @@ namespace RosMessageTypes.Std
{
var listOfSerializations = new List<byte[]>();
listOfSerializations.AddRange(layout.SerializationStatements());
listOfSerializations.Add(BitConverter.GetBytes(data.Length));
listOfSerializations.Add(this.data);
@ -43,11 +43,11 @@ namespace RosMessageTypes.Std
public override int Deserialize(byte[] data, int offset)
{
offset = this.layout.Deserialize(data, offset);
var dataArrayLength = DeserializeLength(data, offset);
offset += 4;
this.data= new byte[dataArrayLength];
for(var i = 0; i < dataArrayLength; i++)
this.data = new byte[dataArrayLength];
for (var i = 0; i < dataArrayLength; i++)
{
this.data[i] = data[offset];
offset += 1;

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

@ -33,13 +33,13 @@ namespace RosMessageTypes.Trajectory
{
var listOfSerializations = new List<byte[]>();
listOfSerializations.AddRange(header.SerializationStatements());
listOfSerializations.Add(BitConverter.GetBytes(joint_names.Length));
foreach(var entry in joint_names)
foreach (var entry in joint_names)
listOfSerializations.Add(SerializeString(entry));
listOfSerializations.Add(BitConverter.GetBytes(points.Length));
foreach(var entry in points)
foreach (var entry in points)
listOfSerializations.Add(entry.Serialize());
return listOfSerializations;
@ -48,22 +48,22 @@ namespace RosMessageTypes.Trajectory
public override int Deserialize(byte[] data, int offset)
{
offset = this.header.Deserialize(data, offset);
var joint_namesArrayLength = DeserializeLength(data, offset);
offset += 4;
this.joint_names= new string[joint_namesArrayLength];
for(var i = 0; i < joint_namesArrayLength; i++)
this.joint_names = new string[joint_namesArrayLength];
for (var i = 0; i < joint_namesArrayLength; i++)
{
var joint_namesStringBytesLength = DeserializeLength(data, offset);
offset += 4;
this.joint_names[i] = DeserializeString(data, offset, joint_namesStringBytesLength);
offset += joint_namesStringBytesLength;
}
var pointsArrayLength = DeserializeLength(data, offset);
offset += 4;
this.points= new MJointTrajectoryPoint[pointsArrayLength];
for(var i = 0; i < pointsArrayLength; i++)
this.points = new MJointTrajectoryPoint[pointsArrayLength];
for (var i = 0; i < pointsArrayLength; i++)
{
this.points[i] = new MJointTrajectoryPoint();
offset = this.points[i].Deserialize(data, offset);

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

@ -41,21 +41,21 @@ namespace RosMessageTypes.Trajectory
public override List<byte[]> SerializationStatements()
{
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());
@ -64,38 +64,38 @@ namespace RosMessageTypes.Trajectory
public override int Deserialize(byte[] data, int offset)
{
var positionsArrayLength = DeserializeLength(data, offset);
offset += 4;
this.positions= new double[positionsArrayLength];
for(var i = 0; i < positionsArrayLength; i++)
this.positions = new double[positionsArrayLength];
for (var i = 0; i < positionsArrayLength; i++)
{
this.positions[i] = BitConverter.ToDouble(data, offset);
offset += 8;
}
var velocitiesArrayLength = DeserializeLength(data, offset);
offset += 4;
this.velocities= new double[velocitiesArrayLength];
for(var i = 0; i < velocitiesArrayLength; i++)
this.velocities = new double[velocitiesArrayLength];
for (var i = 0; i < velocitiesArrayLength; i++)
{
this.velocities[i] = BitConverter.ToDouble(data, offset);
offset += 8;
}
var accelerationsArrayLength = DeserializeLength(data, offset);
offset += 4;
this.accelerations= new double[accelerationsArrayLength];
for(var i = 0; i < accelerationsArrayLength; i++)
this.accelerations = new double[accelerationsArrayLength];
for (var i = 0; i < accelerationsArrayLength; i++)
{
this.accelerations[i] = BitConverter.ToDouble(data, offset);
offset += 8;
}
var effortArrayLength = DeserializeLength(data, offset);
offset += 4;
this.effort= new double[effortArrayLength];
for(var i = 0; i < effortArrayLength; i++)
this.effort = new double[effortArrayLength];
for (var i = 0; i < effortArrayLength; i++)
{
this.effort[i] = BitConverter.ToDouble(data, offset);
offset += 8;

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

@ -38,13 +38,13 @@ namespace RosMessageTypes.Trajectory
{
var listOfSerializations = new List<byte[]>();
listOfSerializations.AddRange(header.SerializationStatements());
listOfSerializations.Add(BitConverter.GetBytes(joint_names.Length));
foreach(var entry in joint_names)
foreach (var entry in joint_names)
listOfSerializations.Add(SerializeString(entry));
listOfSerializations.Add(BitConverter.GetBytes(points.Length));
foreach(var entry in points)
foreach (var entry in points)
listOfSerializations.Add(entry.Serialize());
return listOfSerializations;
@ -53,22 +53,22 @@ namespace RosMessageTypes.Trajectory
public override int Deserialize(byte[] data, int offset)
{
offset = this.header.Deserialize(data, offset);
var joint_namesArrayLength = DeserializeLength(data, offset);
offset += 4;
this.joint_names= new string[joint_namesArrayLength];
for(var i = 0; i < joint_namesArrayLength; i++)
this.joint_names = new string[joint_namesArrayLength];
for (var i = 0; i < joint_namesArrayLength; i++)
{
var joint_namesStringBytesLength = DeserializeLength(data, offset);
offset += 4;
this.joint_names[i] = DeserializeString(data, offset, joint_namesStringBytesLength);
offset += joint_namesStringBytesLength;
}
var pointsArrayLength = DeserializeLength(data, offset);
offset += 4;
this.points= new MMultiDOFJointTrajectoryPoint[pointsArrayLength];
for(var i = 0; i < pointsArrayLength; i++)
this.points = new MMultiDOFJointTrajectoryPoint[pointsArrayLength];
for (var i = 0; i < pointsArrayLength; i++)
{
this.points[i] = new MMultiDOFJointTrajectoryPoint();
offset = this.points[i].Deserialize(data, offset);

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

@ -38,17 +38,17 @@ namespace RosMessageTypes.Trajectory
public override List<byte[]> SerializationStatements()
{
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());
@ -57,29 +57,29 @@ namespace RosMessageTypes.Trajectory
public override int Deserialize(byte[] data, int offset)
{
var transformsArrayLength = DeserializeLength(data, offset);
offset += 4;
this.transforms= new Geometry.MTransform[transformsArrayLength];
for(var i = 0; i < transformsArrayLength; i++)
this.transforms = new Geometry.MTransform[transformsArrayLength];
for (var i = 0; i < transformsArrayLength; i++)
{
this.transforms[i] = new Geometry.MTransform();
offset = this.transforms[i].Deserialize(data, offset);
}
var velocitiesArrayLength = DeserializeLength(data, offset);
offset += 4;
this.velocities= new Geometry.MTwist[velocitiesArrayLength];
for(var i = 0; i < velocitiesArrayLength; i++)
this.velocities = new Geometry.MTwist[velocitiesArrayLength];
for (var i = 0; i < velocitiesArrayLength; i++)
{
this.velocities[i] = new Geometry.MTwist();
offset = this.velocities[i].Deserialize(data, offset);
}
var accelerationsArrayLength = DeserializeLength(data, offset);
offset += 4;
this.accelerations= new Geometry.MTwist[accelerationsArrayLength];
for(var i = 0; i < accelerationsArrayLength; i++)
this.accelerations = new Geometry.MTwist[accelerationsArrayLength];
for (var i = 0; i < accelerationsArrayLength; i++)
{
this.accelerations[i] = new Geometry.MTwist();
offset = this.accelerations[i].Deserialize(data, offset);

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

@ -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,24 +120,24 @@ 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);
}
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);

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

@ -62,13 +62,13 @@ namespace RosMessageTypes.Visualization
listOfSerializations.Add(SerializeString(this.name));
listOfSerializations.Add(SerializeString(this.description));
listOfSerializations.Add(BitConverter.GetBytes(this.scale));
listOfSerializations.Add(BitConverter.GetBytes(menu_entries.Length));
foreach(var entry in menu_entries)
foreach (var entry in menu_entries)
listOfSerializations.Add(entry.Serialize());
listOfSerializations.Add(BitConverter.GetBytes(controls.Length));
foreach(var entry in controls)
foreach (var entry in controls)
listOfSerializations.Add(entry.Serialize());
return listOfSerializations;
@ -88,20 +88,20 @@ namespace RosMessageTypes.Visualization
offset += descriptionStringBytesLength;
this.scale = BitConverter.ToSingle(data, offset);
offset += 4;
var menu_entriesArrayLength = DeserializeLength(data, offset);
offset += 4;
this.menu_entries= new MMenuEntry[menu_entriesArrayLength];
for(var i = 0; i < menu_entriesArrayLength; i++)
this.menu_entries = new MMenuEntry[menu_entriesArrayLength];
for (var i = 0; i < menu_entriesArrayLength; i++)
{
this.menu_entries[i] = new MMenuEntry();
offset = this.menu_entries[i].Deserialize(data, offset);
}
var controlsArrayLength = DeserializeLength(data, offset);
offset += 4;
this.controls= new MInteractiveMarkerControl[controlsArrayLength];
for(var i = 0; i < controlsArrayLength; i++)
this.controls = new MInteractiveMarkerControl[controlsArrayLength];
for (var i = 0; i < controlsArrayLength; i++)
{
this.controls[i] = new MInteractiveMarkerControl();
offset = this.controls[i].Deserialize(data, offset);

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

@ -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);

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

@ -42,9 +42,9 @@ namespace RosMessageTypes.Visualization
var listOfSerializations = new List<byte[]>();
listOfSerializations.Add(SerializeString(this.server_id));
listOfSerializations.Add(BitConverter.GetBytes(this.seq_num));
listOfSerializations.Add(BitConverter.GetBytes(markers.Length));
foreach(var entry in markers)
foreach (var entry in markers)
listOfSerializations.Add(entry.Serialize());
return listOfSerializations;
@ -58,11 +58,11 @@ namespace RosMessageTypes.Visualization
offset += server_idStringBytesLength;
this.seq_num = BitConverter.ToUInt64(data, offset);
offset += 8;
var markersArrayLength = DeserializeLength(data, offset);
offset += 4;
this.markers= new MInteractiveMarker[markersArrayLength];
for(var i = 0; i < markersArrayLength; i++)
this.markers = new MInteractiveMarker[markersArrayLength];
for (var i = 0; i < markersArrayLength; i++)
{
this.markers[i] = new MInteractiveMarker();
offset = this.markers[i].Deserialize(data, offset);

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

@ -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,31 +85,31 @@ 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);
}
var posesArrayLength = DeserializeLength(data, offset);
offset += 4;
this.poses= new MInteractiveMarkerPose[posesArrayLength];
for(var i = 0; i < posesArrayLength; i++)
this.poses = new MInteractiveMarkerPose[posesArrayLength];
for (var i = 0; i < posesArrayLength; i++)
{
this.poses[i] = new MInteractiveMarkerPose();
offset = this.poses[i].Deserialize(data, offset);
}
var erasesArrayLength = DeserializeLength(data, offset);
offset += 4;
this.erases= new string[erasesArrayLength];
for(var i = 0; i < erasesArrayLength; i++)
this.erases = new string[erasesArrayLength];
for (var i = 0; i < erasesArrayLength; i++)
{
var erasesStringBytesLength = DeserializeLength(data, offset);
offset += 4;

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

@ -111,13 +111,13 @@ namespace RosMessageTypes.Visualization
listOfSerializations.AddRange(color.SerializationStatements());
listOfSerializations.AddRange(lifetime.SerializationStatements());
listOfSerializations.Add(BitConverter.GetBytes(this.frame_locked));
listOfSerializations.Add(BitConverter.GetBytes(points.Length));
foreach(var entry in points)
foreach (var entry in points)
listOfSerializations.Add(entry.Serialize());
listOfSerializations.Add(BitConverter.GetBytes(colors.Length));
foreach(var entry in colors)
foreach (var entry in colors)
listOfSerializations.Add(entry.Serialize());
listOfSerializations.Add(SerializeString(this.text));
listOfSerializations.Add(SerializeString(this.mesh_resource));
@ -145,20 +145,20 @@ namespace RosMessageTypes.Visualization
offset = this.lifetime.Deserialize(data, offset);
this.frame_locked = BitConverter.ToBoolean(data, offset);
offset += 1;
var pointsArrayLength = DeserializeLength(data, offset);
offset += 4;
this.points= new Geometry.MPoint[pointsArrayLength];
for(var i = 0; i < pointsArrayLength; i++)
this.points = new Geometry.MPoint[pointsArrayLength];
for (var i = 0; i < pointsArrayLength; i++)
{
this.points[i] = new Geometry.MPoint();
offset = this.points[i].Deserialize(data, offset);
}
var colorsArrayLength = DeserializeLength(data, offset);
offset += 4;
this.colors= new Std.MColorRGBA[colorsArrayLength];
for(var i = 0; i < colorsArrayLength; i++)
this.colors = new Std.MColorRGBA[colorsArrayLength];
for (var i = 0; i < colorsArrayLength; i++)
{
this.colors[i] = new Std.MColorRGBA();
offset = this.colors[i].Deserialize(data, offset);

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше