organize files
This commit is contained in:
@@ -0,0 +1 @@
|
||||
{"flight_info_message":{"json":85,"proto":22},"fly_format_message":{"json":55,"proto":7},"imu_info_message":{"json":130,"proto":34},"odom_info_message":{"json":59,"proto":17},"flymode_info_message":{"json":38,"proto":2},"duration_info_message":{"json":8,"proto":4},"timestamp_info_message":{"json":29,"proto":12},"Total":{"json":404,"proto":98}}
|
||||
@@ -0,0 +1 @@
|
||||
{"serialize":{"json":0.34479037301207427,"proto":1.0475460140005453},"deserializ":{"json":0.42335569999704603,"proto":0.5118989990005502}}
|
||||
@@ -0,0 +1 @@
|
||||
"0.001s"
|
||||
@@ -0,0 +1 @@
|
||||
��=
|
||||
@@ -0,0 +1 @@
|
||||
{"gps": {"LAT": 34123.125, "LON": 23423.123, "ALT": 12123.123}, "heading": 155.12215}
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
␍ KG?þ¶F~l=FEC
|
||||
@@ -0,0 +1 @@
|
||||
{"velocity": 128.0, "fly_formation": "FLY_FORMATION_v"}
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
{"fly_mode_msg": "FLY_MODE_STABILIZE"}
|
||||
@@ -0,0 +1 @@
|
||||
{"IMU_Gyro_msg": {"Gyro_x": 1.0, "Gyro_y": 2.0, "Gyro_z": 3.0}, "IMU_Accel_msg": {"Accel_x": 4.0, "Accel_y": 5.0, "Accel_z": 6.0}}
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
{"odem_msg": {"ODOM_x": 1.0, "ODOM_y": 2.0, "ODOM_z": 3.0}}
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
"2023-02-20T17:27:58.498239Z"
|
||||
@@ -0,0 +1 @@
|
||||
炢螣三燀
|
||||
@@ -0,0 +1,115 @@
|
||||
// Protocol Buffers - Google's data interchange format
|
||||
// Copyright 2008 Google Inc. All rights reserved.
|
||||
// https://developers.google.com/protocol-buffers/
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the names of its
|
||||
// contributors may be used to endorse or promote products derived from
|
||||
// this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
package google.protobuf;
|
||||
|
||||
option cc_enable_arenas = true;
|
||||
option go_package = "google.golang.org/protobuf/types/known/durationpb";
|
||||
option java_package = "com.google.protobuf";
|
||||
option java_outer_classname = "DurationProto";
|
||||
option java_multiple_files = true;
|
||||
option objc_class_prefix = "GPB";
|
||||
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
|
||||
|
||||
// A Duration represents a signed, fixed-length span of time represented
|
||||
// as a count of seconds and fractions of seconds at nanosecond
|
||||
// resolution. It is independent of any calendar and concepts like "day"
|
||||
// or "month". It is related to Timestamp in that the difference between
|
||||
// two Timestamp values is a Duration and it can be added or subtracted
|
||||
// from a Timestamp. Range is approximately +-10,000 years.
|
||||
//
|
||||
// # Examples
|
||||
//
|
||||
// Example 1: Compute Duration from two Timestamps in pseudo code.
|
||||
//
|
||||
// Timestamp start = ...;
|
||||
// Timestamp end = ...;
|
||||
// Duration duration = ...;
|
||||
//
|
||||
// duration.seconds = end.seconds - start.seconds;
|
||||
// duration.nanos = end.nanos - start.nanos;
|
||||
//
|
||||
// if (duration.seconds < 0 && duration.nanos > 0) {
|
||||
// duration.seconds += 1;
|
||||
// duration.nanos -= 1000000000;
|
||||
// } else if (duration.seconds > 0 && duration.nanos < 0) {
|
||||
// duration.seconds -= 1;
|
||||
// duration.nanos += 1000000000;
|
||||
// }
|
||||
//
|
||||
// Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
|
||||
//
|
||||
// Timestamp start = ...;
|
||||
// Duration duration = ...;
|
||||
// Timestamp end = ...;
|
||||
//
|
||||
// end.seconds = start.seconds + duration.seconds;
|
||||
// end.nanos = start.nanos + duration.nanos;
|
||||
//
|
||||
// if (end.nanos < 0) {
|
||||
// end.seconds -= 1;
|
||||
// end.nanos += 1000000000;
|
||||
// } else if (end.nanos >= 1000000000) {
|
||||
// end.seconds += 1;
|
||||
// end.nanos -= 1000000000;
|
||||
// }
|
||||
//
|
||||
// Example 3: Compute Duration from datetime.timedelta in Python.
|
||||
//
|
||||
// td = datetime.timedelta(days=3, minutes=10)
|
||||
// duration = Duration()
|
||||
// duration.FromTimedelta(td)
|
||||
//
|
||||
// # JSON Mapping
|
||||
//
|
||||
// In JSON format, the Duration type is encoded as a string rather than an
|
||||
// object, where the string ends in the suffix "s" (indicating seconds) and
|
||||
// is preceded by the number of seconds, with nanoseconds expressed as
|
||||
// fractional seconds. For example, 3 seconds with 0 nanoseconds should be
|
||||
// encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
|
||||
// be expressed in JSON format as "3.000000001s", and 3 seconds and 1
|
||||
// microsecond should be expressed in JSON format as "3.000001s".
|
||||
//
|
||||
message Duration {
|
||||
// Signed seconds of the span of time. Must be from -315,576,000,000
|
||||
// to +315,576,000,000 inclusive. Note: these bounds are computed from:
|
||||
// 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
|
||||
int64 seconds = 1;
|
||||
|
||||
// Signed fractions of a second at nanosecond resolution of the span
|
||||
// of time. Durations less than one second are represented with a 0
|
||||
// `seconds` field and a positive or negative `nanos` field. For durations
|
||||
// of one second or more, a non-zero value for the `nanos` field must be
|
||||
// of the same sign as the `seconds` field. Must be from -999,999,999
|
||||
// to +999,999,999 inclusive.
|
||||
int32 nanos = 2;
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
# source: duration.proto
|
||||
|
||||
import sys
|
||||
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
|
||||
from google.protobuf import descriptor as _descriptor
|
||||
from google.protobuf import message as _message
|
||||
from google.protobuf import reflection as _reflection
|
||||
from google.protobuf import symbol_database as _symbol_database
|
||||
# @@protoc_insertion_point(imports)
|
||||
|
||||
_sym_db = _symbol_database.Default()
|
||||
|
||||
|
||||
|
||||
|
||||
DESCRIPTOR = _descriptor.FileDescriptor(
|
||||
name='duration.proto',
|
||||
package='google.protobuf',
|
||||
syntax='proto3',
|
||||
serialized_options=_b('\n\023com.google.protobufB\rDurationProtoP\001Z1google.golang.org/protobuf/types/known/durationpb\370\001\001\242\002\003GPB\252\002\036Google.Protobuf.WellKnownTypes'),
|
||||
serialized_pb=_b('\n\x0e\x64uration.proto\x12\x0fgoogle.protobuf\"*\n\x08\x44uration\x12\x0f\n\x07seconds\x18\x01 \x01(\x03\x12\r\n\x05nanos\x18\x02 \x01(\x05\x42\x83\x01\n\x13\x63om.google.protobufB\rDurationProtoP\x01Z1google.golang.org/protobuf/types/known/durationpb\xf8\x01\x01\xa2\x02\x03GPB\xaa\x02\x1eGoogle.Protobuf.WellKnownTypesb\x06proto3')
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
_DURATION = _descriptor.Descriptor(
|
||||
name='Duration',
|
||||
full_name='google.protobuf.Duration',
|
||||
filename=None,
|
||||
file=DESCRIPTOR,
|
||||
containing_type=None,
|
||||
fields=[
|
||||
_descriptor.FieldDescriptor(
|
||||
name='seconds', full_name='google.protobuf.Duration.seconds', index=0,
|
||||
number=1, type=3, cpp_type=2, label=1,
|
||||
has_default_value=False, default_value=0,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='nanos', full_name='google.protobuf.Duration.nanos', index=1,
|
||||
number=2, type=5, cpp_type=1, label=1,
|
||||
has_default_value=False, default_value=0,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
],
|
||||
extensions=[
|
||||
],
|
||||
nested_types=[],
|
||||
enum_types=[
|
||||
],
|
||||
serialized_options=None,
|
||||
is_extendable=False,
|
||||
syntax='proto3',
|
||||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=35,
|
||||
serialized_end=77,
|
||||
)
|
||||
|
||||
DESCRIPTOR.message_types_by_name['Duration'] = _DURATION
|
||||
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
|
||||
|
||||
Duration = _reflection.GeneratedProtocolMessageType('Duration', (_message.Message,), dict(
|
||||
DESCRIPTOR = _DURATION,
|
||||
__module__ = 'duration_pb2'
|
||||
# @@protoc_insertion_point(class_scope:google.protobuf.Duration)
|
||||
))
|
||||
_sym_db.RegisterMessage(Duration)
|
||||
|
||||
|
||||
DESCRIPTOR._options = None
|
||||
# @@protoc_insertion_point(module_scope)
|
||||
@@ -0,0 +1,14 @@
|
||||
syntax = 'proto3';
|
||||
|
||||
// GPS + compass
|
||||
|
||||
message GPS {
|
||||
float LAT = 1;
|
||||
float LON = 2;
|
||||
float ALT = 3;
|
||||
}
|
||||
|
||||
message flight_information_message {
|
||||
GPS gps = 1;
|
||||
float heading = 2;
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
# source: flight_information.proto
|
||||
|
||||
import sys
|
||||
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
|
||||
from google.protobuf import descriptor as _descriptor
|
||||
from google.protobuf import message as _message
|
||||
from google.protobuf import reflection as _reflection
|
||||
from google.protobuf import symbol_database as _symbol_database
|
||||
# @@protoc_insertion_point(imports)
|
||||
|
||||
_sym_db = _symbol_database.Default()
|
||||
|
||||
|
||||
|
||||
|
||||
DESCRIPTOR = _descriptor.FileDescriptor(
|
||||
name='flight_information.proto',
|
||||
package='',
|
||||
syntax='proto3',
|
||||
serialized_options=None,
|
||||
serialized_pb=_b('\n\x18\x66light_information.proto\",\n\x03GPS\x12\x0b\n\x03LAT\x18\x01 \x01(\x02\x12\x0b\n\x03LON\x18\x02 \x01(\x02\x12\x0b\n\x03\x41LT\x18\x03 \x01(\x02\"@\n\x1a\x66light_information_message\x12\x11\n\x03gps\x18\x01 \x01(\x0b\x32\x04.GPS\x12\x0f\n\x07heading\x18\x02 \x01(\x02\x62\x06proto3')
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
_GPS = _descriptor.Descriptor(
|
||||
name='GPS',
|
||||
full_name='GPS',
|
||||
filename=None,
|
||||
file=DESCRIPTOR,
|
||||
containing_type=None,
|
||||
fields=[
|
||||
_descriptor.FieldDescriptor(
|
||||
name='LAT', full_name='GPS.LAT', index=0,
|
||||
number=1, type=2, cpp_type=6, label=1,
|
||||
has_default_value=False, default_value=float(0),
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='LON', full_name='GPS.LON', index=1,
|
||||
number=2, type=2, cpp_type=6, label=1,
|
||||
has_default_value=False, default_value=float(0),
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='ALT', full_name='GPS.ALT', index=2,
|
||||
number=3, type=2, cpp_type=6, label=1,
|
||||
has_default_value=False, default_value=float(0),
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
],
|
||||
extensions=[
|
||||
],
|
||||
nested_types=[],
|
||||
enum_types=[
|
||||
],
|
||||
serialized_options=None,
|
||||
is_extendable=False,
|
||||
syntax='proto3',
|
||||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=28,
|
||||
serialized_end=72,
|
||||
)
|
||||
|
||||
|
||||
_FLIGHT_INFORMATION_MESSAGE = _descriptor.Descriptor(
|
||||
name='flight_information_message',
|
||||
full_name='flight_information_message',
|
||||
filename=None,
|
||||
file=DESCRIPTOR,
|
||||
containing_type=None,
|
||||
fields=[
|
||||
_descriptor.FieldDescriptor(
|
||||
name='gps', full_name='flight_information_message.gps', index=0,
|
||||
number=1, type=11, cpp_type=10, label=1,
|
||||
has_default_value=False, default_value=None,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='heading', full_name='flight_information_message.heading', index=1,
|
||||
number=2, type=2, cpp_type=6, label=1,
|
||||
has_default_value=False, default_value=float(0),
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
],
|
||||
extensions=[
|
||||
],
|
||||
nested_types=[],
|
||||
enum_types=[
|
||||
],
|
||||
serialized_options=None,
|
||||
is_extendable=False,
|
||||
syntax='proto3',
|
||||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=74,
|
||||
serialized_end=138,
|
||||
)
|
||||
|
||||
_FLIGHT_INFORMATION_MESSAGE.fields_by_name['gps'].message_type = _GPS
|
||||
DESCRIPTOR.message_types_by_name['GPS'] = _GPS
|
||||
DESCRIPTOR.message_types_by_name['flight_information_message'] = _FLIGHT_INFORMATION_MESSAGE
|
||||
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
|
||||
|
||||
GPS = _reflection.GeneratedProtocolMessageType('GPS', (_message.Message,), dict(
|
||||
DESCRIPTOR = _GPS,
|
||||
__module__ = 'flight_information_pb2'
|
||||
# @@protoc_insertion_point(class_scope:GPS)
|
||||
))
|
||||
_sym_db.RegisterMessage(GPS)
|
||||
|
||||
flight_information_message = _reflection.GeneratedProtocolMessageType('flight_information_message', (_message.Message,), dict(
|
||||
DESCRIPTOR = _FLIGHT_INFORMATION_MESSAGE,
|
||||
__module__ = 'flight_information_pb2'
|
||||
# @@protoc_insertion_point(class_scope:flight_information_message)
|
||||
))
|
||||
_sym_db.RegisterMessage(flight_information_message)
|
||||
|
||||
|
||||
# @@protoc_insertion_point(module_scope)
|
||||
@@ -0,0 +1,17 @@
|
||||
syntax = "proto3";
|
||||
|
||||
// leader only
|
||||
|
||||
enum FLY_FORMATION{
|
||||
FLY_FORMATION_UNSPECIFIED = 0;
|
||||
FLY_FORMATION_v = 1;
|
||||
FLY_FORMATION_X = 2;
|
||||
FLY_FORMATION_O = 3;
|
||||
FLY_FORMATION_LINE = 4;
|
||||
FLY_FORMATION_ROW = 5;
|
||||
FLY_FORMATION_HEX = 6;
|
||||
}
|
||||
message fly_formation_message{
|
||||
float velocity = 1;
|
||||
FLY_FORMATION fly_formation= 2;
|
||||
}
|
||||
@@ -0,0 +1,129 @@
|
||||
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
# source: flyformatioln.proto
|
||||
|
||||
import sys
|
||||
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
|
||||
from google.protobuf.internal import enum_type_wrapper
|
||||
from google.protobuf import descriptor as _descriptor
|
||||
from google.protobuf import message as _message
|
||||
from google.protobuf import reflection as _reflection
|
||||
from google.protobuf import symbol_database as _symbol_database
|
||||
# @@protoc_insertion_point(imports)
|
||||
|
||||
_sym_db = _symbol_database.Default()
|
||||
|
||||
|
||||
|
||||
|
||||
DESCRIPTOR = _descriptor.FileDescriptor(
|
||||
name='flyformatioln.proto',
|
||||
package='',
|
||||
syntax='proto3',
|
||||
serialized_options=None,
|
||||
serialized_pb=_b('\n\x13\x66lyformatioln.proto\"P\n\x15\x66ly_formation_message\x12\x10\n\x08velocity\x18\x01 \x01(\x02\x12%\n\rfly_formation\x18\x02 \x01(\x0e\x32\x0e.FLY_FORMATION*\xb3\x01\n\rFLY_FORMATION\x12\x1d\n\x19\x46LY_FORMATION_UNSPECIFIED\x10\x00\x12\x13\n\x0f\x46LY_FORMATION_v\x10\x01\x12\x13\n\x0f\x46LY_FORMATION_X\x10\x02\x12\x13\n\x0f\x46LY_FORMATION_O\x10\x03\x12\x16\n\x12\x46LY_FORMATION_LINE\x10\x04\x12\x15\n\x11\x46LY_FORMATION_ROW\x10\x05\x12\x15\n\x11\x46LY_FORMATION_HEX\x10\x06\x62\x06proto3')
|
||||
)
|
||||
|
||||
_FLY_FORMATION = _descriptor.EnumDescriptor(
|
||||
name='FLY_FORMATION',
|
||||
full_name='FLY_FORMATION',
|
||||
filename=None,
|
||||
file=DESCRIPTOR,
|
||||
values=[
|
||||
_descriptor.EnumValueDescriptor(
|
||||
name='FLY_FORMATION_UNSPECIFIED', index=0, number=0,
|
||||
serialized_options=None,
|
||||
type=None),
|
||||
_descriptor.EnumValueDescriptor(
|
||||
name='FLY_FORMATION_v', index=1, number=1,
|
||||
serialized_options=None,
|
||||
type=None),
|
||||
_descriptor.EnumValueDescriptor(
|
||||
name='FLY_FORMATION_X', index=2, number=2,
|
||||
serialized_options=None,
|
||||
type=None),
|
||||
_descriptor.EnumValueDescriptor(
|
||||
name='FLY_FORMATION_O', index=3, number=3,
|
||||
serialized_options=None,
|
||||
type=None),
|
||||
_descriptor.EnumValueDescriptor(
|
||||
name='FLY_FORMATION_LINE', index=4, number=4,
|
||||
serialized_options=None,
|
||||
type=None),
|
||||
_descriptor.EnumValueDescriptor(
|
||||
name='FLY_FORMATION_ROW', index=5, number=5,
|
||||
serialized_options=None,
|
||||
type=None),
|
||||
_descriptor.EnumValueDescriptor(
|
||||
name='FLY_FORMATION_HEX', index=6, number=6,
|
||||
serialized_options=None,
|
||||
type=None),
|
||||
],
|
||||
containing_type=None,
|
||||
serialized_options=None,
|
||||
serialized_start=106,
|
||||
serialized_end=285,
|
||||
)
|
||||
_sym_db.RegisterEnumDescriptor(_FLY_FORMATION)
|
||||
|
||||
FLY_FORMATION = enum_type_wrapper.EnumTypeWrapper(_FLY_FORMATION)
|
||||
FLY_FORMATION_UNSPECIFIED = 0
|
||||
FLY_FORMATION_v = 1
|
||||
FLY_FORMATION_X = 2
|
||||
FLY_FORMATION_O = 3
|
||||
FLY_FORMATION_LINE = 4
|
||||
FLY_FORMATION_ROW = 5
|
||||
FLY_FORMATION_HEX = 6
|
||||
|
||||
|
||||
|
||||
_FLY_FORMATION_MESSAGE = _descriptor.Descriptor(
|
||||
name='fly_formation_message',
|
||||
full_name='fly_formation_message',
|
||||
filename=None,
|
||||
file=DESCRIPTOR,
|
||||
containing_type=None,
|
||||
fields=[
|
||||
_descriptor.FieldDescriptor(
|
||||
name='velocity', full_name='fly_formation_message.velocity', index=0,
|
||||
number=1, type=2, cpp_type=6, label=1,
|
||||
has_default_value=False, default_value=float(0),
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='fly_formation', full_name='fly_formation_message.fly_formation', index=1,
|
||||
number=2, type=14, cpp_type=8, label=1,
|
||||
has_default_value=False, default_value=0,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
],
|
||||
extensions=[
|
||||
],
|
||||
nested_types=[],
|
||||
enum_types=[
|
||||
],
|
||||
serialized_options=None,
|
||||
is_extendable=False,
|
||||
syntax='proto3',
|
||||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=23,
|
||||
serialized_end=103,
|
||||
)
|
||||
|
||||
_FLY_FORMATION_MESSAGE.fields_by_name['fly_formation'].enum_type = _FLY_FORMATION
|
||||
DESCRIPTOR.message_types_by_name['fly_formation_message'] = _FLY_FORMATION_MESSAGE
|
||||
DESCRIPTOR.enum_types_by_name['FLY_FORMATION'] = _FLY_FORMATION
|
||||
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
|
||||
|
||||
fly_formation_message = _reflection.GeneratedProtocolMessageType('fly_formation_message', (_message.Message,), dict(
|
||||
DESCRIPTOR = _FLY_FORMATION_MESSAGE,
|
||||
__module__ = 'flyformatioln_pb2'
|
||||
# @@protoc_insertion_point(class_scope:fly_formation_message)
|
||||
))
|
||||
_sym_db.RegisterMessage(fly_formation_message)
|
||||
|
||||
|
||||
# @@protoc_insertion_point(module_scope)
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
syntax = "proto3";
|
||||
|
||||
|
||||
enum FLYMODE{
|
||||
FLY_MODE_UNSPECIFIED = 0;
|
||||
FLY_MODE_STABILIZE = 1;
|
||||
FLY_MODE_GUIDEDIZE = 2;
|
||||
FLY_MODE_LAND = 3;
|
||||
}
|
||||
|
||||
message flymode_message{
|
||||
FLYMODE fly_mode_msg = 1;
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
# source: flymode.proto
|
||||
|
||||
import sys
|
||||
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
|
||||
from google.protobuf.internal import enum_type_wrapper
|
||||
from google.protobuf import descriptor as _descriptor
|
||||
from google.protobuf import message as _message
|
||||
from google.protobuf import reflection as _reflection
|
||||
from google.protobuf import symbol_database as _symbol_database
|
||||
# @@protoc_insertion_point(imports)
|
||||
|
||||
_sym_db = _symbol_database.Default()
|
||||
|
||||
|
||||
|
||||
|
||||
DESCRIPTOR = _descriptor.FileDescriptor(
|
||||
name='flymode.proto',
|
||||
package='',
|
||||
syntax='proto3',
|
||||
serialized_options=None,
|
||||
serialized_pb=_b('\n\rflymode.proto\"1\n\x0f\x66lymode_message\x12\x1e\n\x0c\x66ly_mode_msg\x18\x01 \x01(\x0e\x32\x08.FLYMODE*f\n\x07\x46LYMODE\x12\x18\n\x14\x46LY_MODE_UNSPECIFIED\x10\x00\x12\x16\n\x12\x46LY_MODE_STABILIZE\x10\x01\x12\x16\n\x12\x46LY_MODE_GUIDEDIZE\x10\x02\x12\x11\n\rFLY_MODE_LAND\x10\x03\x62\x06proto3')
|
||||
)
|
||||
|
||||
_FLYMODE = _descriptor.EnumDescriptor(
|
||||
name='FLYMODE',
|
||||
full_name='FLYMODE',
|
||||
filename=None,
|
||||
file=DESCRIPTOR,
|
||||
values=[
|
||||
_descriptor.EnumValueDescriptor(
|
||||
name='FLY_MODE_UNSPECIFIED', index=0, number=0,
|
||||
serialized_options=None,
|
||||
type=None),
|
||||
_descriptor.EnumValueDescriptor(
|
||||
name='FLY_MODE_STABILIZE', index=1, number=1,
|
||||
serialized_options=None,
|
||||
type=None),
|
||||
_descriptor.EnumValueDescriptor(
|
||||
name='FLY_MODE_GUIDEDIZE', index=2, number=2,
|
||||
serialized_options=None,
|
||||
type=None),
|
||||
_descriptor.EnumValueDescriptor(
|
||||
name='FLY_MODE_LAND', index=3, number=3,
|
||||
serialized_options=None,
|
||||
type=None),
|
||||
],
|
||||
containing_type=None,
|
||||
serialized_options=None,
|
||||
serialized_start=68,
|
||||
serialized_end=170,
|
||||
)
|
||||
_sym_db.RegisterEnumDescriptor(_FLYMODE)
|
||||
|
||||
FLYMODE = enum_type_wrapper.EnumTypeWrapper(_FLYMODE)
|
||||
FLY_MODE_UNSPECIFIED = 0
|
||||
FLY_MODE_STABILIZE = 1
|
||||
FLY_MODE_GUIDEDIZE = 2
|
||||
FLY_MODE_LAND = 3
|
||||
|
||||
|
||||
|
||||
_FLYMODE_MESSAGE = _descriptor.Descriptor(
|
||||
name='flymode_message',
|
||||
full_name='flymode_message',
|
||||
filename=None,
|
||||
file=DESCRIPTOR,
|
||||
containing_type=None,
|
||||
fields=[
|
||||
_descriptor.FieldDescriptor(
|
||||
name='fly_mode_msg', full_name='flymode_message.fly_mode_msg', index=0,
|
||||
number=1, type=14, cpp_type=8, label=1,
|
||||
has_default_value=False, default_value=0,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
],
|
||||
extensions=[
|
||||
],
|
||||
nested_types=[],
|
||||
enum_types=[
|
||||
],
|
||||
serialized_options=None,
|
||||
is_extendable=False,
|
||||
syntax='proto3',
|
||||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=17,
|
||||
serialized_end=66,
|
||||
)
|
||||
|
||||
_FLYMODE_MESSAGE.fields_by_name['fly_mode_msg'].enum_type = _FLYMODE
|
||||
DESCRIPTOR.message_types_by_name['flymode_message'] = _FLYMODE_MESSAGE
|
||||
DESCRIPTOR.enum_types_by_name['FLYMODE'] = _FLYMODE
|
||||
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
|
||||
|
||||
flymode_message = _reflection.GeneratedProtocolMessageType('flymode_message', (_message.Message,), dict(
|
||||
DESCRIPTOR = _FLYMODE_MESSAGE,
|
||||
__module__ = 'flymode_pb2'
|
||||
# @@protoc_insertion_point(class_scope:flymode_message)
|
||||
))
|
||||
_sym_db.RegisterMessage(flymode_message)
|
||||
|
||||
|
||||
# @@protoc_insertion_point(module_scope)
|
||||
Executable
+19
@@ -0,0 +1,19 @@
|
||||
syntax = 'proto3';
|
||||
|
||||
|
||||
message IMU_Gyro {
|
||||
float Gyro_x = 1;
|
||||
float Gyro_y = 2;
|
||||
float Gyro_z = 3;
|
||||
}
|
||||
|
||||
message IMU_Accel {
|
||||
float Accel_x = 1;
|
||||
float Accel_y = 2;
|
||||
float Accel_z = 3;
|
||||
}
|
||||
|
||||
message IMU_message{
|
||||
IMU_Gyro IMU_Gyro_msg = 1;
|
||||
IMU_Accel IMU_Accel_msg = 2;
|
||||
}
|
||||
@@ -0,0 +1,184 @@
|
||||
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
# source: imu.proto
|
||||
|
||||
import sys
|
||||
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
|
||||
from google.protobuf import descriptor as _descriptor
|
||||
from google.protobuf import message as _message
|
||||
from google.protobuf import reflection as _reflection
|
||||
from google.protobuf import symbol_database as _symbol_database
|
||||
# @@protoc_insertion_point(imports)
|
||||
|
||||
_sym_db = _symbol_database.Default()
|
||||
|
||||
|
||||
|
||||
|
||||
DESCRIPTOR = _descriptor.FileDescriptor(
|
||||
name='imu.proto',
|
||||
package='',
|
||||
syntax='proto3',
|
||||
serialized_options=None,
|
||||
serialized_pb=_b('\n\timu.proto\":\n\x08IMU_Gyro\x12\x0e\n\x06Gyro_x\x18\x01 \x01(\x02\x12\x0e\n\x06Gyro_y\x18\x02 \x01(\x02\x12\x0e\n\x06Gyro_z\x18\x03 \x01(\x02\">\n\tIMU_Accel\x12\x0f\n\x07\x41\x63\x63\x65l_x\x18\x01 \x01(\x02\x12\x0f\n\x07\x41\x63\x63\x65l_y\x18\x02 \x01(\x02\x12\x0f\n\x07\x41\x63\x63\x65l_z\x18\x03 \x01(\x02\"Q\n\x0bIMU_message\x12\x1f\n\x0cIMU_Gyro_msg\x18\x01 \x01(\x0b\x32\t.IMU_Gyro\x12!\n\rIMU_Accel_msg\x18\x02 \x01(\x0b\x32\n.IMU_Accelb\x06proto3')
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
_IMU_GYRO = _descriptor.Descriptor(
|
||||
name='IMU_Gyro',
|
||||
full_name='IMU_Gyro',
|
||||
filename=None,
|
||||
file=DESCRIPTOR,
|
||||
containing_type=None,
|
||||
fields=[
|
||||
_descriptor.FieldDescriptor(
|
||||
name='Gyro_x', full_name='IMU_Gyro.Gyro_x', index=0,
|
||||
number=1, type=2, cpp_type=6, label=1,
|
||||
has_default_value=False, default_value=float(0),
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='Gyro_y', full_name='IMU_Gyro.Gyro_y', index=1,
|
||||
number=2, type=2, cpp_type=6, label=1,
|
||||
has_default_value=False, default_value=float(0),
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='Gyro_z', full_name='IMU_Gyro.Gyro_z', index=2,
|
||||
number=3, type=2, cpp_type=6, label=1,
|
||||
has_default_value=False, default_value=float(0),
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
],
|
||||
extensions=[
|
||||
],
|
||||
nested_types=[],
|
||||
enum_types=[
|
||||
],
|
||||
serialized_options=None,
|
||||
is_extendable=False,
|
||||
syntax='proto3',
|
||||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=13,
|
||||
serialized_end=71,
|
||||
)
|
||||
|
||||
|
||||
_IMU_ACCEL = _descriptor.Descriptor(
|
||||
name='IMU_Accel',
|
||||
full_name='IMU_Accel',
|
||||
filename=None,
|
||||
file=DESCRIPTOR,
|
||||
containing_type=None,
|
||||
fields=[
|
||||
_descriptor.FieldDescriptor(
|
||||
name='Accel_x', full_name='IMU_Accel.Accel_x', index=0,
|
||||
number=1, type=2, cpp_type=6, label=1,
|
||||
has_default_value=False, default_value=float(0),
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='Accel_y', full_name='IMU_Accel.Accel_y', index=1,
|
||||
number=2, type=2, cpp_type=6, label=1,
|
||||
has_default_value=False, default_value=float(0),
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='Accel_z', full_name='IMU_Accel.Accel_z', index=2,
|
||||
number=3, type=2, cpp_type=6, label=1,
|
||||
has_default_value=False, default_value=float(0),
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
],
|
||||
extensions=[
|
||||
],
|
||||
nested_types=[],
|
||||
enum_types=[
|
||||
],
|
||||
serialized_options=None,
|
||||
is_extendable=False,
|
||||
syntax='proto3',
|
||||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=73,
|
||||
serialized_end=135,
|
||||
)
|
||||
|
||||
|
||||
_IMU_MESSAGE = _descriptor.Descriptor(
|
||||
name='IMU_message',
|
||||
full_name='IMU_message',
|
||||
filename=None,
|
||||
file=DESCRIPTOR,
|
||||
containing_type=None,
|
||||
fields=[
|
||||
_descriptor.FieldDescriptor(
|
||||
name='IMU_Gyro_msg', full_name='IMU_message.IMU_Gyro_msg', index=0,
|
||||
number=1, type=11, cpp_type=10, label=1,
|
||||
has_default_value=False, default_value=None,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='IMU_Accel_msg', full_name='IMU_message.IMU_Accel_msg', index=1,
|
||||
number=2, type=11, cpp_type=10, label=1,
|
||||
has_default_value=False, default_value=None,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
],
|
||||
extensions=[
|
||||
],
|
||||
nested_types=[],
|
||||
enum_types=[
|
||||
],
|
||||
serialized_options=None,
|
||||
is_extendable=False,
|
||||
syntax='proto3',
|
||||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=137,
|
||||
serialized_end=218,
|
||||
)
|
||||
|
||||
_IMU_MESSAGE.fields_by_name['IMU_Gyro_msg'].message_type = _IMU_GYRO
|
||||
_IMU_MESSAGE.fields_by_name['IMU_Accel_msg'].message_type = _IMU_ACCEL
|
||||
DESCRIPTOR.message_types_by_name['IMU_Gyro'] = _IMU_GYRO
|
||||
DESCRIPTOR.message_types_by_name['IMU_Accel'] = _IMU_ACCEL
|
||||
DESCRIPTOR.message_types_by_name['IMU_message'] = _IMU_MESSAGE
|
||||
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
|
||||
|
||||
IMU_Gyro = _reflection.GeneratedProtocolMessageType('IMU_Gyro', (_message.Message,), dict(
|
||||
DESCRIPTOR = _IMU_GYRO,
|
||||
__module__ = 'imu_pb2'
|
||||
# @@protoc_insertion_point(class_scope:IMU_Gyro)
|
||||
))
|
||||
_sym_db.RegisterMessage(IMU_Gyro)
|
||||
|
||||
IMU_Accel = _reflection.GeneratedProtocolMessageType('IMU_Accel', (_message.Message,), dict(
|
||||
DESCRIPTOR = _IMU_ACCEL,
|
||||
__module__ = 'imu_pb2'
|
||||
# @@protoc_insertion_point(class_scope:IMU_Accel)
|
||||
))
|
||||
_sym_db.RegisterMessage(IMU_Accel)
|
||||
|
||||
IMU_message = _reflection.GeneratedProtocolMessageType('IMU_message', (_message.Message,), dict(
|
||||
DESCRIPTOR = _IMU_MESSAGE,
|
||||
__module__ = 'imu_pb2'
|
||||
# @@protoc_insertion_point(class_scope:IMU_message)
|
||||
))
|
||||
_sym_db.RegisterMessage(IMU_message)
|
||||
|
||||
|
||||
# @@protoc_insertion_point(module_scope)
|
||||
Executable
+12
@@ -0,0 +1,12 @@
|
||||
syntax = 'proto3';
|
||||
|
||||
|
||||
message ODOM {
|
||||
float ODOM_x = 1;
|
||||
float ODOM_y = 2;
|
||||
float ODOM_z = 3;
|
||||
}
|
||||
|
||||
message odem_message{
|
||||
ODOM odem_msg = 1;
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
# source: odom.proto
|
||||
|
||||
import sys
|
||||
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
|
||||
from google.protobuf import descriptor as _descriptor
|
||||
from google.protobuf import message as _message
|
||||
from google.protobuf import reflection as _reflection
|
||||
from google.protobuf import symbol_database as _symbol_database
|
||||
# @@protoc_insertion_point(imports)
|
||||
|
||||
_sym_db = _symbol_database.Default()
|
||||
|
||||
|
||||
|
||||
|
||||
DESCRIPTOR = _descriptor.FileDescriptor(
|
||||
name='odom.proto',
|
||||
package='',
|
||||
syntax='proto3',
|
||||
serialized_options=None,
|
||||
serialized_pb=_b('\n\nodom.proto\"6\n\x04ODOM\x12\x0e\n\x06ODOM_x\x18\x01 \x01(\x02\x12\x0e\n\x06ODOM_y\x18\x02 \x01(\x02\x12\x0e\n\x06ODOM_z\x18\x03 \x01(\x02\"\'\n\x0codem_message\x12\x17\n\x08odem_msg\x18\x01 \x01(\x0b\x32\x05.ODOMb\x06proto3')
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
_ODOM = _descriptor.Descriptor(
|
||||
name='ODOM',
|
||||
full_name='ODOM',
|
||||
filename=None,
|
||||
file=DESCRIPTOR,
|
||||
containing_type=None,
|
||||
fields=[
|
||||
_descriptor.FieldDescriptor(
|
||||
name='ODOM_x', full_name='ODOM.ODOM_x', index=0,
|
||||
number=1, type=2, cpp_type=6, label=1,
|
||||
has_default_value=False, default_value=float(0),
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='ODOM_y', full_name='ODOM.ODOM_y', index=1,
|
||||
number=2, type=2, cpp_type=6, label=1,
|
||||
has_default_value=False, default_value=float(0),
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='ODOM_z', full_name='ODOM.ODOM_z', index=2,
|
||||
number=3, type=2, cpp_type=6, label=1,
|
||||
has_default_value=False, default_value=float(0),
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
],
|
||||
extensions=[
|
||||
],
|
||||
nested_types=[],
|
||||
enum_types=[
|
||||
],
|
||||
serialized_options=None,
|
||||
is_extendable=False,
|
||||
syntax='proto3',
|
||||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=14,
|
||||
serialized_end=68,
|
||||
)
|
||||
|
||||
|
||||
_ODEM_MESSAGE = _descriptor.Descriptor(
|
||||
name='odem_message',
|
||||
full_name='odem_message',
|
||||
filename=None,
|
||||
file=DESCRIPTOR,
|
||||
containing_type=None,
|
||||
fields=[
|
||||
_descriptor.FieldDescriptor(
|
||||
name='odem_msg', full_name='odem_message.odem_msg', index=0,
|
||||
number=1, type=11, cpp_type=10, label=1,
|
||||
has_default_value=False, default_value=None,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
],
|
||||
extensions=[
|
||||
],
|
||||
nested_types=[],
|
||||
enum_types=[
|
||||
],
|
||||
serialized_options=None,
|
||||
is_extendable=False,
|
||||
syntax='proto3',
|
||||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=70,
|
||||
serialized_end=109,
|
||||
)
|
||||
|
||||
_ODEM_MESSAGE.fields_by_name['odem_msg'].message_type = _ODOM
|
||||
DESCRIPTOR.message_types_by_name['ODOM'] = _ODOM
|
||||
DESCRIPTOR.message_types_by_name['odem_message'] = _ODEM_MESSAGE
|
||||
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
|
||||
|
||||
ODOM = _reflection.GeneratedProtocolMessageType('ODOM', (_message.Message,), dict(
|
||||
DESCRIPTOR = _ODOM,
|
||||
__module__ = 'odom_pb2'
|
||||
# @@protoc_insertion_point(class_scope:ODOM)
|
||||
))
|
||||
_sym_db.RegisterMessage(ODOM)
|
||||
|
||||
odem_message = _reflection.GeneratedProtocolMessageType('odem_message', (_message.Message,), dict(
|
||||
DESCRIPTOR = _ODEM_MESSAGE,
|
||||
__module__ = 'odom_pb2'
|
||||
# @@protoc_insertion_point(class_scope:odem_message)
|
||||
))
|
||||
_sym_db.RegisterMessage(odem_message)
|
||||
|
||||
|
||||
# @@protoc_insertion_point(module_scope)
|
||||
@@ -0,0 +1,144 @@
|
||||
// Protocol Buffers - Google's data interchange format
|
||||
// Copyright 2008 Google Inc. All rights reserved.
|
||||
// https://developers.google.com/protocol-buffers/
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the names of its
|
||||
// contributors may be used to endorse or promote products derived from
|
||||
// this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
package google.protobuf;
|
||||
|
||||
// option cc_enable_arenas = true;
|
||||
// option go_package = "google.golang.org/protobuf/types/known/timestamppb";
|
||||
// option java_package = "com.google.protobuf";
|
||||
// option java_outer_classname = "TimestampProto";
|
||||
// option java_multiple_files = true;
|
||||
// option objc_class_prefix = "GPB";
|
||||
// option csharp_namespace = "Google.Protobuf.WellKnownTypes";
|
||||
|
||||
// A Timestamp represents a point in time independent of any time zone or local
|
||||
// calendar, encoded as a count of seconds and fractions of seconds at
|
||||
// nanosecond resolution. The count is relative to an epoch at UTC midnight on
|
||||
// January 1, 1970, in the proleptic Gregorian calendar which extends the
|
||||
// Gregorian calendar backwards to year one.
|
||||
//
|
||||
// All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
|
||||
// second table is needed for interpretation, using a [24-hour linear
|
||||
// smear](https://developers.google.com/time/smear).
|
||||
//
|
||||
// The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
|
||||
// restricting to that range, we ensure that we can convert to and from [RFC
|
||||
// 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
|
||||
//
|
||||
// # Examples
|
||||
//
|
||||
// Example 1: Compute Timestamp from POSIX `time()`.
|
||||
//
|
||||
// Timestamp timestamp;
|
||||
// timestamp.set_seconds(time(NULL));
|
||||
// timestamp.set_nanos(0);
|
||||
//
|
||||
// Example 2: Compute Timestamp from POSIX `gettimeofday()`.
|
||||
//
|
||||
// struct timeval tv;
|
||||
// gettimeofday(&tv, NULL);
|
||||
//
|
||||
// Timestamp timestamp;
|
||||
// timestamp.set_seconds(tv.tv_sec);
|
||||
// timestamp.set_nanos(tv.tv_usec * 1000);
|
||||
//
|
||||
// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
|
||||
//
|
||||
// FILETIME ft;
|
||||
// GetSystemTimeAsFileTime(&ft);
|
||||
// UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
|
||||
//
|
||||
// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
|
||||
// // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
|
||||
// Timestamp timestamp;
|
||||
// timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
|
||||
// timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
|
||||
//
|
||||
// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
|
||||
//
|
||||
// long millis = System.currentTimeMillis();
|
||||
//
|
||||
// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
|
||||
// .setNanos((int) ((millis % 1000) * 1000000)).build();
|
||||
//
|
||||
// Example 5: Compute Timestamp from Java `Instant.now()`.
|
||||
//
|
||||
// Instant now = Instant.now();
|
||||
//
|
||||
// Timestamp timestamp =
|
||||
// Timestamp.newBuilder().setSeconds(now.getEpochSecond())
|
||||
// .setNanos(now.getNano()).build();
|
||||
//
|
||||
// Example 6: Compute Timestamp from current time in Python.
|
||||
//
|
||||
// timestamp = Timestamp()
|
||||
// timestamp.GetCurrentTime()
|
||||
//
|
||||
// # JSON Mapping
|
||||
//
|
||||
// In JSON format, the Timestamp type is encoded as a string in the
|
||||
// [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
|
||||
// format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
|
||||
// where {year} is always expressed using four digits while {month}, {day},
|
||||
// {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
|
||||
// seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
|
||||
// are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
|
||||
// is required. A proto3 JSON serializer should always use UTC (as indicated by
|
||||
// "Z") when printing the Timestamp type and a proto3 JSON parser should be
|
||||
// able to accept both UTC and other timezones (as indicated by an offset).
|
||||
//
|
||||
// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
|
||||
// 01:30 UTC on January 15, 2017.
|
||||
//
|
||||
// In JavaScript, one can convert a Date object to this format using the
|
||||
// standard
|
||||
// [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
|
||||
// method. In Python, a standard `datetime.datetime` object can be converted
|
||||
// to this format using
|
||||
// [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
|
||||
// the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
|
||||
// the Joda Time's [`ISODateTimeFormat.dateTime()`](
|
||||
// http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
|
||||
// ) to obtain a formatter capable of generating timestamps in this format.
|
||||
//
|
||||
message Timestamp {
|
||||
// Represents seconds of UTC time since Unix epoch
|
||||
// 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
|
||||
// 9999-12-31T23:59:59Z inclusive.
|
||||
int64 seconds = 1;
|
||||
|
||||
// Non-negative fractions of a second at nanosecond resolution. Negative
|
||||
// second values with fractions must still have non-negative nanos values
|
||||
// that count forward in time. Must be from 0 to 999,999,999
|
||||
// inclusive.
|
||||
int32 nanos = 2;
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
# source: timestamp.proto
|
||||
|
||||
import sys
|
||||
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
|
||||
from google.protobuf import descriptor as _descriptor
|
||||
from google.protobuf import message as _message
|
||||
from google.protobuf import reflection as _reflection
|
||||
from google.protobuf import symbol_database as _symbol_database
|
||||
# @@protoc_insertion_point(imports)
|
||||
|
||||
_sym_db = _symbol_database.Default()
|
||||
|
||||
|
||||
|
||||
|
||||
DESCRIPTOR = _descriptor.FileDescriptor(
|
||||
name='timestamp.proto',
|
||||
package='google.protobuf',
|
||||
syntax='proto3',
|
||||
serialized_options=None,
|
||||
serialized_pb=_b('\n\x0ftimestamp.proto\x12\x0fgoogle.protobuf\"+\n\tTimestamp\x12\x0f\n\x07seconds\x18\x01 \x01(\x03\x12\r\n\x05nanos\x18\x02 \x01(\x05\x62\x06proto3')
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
_TIMESTAMP = _descriptor.Descriptor(
|
||||
name='Timestamp',
|
||||
full_name='google.protobuf.Timestamp',
|
||||
filename=None,
|
||||
file=DESCRIPTOR,
|
||||
containing_type=None,
|
||||
fields=[
|
||||
_descriptor.FieldDescriptor(
|
||||
name='seconds', full_name='google.protobuf.Timestamp.seconds', index=0,
|
||||
number=1, type=3, cpp_type=2, label=1,
|
||||
has_default_value=False, default_value=0,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='nanos', full_name='google.protobuf.Timestamp.nanos', index=1,
|
||||
number=2, type=5, cpp_type=1, label=1,
|
||||
has_default_value=False, default_value=0,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
],
|
||||
extensions=[
|
||||
],
|
||||
nested_types=[],
|
||||
enum_types=[
|
||||
],
|
||||
serialized_options=None,
|
||||
is_extendable=False,
|
||||
syntax='proto3',
|
||||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=36,
|
||||
serialized_end=79,
|
||||
)
|
||||
|
||||
DESCRIPTOR.message_types_by_name['Timestamp'] = _TIMESTAMP
|
||||
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
|
||||
|
||||
Timestamp = _reflection.GeneratedProtocolMessageType('Timestamp', (_message.Message,), dict(
|
||||
DESCRIPTOR = _TIMESTAMP,
|
||||
__module__ = 'timestamp_pb2'
|
||||
# @@protoc_insertion_point(class_scope:google.protobuf.Timestamp)
|
||||
))
|
||||
_sym_db.RegisterMessage(Timestamp)
|
||||
|
||||
|
||||
# @@protoc_insertion_point(module_scope)
|
||||
@@ -0,0 +1,92 @@
|
||||
import proto.flyformatioln_pb2 as flyformatioln_pb2
|
||||
import proto.flight_information_pb2 as flight_information_pb2
|
||||
import proto.imu_pb2 as imu_pb2
|
||||
import proto.odom_pb2 as odom_pb2
|
||||
import proto.duration_pb2 as duration_pb2
|
||||
import proto.flymode_pb2 as flymode_pb2
|
||||
import proto.timestamp_pb2 as timestamp_pb2
|
||||
import google.protobuf.json_format as json_format
|
||||
|
||||
|
||||
class protoMsgWrapper:
|
||||
|
||||
@staticmethod
|
||||
def flight_information(serialized=False, tojson=False):
|
||||
flight_information_msg = flight_information_pb2.flight_information_message()
|
||||
flight_information_msg.gps.LAT = 34123.1231515
|
||||
flight_information_msg.gps.LON = 23423.1231515
|
||||
flight_information_msg.gps.ALT = 12123.1231515
|
||||
flight_information_msg.heading = 155.12215
|
||||
if serialized:
|
||||
return flight_information_msg.SerializeToString()
|
||||
if tojson:
|
||||
return json_format.MessageToJson(flight_information_msg, indent=None, preserving_proto_field_name=True)
|
||||
return flight_information_msg
|
||||
|
||||
@staticmethod
|
||||
def fly_formation(serialized=False, tojson=False):
|
||||
fly_formation_msg = flyformatioln_pb2.fly_formation_message()
|
||||
fly_formation_msg.velocity = 128
|
||||
fly_formation_msg.fly_formation = flyformatioln_pb2.FLY_FORMATION_v
|
||||
if serialized:
|
||||
return fly_formation_msg.SerializeToString()
|
||||
if tojson:
|
||||
return json_format.MessageToJson(fly_formation_msg, indent=None, preserving_proto_field_name=True)
|
||||
return fly_formation_msg
|
||||
|
||||
@staticmethod
|
||||
def imu_information(serialized=False, tojson=False):
|
||||
imu_information_msg = imu_pb2.IMU_message()
|
||||
imu_information_msg.IMU_Gyro_msg.Gyro_x = 1.0
|
||||
imu_information_msg.IMU_Gyro_msg.Gyro_y = 2.0
|
||||
imu_information_msg.IMU_Gyro_msg.Gyro_z = 3.0
|
||||
imu_information_msg.IMU_Accel_msg.Accel_x = 4.0
|
||||
imu_information_msg.IMU_Accel_msg.Accel_y = 5.0
|
||||
imu_information_msg.IMU_Accel_msg.Accel_z = 6.0
|
||||
if serialized:
|
||||
return imu_information_msg.SerializeToString()
|
||||
if tojson:
|
||||
return json_format.MessageToJson(imu_information_msg, indent=None, preserving_proto_field_name=True)
|
||||
return imu_information_msg
|
||||
|
||||
@staticmethod
|
||||
def odom_information(serialized=False, tojson=False):
|
||||
odom_information_msg = odom_pb2.odem_message()
|
||||
odom_information_msg.odem_msg.ODOM_x = 1.0
|
||||
odom_information_msg.odem_msg.ODOM_y = 2.0
|
||||
odom_information_msg.odem_msg.ODOM_z = 3.0
|
||||
if serialized:
|
||||
return odom_information_msg.SerializeToString()
|
||||
if tojson:
|
||||
return json_format.MessageToJson(odom_information_msg, indent=None, preserving_proto_field_name=True)
|
||||
return odom_information_msg
|
||||
|
||||
@staticmethod
|
||||
def flymode_information(serialized=False, tojson=False):
|
||||
flymode_information_msg = flymode_pb2.flymode_message()
|
||||
flymode_information_msg.fly_mode_msg = flymode_pb2.FLY_MODE_STABILIZE
|
||||
if serialized:
|
||||
return flymode_information_msg.SerializeToString()
|
||||
if tojson:
|
||||
return json_format.MessageToJson(flymode_information_msg, indent=None, preserving_proto_field_name=True)
|
||||
return flymode_information_msg
|
||||
|
||||
@staticmethod
|
||||
def duration_information(serialized=False, tojson=False):
|
||||
duration_information_msg = duration_pb2.Duration()
|
||||
duration_information_msg.FromNanoseconds(1000000)
|
||||
if serialized:
|
||||
return duration_information_msg.SerializeToString()
|
||||
if tojson:
|
||||
return json_format.MessageToJson(duration_information_msg, indent=None, preserving_proto_field_name=True)
|
||||
return duration_information_msg
|
||||
|
||||
@staticmethod
|
||||
def timestamp_information(serialized=False, tojson=False):
|
||||
timestamp_meg = timestamp_pb2.Timestamp()
|
||||
timestamp_meg.GetCurrentTime()
|
||||
if serialized:
|
||||
return timestamp_meg.SerializeToString()
|
||||
if tojson:
|
||||
return json_format.MessageToJson(timestamp_meg, indent=None, preserving_proto_field_name=True)
|
||||
return timestamp_meg
|
||||
@@ -0,0 +1,69 @@
|
||||
import os
|
||||
from protoMsg import protoMsgWrapper
|
||||
import copy
|
||||
import orjson
|
||||
|
||||
def file(message, path, json=False, serial=False):
|
||||
path = "JsonProtosize/" + path
|
||||
if serial:
|
||||
with open(path+".bin", "wb") as f:
|
||||
f.write(message)
|
||||
elif json:
|
||||
with open(path, "w") as f:
|
||||
f.write(message)
|
||||
|
||||
def proto_msg():
|
||||
flight_info_message = protoMsgWrapper.flight_information(serialized = True)
|
||||
fly_format_message = protoMsgWrapper.fly_formation(serialized = True)
|
||||
imu_info_message = protoMsgWrapper.imu_information(serialized = True)
|
||||
odom_info_message = protoMsgWrapper.odom_information(serialized = True)
|
||||
flymode_info_message = protoMsgWrapper.flymode_information(serialized = True)
|
||||
duration_info_message = protoMsgWrapper.duration_information(serialized = True)
|
||||
timestamp_info_message = protoMsgWrapper.timestamp_information(serialized = True)
|
||||
serial = [flight_info_message, fly_format_message, imu_info_message, odom_info_message, flymode_info_message, duration_info_message, timestamp_info_message]
|
||||
for message in serial:
|
||||
file(message, serial_name[serial.index(message)], serial=True)
|
||||
|
||||
def json_msg():
|
||||
flight_info_message = protoMsgWrapper.flight_information(tojson = True)
|
||||
fly_format_message = protoMsgWrapper.fly_formation(tojson = True)
|
||||
imu_info_message = protoMsgWrapper.imu_information(tojson = True)
|
||||
odom_info_message = protoMsgWrapper.odom_information(tojson = True)
|
||||
flymode_info_message = protoMsgWrapper.flymode_information(tojson = True)
|
||||
duration_info_message = protoMsgWrapper.duration_information(tojson = True)
|
||||
timestamp_info_message = protoMsgWrapper.timestamp_information(tojson = True)
|
||||
js = [flight_info_message, fly_format_message, imu_info_message, odom_info_message, flymode_info_message, duration_info_message, timestamp_info_message]
|
||||
|
||||
for message in js:
|
||||
file(message, serial_name[js.index(message)], json=True)
|
||||
|
||||
def toFile(fileName:str, compare_size:dict):
|
||||
with open(fileName, "w+") as f:
|
||||
f.write(orjson.dumps(compare_size).decode("UTF-8"))
|
||||
|
||||
if __name__=='__main__':
|
||||
serial_name = ["flight_info_message", "fly_format_message", "imu_info_message", "odom_info_message", "flymode_info_message", "duration_info_message", "timestamp_info_message"]
|
||||
proto_msg()
|
||||
json_msg()
|
||||
serlizl_size = 0
|
||||
json_size = 0
|
||||
compare_size_prototype = {"json":None, "proto":None}
|
||||
compare_size = dict((name, copy.deepcopy(compare_size_prototype))for name in serial_name)
|
||||
files = sorted(os.listdir("JsonProtosize"))
|
||||
for file in files:
|
||||
size = os.path.getsize("JsonProtosize/"+file)
|
||||
|
||||
if file.endswith(".bin"):
|
||||
name = file.replace(".bin", "")
|
||||
compare_size[name]["proto"] = size
|
||||
serlizl_size += size
|
||||
else:
|
||||
compare_size[file]["json"] = size
|
||||
json_size += size
|
||||
|
||||
compare_size["Total"] = {"json":json_size, "proto":serlizl_size}
|
||||
print(compare_size)
|
||||
print("json - serial = ", json_size - serlizl_size)
|
||||
fileName = "Data/sizeData"
|
||||
toFile(fileName, compare_size)
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
import proto.flyformatioln_pb2 as flyformatioln_pb2
|
||||
import proto.flight_information_pb2 as flight_information_pb2
|
||||
import google.protobuf.json_format as json_format
|
||||
import timeit
|
||||
import orjson
|
||||
|
||||
a = '{"gps": {"LAT": 34123.125, "LON": 23423.123, "ALT": 12123.123}, "heading": 155.12215}'
|
||||
data ={}
|
||||
|
||||
flight_information_msg = flight_information_pb2.flight_information_message()
|
||||
flight_information_msg.gps.LAT = 34123.1231515
|
||||
flight_information_msg.gps.LON = 23423.1231515
|
||||
flight_information_msg.gps.ALT = 12123.1231515
|
||||
flight_information_msg.heading = 155.12215
|
||||
proto_deserialize_msg = flight_information_msg.SerializeToString()
|
||||
|
||||
|
||||
|
||||
def proto_serialize():
|
||||
proto_deserialize_msg = flight_information_msg.SerializeToString()
|
||||
|
||||
|
||||
def proto_deserialize(proto):
|
||||
proto_msg = flight_information_msg.FromString(proto)
|
||||
# js = json_format.MessageToJson(proto_msg, indent=None, preserving_proto_field_name=True)
|
||||
|
||||
def json_serialize(lib):
|
||||
js = lib.dumps(a).decode("utf-8")
|
||||
# print(js)
|
||||
|
||||
def json_deserialize(lib):
|
||||
js = lib.loads(a)
|
||||
# print(js)
|
||||
|
||||
def toFile(fileName:str, compare_time:dict):
|
||||
with open(fileName, "w+") as f:
|
||||
f.write(orjson.dumps(compare_time).decode("UTF-8"))
|
||||
|
||||
|
||||
if __name__=='__main__':
|
||||
proto_serialize_time = timeit.timeit(lambda: proto_serialize(), number = 1000000)
|
||||
proto_deserialize_time = timeit.timeit(lambda: proto_deserialize(proto_deserialize_msg), number = 1000000)
|
||||
json_serialize_time = timeit.timeit(lambda: json_serialize(orjson), number = 1000000)
|
||||
json_deserialize_time = timeit.timeit(lambda: json_deserialize(orjson), number = 1000000)
|
||||
time_dict = {"serialize": {"json": json_serialize_time, "proto":proto_serialize_time}, "deserializ":{"json": json_deserialize_time, "proto":proto_deserialize_time}}
|
||||
print(f"proto_serialize_time: {proto_serialize_time}")
|
||||
print(f"json_serialize_time: {json_serialize_time}\n")
|
||||
print(f"proto_deserialize_time: {proto_deserialize_time}")
|
||||
print(f"json_deserialize_time: {json_deserialize_time}")
|
||||
fileName = "Data/timeData"
|
||||
toFile(fileName, time_dict)
|
||||
Reference in New Issue
Block a user