diff --git a/lib/protobuf-mission-module/MissionModule.pb.cc b/lib/protobuf-mission-module/MissionModule.pb.cc index c406713..d39b497 100644 --- a/lib/protobuf-mission-module/MissionModule.pb.cc +++ b/lib/protobuf-mission-module/MissionModule.pb.cc @@ -1,5 +1,5 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: modules/MissionModule.proto +// source: MissionModule.proto #include "MissionModule.pb.h" @@ -55,7 +55,6 @@ PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORIT PROTOBUF_CONSTEXPR AutonomyCommand::AutonomyCommand( ::_pbi::ConstantInitialized): _impl_{ /*decltype(_impl_.stops_)*/{} - , /*decltype(_impl_.routestations_)*/{} , /*decltype(_impl_.route_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} , /*decltype(_impl_.action_)*/0 , /*decltype(_impl_._cached_size_)*/{}} {} @@ -111,11 +110,11 @@ struct PositionDefaultTypeInternal { }; PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PositionDefaultTypeInternal _Position_default_instance_; } // namespace MissionModule -static ::_pb::Metadata file_level_metadata_modules_2fMissionModule_2eproto[6]; -static const ::_pb::EnumDescriptor* file_level_enum_descriptors_modules_2fMissionModule_2eproto[2]; -static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_modules_2fMissionModule_2eproto = nullptr; +static ::_pb::Metadata file_level_metadata_MissionModule_2eproto[6]; +static const ::_pb::EnumDescriptor* file_level_enum_descriptors_MissionModule_2eproto[2]; +static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_MissionModule_2eproto = nullptr; -const uint32_t TableStruct_modules_2fMissionModule_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { +const uint32_t TableStruct_MissionModule_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::MissionModule::AutonomyStatus_Telemetry, _internal_metadata_), ~0u, // no _extensions_ @@ -146,7 +145,6 @@ const uint32_t TableStruct_modules_2fMissionModule_2eproto::offsets[] PROTOBUF_S PROTOBUF_FIELD_OFFSET(::MissionModule::AutonomyCommand, _impl_.stops_), PROTOBUF_FIELD_OFFSET(::MissionModule::AutonomyCommand, _impl_.route_), PROTOBUF_FIELD_OFFSET(::MissionModule::AutonomyCommand, _impl_.action_), - PROTOBUF_FIELD_OFFSET(::MissionModule::AutonomyCommand, _impl_.routestations_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::MissionModule::AutonomyError, _internal_metadata_), ~0u, // no _extensions_ @@ -176,9 +174,9 @@ static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protode { 0, -1, -1, sizeof(::MissionModule::AutonomyStatus_Telemetry)}, { 9, 18, -1, sizeof(::MissionModule::AutonomyStatus)}, { 21, -1, -1, sizeof(::MissionModule::AutonomyCommand)}, - { 31, -1, -1, sizeof(::MissionModule::AutonomyError)}, - { 38, -1, -1, sizeof(::MissionModule::Station)}, - { 46, -1, -1, sizeof(::MissionModule::Position)}, + { 30, -1, -1, sizeof(::MissionModule::AutonomyError)}, + { 37, -1, -1, sizeof(::MissionModule::Station)}, + { 45, -1, -1, sizeof(::MissionModule::Position)}, }; static const ::_pb::Message* const file_default_instances[] = { @@ -190,50 +188,48 @@ static const ::_pb::Message* const file_default_instances[] = { &::MissionModule::_Position_default_instance_._instance, }; -const char descriptor_table_protodef_modules_2fMissionModule_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = - "\n\033modules/MissionModule.proto\022\rMissionMo" - "dule\"\325\002\n\016AutonomyStatus\022:\n\ttelemetry\030\001 \001" - "(\0132\'.MissionModule.AutonomyStatus.Teleme" - "try\0222\n\005state\030\002 \001(\0162#.MissionModule.Auton" - "omyStatus.State\022-\n\010nextStop\030\003 \001(\0132\026.Miss" - "ionModule.StationH\000\210\001\001\032S\n\tTelemetry\022\r\n\005s" - "peed\030\001 \001(\001\022\014\n\004fuel\030\002 \001(\001\022)\n\010position\030\003 \001" - "(\0132\027.MissionModule.Position\"B\n\005State\022\010\n\004" - "IDLE\020\000\022\t\n\005DRIVE\020\001\022\013\n\007IN_STOP\020\002\022\014\n\010OBSTAC" - "LE\020\003\022\t\n\005ERROR\020\004B\013\n\t_nextStop\"\333\001\n\017Autonom" - "yCommand\022%\n\005stops\030\001 \003(\0132\026.MissionModule." - "Station\022\r\n\005route\030\002 \001(\t\0225\n\006action\030\003 \001(\0162%" - ".MissionModule.AutonomyCommand.Action\022-\n" - "\rrouteStations\030\004 \003(\0132\026.MissionModule.Sta" - "tion\",\n\006Action\022\r\n\tNO_ACTION\020\000\022\010\n\004STOP\020\001\022" - "\t\n\005START\020\002\">\n\rAutonomyError\022-\n\rfinishedS" - "tops\030\001 \003(\0132\026.MissionModule.Station\"B\n\007St" - "ation\022\014\n\004name\030\001 \001(\t\022)\n\010position\030\002 \001(\0132\027." - "MissionModule.Position\"A\n\010Position\022\020\n\010la" - "titude\030\001 \001(\001\022\021\n\tlongitude\030\002 \001(\001\022\020\n\010altit" - "ude\030\003 \001(\001B>Z!../internal/pkg/ba_proto;ba" - "_proto\252\002\030Google.Protobuf.ba_protob\006proto" - "3" +const char descriptor_table_protodef_MissionModule_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = + "\n\023MissionModule.proto\022\rMissionModule\"\325\002\n" + "\016AutonomyStatus\022:\n\ttelemetry\030\001 \001(\0132\'.Mis" + "sionModule.AutonomyStatus.Telemetry\0222\n\005s" + "tate\030\002 \001(\0162#.MissionModule.AutonomyStatu" + "s.State\022-\n\010nextStop\030\003 \001(\0132\026.MissionModul" + "e.StationH\000\210\001\001\032S\n\tTelemetry\022\r\n\005speed\030\001 \001" + "(\001\022\014\n\004fuel\030\002 \001(\001\022)\n\010position\030\003 \001(\0132\027.Mis" + "sionModule.Position\"B\n\005State\022\010\n\004IDLE\020\000\022\t" + "\n\005DRIVE\020\001\022\013\n\007IN_STOP\020\002\022\014\n\010OBSTACLE\020\003\022\t\n\005" + "ERROR\020\004B\013\n\t_nextStop\"\254\001\n\017AutonomyCommand" + "\022%\n\005stops\030\001 \003(\0132\026.MissionModule.Station\022" + "\r\n\005route\030\002 \001(\t\0225\n\006action\030\003 \001(\0162%.Mission" + "Module.AutonomyCommand.Action\",\n\006Action\022" + "\r\n\tNO_ACTION\020\000\022\010\n\004STOP\020\001\022\t\n\005START\020\002\">\n\rA" + "utonomyError\022-\n\rfinishedStops\030\001 \003(\0132\026.Mi" + "ssionModule.Station\"B\n\007Station\022\014\n\004name\030\001" + " \001(\t\022)\n\010position\030\002 \001(\0132\027.MissionModule.P" + "osition\"A\n\010Position\022\020\n\010latitude\030\001 \001(\001\022\021\n" + "\tlongitude\030\002 \001(\001\022\020\n\010altitude\030\003 \001(\001B>Z!.." + "/internal/pkg/ba_proto;ba_proto\252\002\030Google" + ".Protobuf.ba_protob\006proto3" ; -static ::_pbi::once_flag descriptor_table_modules_2fMissionModule_2eproto_once; -const ::_pbi::DescriptorTable descriptor_table_modules_2fMissionModule_2eproto = { - false, false, 881, descriptor_table_protodef_modules_2fMissionModule_2eproto, - "modules/MissionModule.proto", - &descriptor_table_modules_2fMissionModule_2eproto_once, nullptr, 0, 6, - schemas, file_default_instances, TableStruct_modules_2fMissionModule_2eproto::offsets, - file_level_metadata_modules_2fMissionModule_2eproto, file_level_enum_descriptors_modules_2fMissionModule_2eproto, - file_level_service_descriptors_modules_2fMissionModule_2eproto, +static ::_pbi::once_flag descriptor_table_MissionModule_2eproto_once; +const ::_pbi::DescriptorTable descriptor_table_MissionModule_2eproto = { + false, false, 826, descriptor_table_protodef_MissionModule_2eproto, + "MissionModule.proto", + &descriptor_table_MissionModule_2eproto_once, nullptr, 0, 6, + schemas, file_default_instances, TableStruct_MissionModule_2eproto::offsets, + file_level_metadata_MissionModule_2eproto, file_level_enum_descriptors_MissionModule_2eproto, + file_level_service_descriptors_MissionModule_2eproto, }; -PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_modules_2fMissionModule_2eproto_getter() { - return &descriptor_table_modules_2fMissionModule_2eproto; +PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_MissionModule_2eproto_getter() { + return &descriptor_table_MissionModule_2eproto; } // Force running AddDescriptors() at dynamic initialization time. -PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_modules_2fMissionModule_2eproto(&descriptor_table_modules_2fMissionModule_2eproto); +PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_MissionModule_2eproto(&descriptor_table_MissionModule_2eproto); namespace MissionModule { const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* AutonomyStatus_State_descriptor() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_modules_2fMissionModule_2eproto); - return file_level_enum_descriptors_modules_2fMissionModule_2eproto[0]; + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_MissionModule_2eproto); + return file_level_enum_descriptors_MissionModule_2eproto[0]; } bool AutonomyStatus_State_IsValid(int value) { switch (value) { @@ -259,8 +255,8 @@ constexpr AutonomyStatus_State AutonomyStatus::State_MAX; constexpr int AutonomyStatus::State_ARRAYSIZE; #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* AutonomyCommand_Action_descriptor() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_modules_2fMissionModule_2eproto); - return file_level_enum_descriptors_modules_2fMissionModule_2eproto[1]; + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_MissionModule_2eproto); + return file_level_enum_descriptors_MissionModule_2eproto[1]; } bool AutonomyCommand_Action_IsValid(int value) { switch (value) { @@ -554,8 +550,8 @@ void AutonomyStatus_Telemetry::InternalSwap(AutonomyStatus_Telemetry* other) { ::PROTOBUF_NAMESPACE_ID::Metadata AutonomyStatus_Telemetry::GetMetadata() const { return ::_pbi::AssignDescriptors( - &descriptor_table_modules_2fMissionModule_2eproto_getter, &descriptor_table_modules_2fMissionModule_2eproto_once, - file_level_metadata_modules_2fMissionModule_2eproto[0]); + &descriptor_table_MissionModule_2eproto_getter, &descriptor_table_MissionModule_2eproto_once, + file_level_metadata_MissionModule_2eproto[0]); } // =================================================================== @@ -834,8 +830,8 @@ void AutonomyStatus::InternalSwap(AutonomyStatus* other) { ::PROTOBUF_NAMESPACE_ID::Metadata AutonomyStatus::GetMetadata() const { return ::_pbi::AssignDescriptors( - &descriptor_table_modules_2fMissionModule_2eproto_getter, &descriptor_table_modules_2fMissionModule_2eproto_once, - file_level_metadata_modules_2fMissionModule_2eproto[1]); + &descriptor_table_MissionModule_2eproto_getter, &descriptor_table_MissionModule_2eproto_once, + file_level_metadata_MissionModule_2eproto[1]); } // =================================================================== @@ -855,7 +851,6 @@ AutonomyCommand::AutonomyCommand(const AutonomyCommand& from) AutonomyCommand* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_.stops_){from._impl_.stops_} - , decltype(_impl_.routestations_){from._impl_.routestations_} , decltype(_impl_.route_){} , decltype(_impl_.action_){} , /*decltype(_impl_._cached_size_)*/{}}; @@ -879,7 +874,6 @@ inline void AutonomyCommand::SharedCtor( (void)is_message_owned; new (&_impl_) Impl_{ decltype(_impl_.stops_){arena} - , decltype(_impl_.routestations_){arena} , decltype(_impl_.route_){} , decltype(_impl_.action_){0} , /*decltype(_impl_._cached_size_)*/{} @@ -902,7 +896,6 @@ AutonomyCommand::~AutonomyCommand() { inline void AutonomyCommand::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); _impl_.stops_.~RepeatedPtrField(); - _impl_.routestations_.~RepeatedPtrField(); _impl_.route_.Destroy(); } @@ -917,7 +910,6 @@ void AutonomyCommand::Clear() { (void) cached_has_bits; _impl_.stops_.Clear(); - _impl_.routestations_.Clear(); _impl_.route_.ClearToEmpty(); _impl_.action_ = 0; _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); @@ -961,19 +953,6 @@ const char* AutonomyCommand::_InternalParse(const char* ptr, ::_pbi::ParseContex } else goto handle_unusual; continue; - // repeated .MissionModule.Station routeStations = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(_internal_add_routestations(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr)); - } else - goto handle_unusual; - continue; default: goto handle_unusual; } // switch @@ -1028,14 +1007,6 @@ uint8_t* AutonomyCommand::_InternalSerialize( 3, this->_internal_action(), target); } - // repeated .MissionModule.Station routeStations = 4; - for (unsigned i = 0, - n = static_cast(this->_internal_routestations_size()); i < n; i++) { - const auto& repfield = this->_internal_routestations(i); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(4, repfield, repfield.GetCachedSize(), target, stream); - } - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); @@ -1059,13 +1030,6 @@ size_t AutonomyCommand::ByteSizeLong() const { ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); } - // repeated .MissionModule.Station routeStations = 4; - total_size += 1UL * this->_internal_routestations_size(); - for (const auto& msg : this->_impl_.routestations_) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); - } - // string route = 2; if (!this->_internal_route().empty()) { total_size += 1 + @@ -1098,7 +1062,6 @@ void AutonomyCommand::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const (void) cached_has_bits; _this->_impl_.stops_.MergeFrom(from._impl_.stops_); - _this->_impl_.routestations_.MergeFrom(from._impl_.routestations_); if (!from._internal_route().empty()) { _this->_internal_set_route(from._internal_route()); } @@ -1125,7 +1088,6 @@ void AutonomyCommand::InternalSwap(AutonomyCommand* other) { auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); _impl_.stops_.InternalSwap(&other->_impl_.stops_); - _impl_.routestations_.InternalSwap(&other->_impl_.routestations_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( &_impl_.route_, lhs_arena, &other->_impl_.route_, rhs_arena @@ -1135,8 +1097,8 @@ void AutonomyCommand::InternalSwap(AutonomyCommand* other) { ::PROTOBUF_NAMESPACE_ID::Metadata AutonomyCommand::GetMetadata() const { return ::_pbi::AssignDescriptors( - &descriptor_table_modules_2fMissionModule_2eproto_getter, &descriptor_table_modules_2fMissionModule_2eproto_once, - file_level_metadata_modules_2fMissionModule_2eproto[2]); + &descriptor_table_MissionModule_2eproto_getter, &descriptor_table_MissionModule_2eproto_once, + file_level_metadata_MissionModule_2eproto[2]); } // =================================================================== @@ -1320,8 +1282,8 @@ void AutonomyError::InternalSwap(AutonomyError* other) { ::PROTOBUF_NAMESPACE_ID::Metadata AutonomyError::GetMetadata() const { return ::_pbi::AssignDescriptors( - &descriptor_table_modules_2fMissionModule_2eproto_getter, &descriptor_table_modules_2fMissionModule_2eproto_once, - file_level_metadata_modules_2fMissionModule_2eproto[3]); + &descriptor_table_MissionModule_2eproto_getter, &descriptor_table_MissionModule_2eproto_once, + file_level_metadata_MissionModule_2eproto[3]); } // =================================================================== @@ -1565,8 +1527,8 @@ void Station::InternalSwap(Station* other) { ::PROTOBUF_NAMESPACE_ID::Metadata Station::GetMetadata() const { return ::_pbi::AssignDescriptors( - &descriptor_table_modules_2fMissionModule_2eproto_getter, &descriptor_table_modules_2fMissionModule_2eproto_once, - file_level_metadata_modules_2fMissionModule_2eproto[4]); + &descriptor_table_MissionModule_2eproto_getter, &descriptor_table_MissionModule_2eproto_once, + file_level_metadata_MissionModule_2eproto[4]); } // =================================================================== @@ -1836,8 +1798,8 @@ void Position::InternalSwap(Position* other) { ::PROTOBUF_NAMESPACE_ID::Metadata Position::GetMetadata() const { return ::_pbi::AssignDescriptors( - &descriptor_table_modules_2fMissionModule_2eproto_getter, &descriptor_table_modules_2fMissionModule_2eproto_once, - file_level_metadata_modules_2fMissionModule_2eproto[5]); + &descriptor_table_MissionModule_2eproto_getter, &descriptor_table_MissionModule_2eproto_once, + file_level_metadata_MissionModule_2eproto[5]); } // @@protoc_insertion_point(namespace_scope) diff --git a/lib/protobuf-mission-module/MissionModule.pb.h b/lib/protobuf-mission-module/MissionModule.pb.h index 5e09033..4bf4f4e 100644 --- a/lib/protobuf-mission-module/MissionModule.pb.h +++ b/lib/protobuf-mission-module/MissionModule.pb.h @@ -1,8 +1,8 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: modules/MissionModule.proto +// source: MissionModule.proto -#ifndef GOOGLE_PROTOBUF_INCLUDED_modules_2fMissionModule_2eproto -#define GOOGLE_PROTOBUF_INCLUDED_modules_2fMissionModule_2eproto +#ifndef GOOGLE_PROTOBUF_INCLUDED_MissionModule_2eproto +#define GOOGLE_PROTOBUF_INCLUDED_MissionModule_2eproto #include #include @@ -33,7 +33,7 @@ #include // @@protoc_insertion_point(includes) #include -#define PROTOBUF_INTERNAL_EXPORT_modules_2fMissionModule_2eproto +#define PROTOBUF_INTERNAL_EXPORT_MissionModule_2eproto PROTOBUF_NAMESPACE_OPEN namespace internal { class AnyMetadata; @@ -41,10 +41,10 @@ class AnyMetadata; PROTOBUF_NAMESPACE_CLOSE // Internal implementation detail -- do not use these members. -struct TableStruct_modules_2fMissionModule_2eproto { +struct TableStruct_MissionModule_2eproto { static const uint32_t offsets[]; }; -extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_modules_2fMissionModule_2eproto; +extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_MissionModule_2eproto; namespace MissionModule { class AutonomyCommand; struct AutonomyCommandDefaultTypeInternal; @@ -306,7 +306,7 @@ class AutonomyStatus_Telemetry final : mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; }; union { Impl_ _impl_; }; - friend struct ::TableStruct_modules_2fMissionModule_2eproto; + friend struct ::TableStruct_MissionModule_2eproto; }; // ------------------------------------------------------------------- @@ -533,7 +533,7 @@ class AutonomyStatus final : int state_; }; union { Impl_ _impl_; }; - friend struct ::TableStruct_modules_2fMissionModule_2eproto; + friend struct ::TableStruct_MissionModule_2eproto; }; // ------------------------------------------------------------------- @@ -691,7 +691,6 @@ class AutonomyCommand final : enum : int { kStopsFieldNumber = 1, - kRouteStationsFieldNumber = 4, kRouteFieldNumber = 2, kActionFieldNumber = 3, }; @@ -713,24 +712,6 @@ class AutonomyCommand final : const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::MissionModule::Station >& stops() const; - // repeated .MissionModule.Station routeStations = 4; - int routestations_size() const; - private: - int _internal_routestations_size() const; - public: - void clear_routestations(); - ::MissionModule::Station* mutable_routestations(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::MissionModule::Station >* - mutable_routestations(); - private: - const ::MissionModule::Station& _internal_routestations(int index) const; - ::MissionModule::Station* _internal_add_routestations(); - public: - const ::MissionModule::Station& routestations(int index) const; - ::MissionModule::Station* add_routestations(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::MissionModule::Station >& - routestations() const; - // string route = 2; void clear_route(); const std::string& route() const; @@ -763,13 +744,12 @@ class AutonomyCommand final : typedef void DestructorSkippable_; struct Impl_ { ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::MissionModule::Station > stops_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::MissionModule::Station > routestations_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr route_; int action_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; }; union { Impl_ _impl_; }; - friend struct ::TableStruct_modules_2fMissionModule_2eproto; + friend struct ::TableStruct_MissionModule_2eproto; }; // ------------------------------------------------------------------- @@ -926,7 +906,7 @@ class AutonomyError final : mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; }; union { Impl_ _impl_; }; - friend struct ::TableStruct_modules_2fMissionModule_2eproto; + friend struct ::TableStruct_MissionModule_2eproto; }; // ------------------------------------------------------------------- @@ -1099,7 +1079,7 @@ class Station final : mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; }; union { Impl_ _impl_; }; - friend struct ::TableStruct_modules_2fMissionModule_2eproto; + friend struct ::TableStruct_MissionModule_2eproto; }; // ------------------------------------------------------------------- @@ -1269,7 +1249,7 @@ class Position final : mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; }; union { Impl_ _impl_; }; - friend struct ::TableStruct_modules_2fMissionModule_2eproto; + friend struct ::TableStruct_MissionModule_2eproto; }; // =================================================================== @@ -1730,46 +1710,6 @@ inline void AutonomyCommand::set_action(::MissionModule::AutonomyCommand_Action // @@protoc_insertion_point(field_set:MissionModule.AutonomyCommand.action) } -// repeated .MissionModule.Station routeStations = 4; -inline int AutonomyCommand::_internal_routestations_size() const { - return _impl_.routestations_.size(); -} -inline int AutonomyCommand::routestations_size() const { - return _internal_routestations_size(); -} -inline void AutonomyCommand::clear_routestations() { - _impl_.routestations_.Clear(); -} -inline ::MissionModule::Station* AutonomyCommand::mutable_routestations(int index) { - // @@protoc_insertion_point(field_mutable:MissionModule.AutonomyCommand.routeStations) - return _impl_.routestations_.Mutable(index); -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::MissionModule::Station >* -AutonomyCommand::mutable_routestations() { - // @@protoc_insertion_point(field_mutable_list:MissionModule.AutonomyCommand.routeStations) - return &_impl_.routestations_; -} -inline const ::MissionModule::Station& AutonomyCommand::_internal_routestations(int index) const { - return _impl_.routestations_.Get(index); -} -inline const ::MissionModule::Station& AutonomyCommand::routestations(int index) const { - // @@protoc_insertion_point(field_get:MissionModule.AutonomyCommand.routeStations) - return _internal_routestations(index); -} -inline ::MissionModule::Station* AutonomyCommand::_internal_add_routestations() { - return _impl_.routestations_.Add(); -} -inline ::MissionModule::Station* AutonomyCommand::add_routestations() { - ::MissionModule::Station* _add = _internal_add_routestations(); - // @@protoc_insertion_point(field_add:MissionModule.AutonomyCommand.routeStations) - return _add; -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::MissionModule::Station >& -AutonomyCommand::routestations() const { - // @@protoc_insertion_point(field_list:MissionModule.AutonomyCommand.routeStations) - return _impl_.routestations_; -} - // ------------------------------------------------------------------- // AutonomyError @@ -2058,4 +1998,4 @@ PROTOBUF_NAMESPACE_CLOSE // @@protoc_insertion_point(global_scope) #include -#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_modules_2fMissionModule_2eproto +#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_MissionModule_2eproto diff --git a/lib/protobuf-mission-module/MissionModule.proto b/lib/protobuf-mission-module/MissionModule.proto index 7013742..1d739a7 100644 --- a/lib/protobuf-mission-module/MissionModule.proto +++ b/lib/protobuf-mission-module/MissionModule.proto @@ -130,11 +130,6 @@ message AutonomyCommand{ string route = 2; Action action = 3; - - /** - * Positions of all stations on the route - */ - repeated Station routeStations = 4; } /* diff --git a/source/external_server_api.cpp b/source/external_server_api.cpp index 52dcf42..5ebd2f3 100644 --- a/source/external_server_api.cpp +++ b/source/external_server_api.cpp @@ -145,12 +145,13 @@ int forward_status(const buffer device_status, const device_identification devic } auto con = static_cast (context); - std::unique_lock lock(con->mutex); if(device.device_type == bamm::AUTONOMY_DEVICE_TYPE) { std::string device_status_str; auto device_status_parsed = bringauto::protobuf::ProtobufHelper::parseAutonomyStatus(device_status); - google::protobuf::util::MessageToJsonString(device_status_parsed, &device_status_str); + auto protobuf_options = google::protobuf::util::JsonPrintOptions(); + protobuf_options.always_print_primitive_fields = true; + google::protobuf::util::MessageToJsonString(device_status_parsed, &device_status_str, protobuf_options); bringauto::fleet_protocol::cxx::BufferAsString device_role(&device.device_role); bringauto::fleet_protocol::cxx::BufferAsString device_name(&device.device_name); @@ -255,9 +256,18 @@ int wait_for_command(int timeout_time_in_ms, void *context) { } for(auto command : commands) { + if(command->getTimestamp() > con->last_command_timestamp) { + con->last_command_timestamp = command->getTimestamp(); + } + auto received_device_id = command->getDeviceId(); MissionModule::AutonomyCommand proto_command {}; - google::protobuf::util::JsonStringToMessage(command->getPayload()->getData()->getJson().serialize(), &proto_command); + const auto parse_status = google::protobuf::util::JsonStringToMessage( + command->getPayload()->getData()->getJson().serialize(), &proto_command + ); + if(!parse_status.ok()) { + return NOT_OK; + } std::string command_str; proto_command.SerializeToString(&command_str); @@ -268,10 +278,6 @@ int wait_for_command(int timeout_time_in_ms, void *context) { received_device_id->getRole(), received_device_id->getName() )); - - if(command->getTimestamp() > con->last_command_timestamp) { - con->last_command_timestamp = command->getTimestamp(); - } } if(commands.empty()) {