RosNet is a .NET library for deserializing rosbags version 2.0 to C#-objects.
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 RosNet.DataModel;
var rosBag = new RosBag(path);
rosBag.Read();
Dictionary<string, List<string>> fieldNamesByTopic = rosBag.GetConnectionFields();
List<(Time, FieldValue)> timeSeries = rosBag.GetTimeSeries(topic, fieldName);
You will primarily interact with FieldValue
which has the following fields
string Name
- name of the fieldPrimitiveType 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
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 represents a fieldvalue that is an array of fieldvalues. The class inherits from FieldValue and has an additional list of fieldvalues.
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.
SharpZipLib used for decompression from bz2: http://icsharpcode.github.io/SharpZipLib/
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
This software is licensed with the Apache 2.0 license. See LICENSE for more information.