Skip to content

Latest commit

 

History

History
98 lines (81 loc) · 3.8 KB

README.md

File metadata and controls

98 lines (81 loc) · 3.8 KB






Build, run tests and generate report Coverage Status

RosNet

What is RosNet?

RosNet is a .NET library for deserializing rosbags version 2.0 to C#-objects.

How to use the library:

For full API documentation go to: https://revolventnu.github.io/RosNet/

To use RosNet in a C#-based application: Install RosNet as a NuGet Package.

Using statement

using RosNet.DataModel;

Convert a ROSBag to a C# object

var rosBag = new RosBag(path);
rosBag.Read();

Obtain possible ROS topics and fields in the topics

Dictionary<string, List<string>> fieldNamesByTopic = rosBag.GetConnectionFields();

Obtain list of tuples with timestamp and fieldvalue

List<(Time, FieldValue)> timeSeries = rosBag.GetTimeSeries(topic, fieldName);

FieldValue

You will primarily interact with FieldValue which has the following fields

  • string Name - name of the field
  • PrimitiveType DataType - datatype of the value. PrimitiveType is an Enum with possible values: Bool, Int8, Uint8, Int16, Unit16, Int32, Uint32, Int64, Uint64, Float32, Float64, String, Time, Duration, Byte, Char and Array. The datatypes correspond to the standard datatypes in ROS messages and Array used for arrays of values.
  • byte[] Value - is the value of the field

Conversion between PrimitiveType and C# types:

PrimitiveType C# type
Bool bool
Byte sbyte
Char char
Duration RosNet.DataModel.Time
Float32 float
Float64 double
Int8 sbyte
Int16 short
Int32 int
Int64 long
Time RosNet.DataModel.Time
Uint8 byte
Uint16 ushort
Uint32 uint
Uint64 ulong

ArrayFieldValue

ArrayFieldValue represents a fieldvalue that is an array of fieldvalues. The class inherits from FieldValue and has an additional list of fieldvalues.

Time

Time is a custom data type with a uint called Secs and a uint called NSecs. The class is comparable and has the function ToDateTime() that returns the Time as a DateTime object.

External dependencies

SharpZipLib used for decompression from bz2: http://icsharpcode.github.io/SharpZipLib/

Credits

This library is made by the organization Revolve NTNU: https://www.revolve.no

Contributors:
Henrik Hørlück Berg https://github.com/henrikhorluck
Inge Grelland https://github.com/Kytzis
Juni Sæther Skarpaas https://github.com/Juni-hub
Lars van der Lee https://github.com/TheLarsinator
Mikael Steenbuch https://github.com/mikaelste

License

This software is licensed with the Apache 2.0 license. See LICENSE for more information.